From 01ce122730ece62c3906ae45ab6c89e2055f49bf Mon Sep 17 00:00:00 2001 From: Steve Cook Date: Tue, 23 Aug 2022 09:00:57 -0400 Subject: [PATCH] Deactivate camera after taking the picture --- ctru-rs/src/services/cam.rs | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/ctru-rs/src/services/cam.rs b/ctru-rs/src/services/cam.rs index deb86ef..0a4d799 100644 --- a/ctru-rs/src/services/cam.rs +++ b/ctru-rs/src/services/cam.rs @@ -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 { } }; + unsafe { + let r = ctru_sys::CAMU_Activate(ctru_sys::SELECT_NONE); + if r < 0 { + return Err(r.into()); + } + }; + Ok(buf) } }