Browse Source

Deactivate camera after taking the picture

pull/65/head
Steve Cook 2 years ago
parent
commit
01ce122730
  1. 18
      ctru-rs/src/services/cam.rs

18
ctru-rs/src/services/cam.rs

@ -387,17 +387,6 @@ pub trait Camera { @@ -387,17 +387,6 @@ pub trait Camera {
}
}
fn deactivate(&mut self) -> crate::Result<()> {
unsafe {
let r = ctru_sys::CAMU_Activate(ctru_sys::SELECT_NONE);
if r < 0 {
Err(r.into())
} else {
Ok(())
}
}
}
fn set_exposure(&mut self, exposure: i8) -> crate::Result<()> {
unsafe {
let r = ctru_sys::CAMU_SetExposure(self.camera_as_raw(), exposure);
@ -863,6 +852,13 @@ pub trait Camera { @@ -863,6 +852,13 @@ pub trait Camera {
}
};
unsafe {
let r = ctru_sys::CAMU_Activate(ctru_sys::SELECT_NONE);
if r < 0 {
return Err(r.into());
}
};
Ok(buf)
}
}

Loading…
Cancel
Save