From 7f63384aa6eb4a9c6f325b3b756022227d156be0 Mon Sep 17 00:00:00 2001 From: Mark Drobnak Date: Sun, 29 Jan 2023 13:46:06 -0800 Subject: [PATCH] Initialize HID after ir:USER to try and fix New 3DS case --- ctru-rs/examples/ir-user.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ctru-rs/examples/ir-user.rs b/ctru-rs/examples/ir-user.rs index 24a9013..934d801 100644 --- a/ctru-rs/examples/ir-user.rs +++ b/ctru-rs/examples/ir-user.rs @@ -17,15 +17,18 @@ const CPP_POLLING_PERIOD_MS: u8 = 0x32; fn main() { ctru::init(); let apt = Apt::init().unwrap(); - let hid = Hid::init().unwrap(); let gfx = Gfx::init().unwrap(); let top_console = Console::init(gfx.top_screen.borrow_mut()); let bottom_console = Console::init(gfx.bottom_screen.borrow_mut()); - let demo = CirclePadProDemo::new(top_console, bottom_console); demo.print_status_info(); - println!("Press A to connect to the CPP"); + // Initialize HID after ir:USER because libctru also initializes ir:rst, + // which is mutually exclusive with ir:USER. Initializing HID before ir:USER + // on New 3DS causes ir:USER to not work. + let hid = Hid::init().unwrap(); + + println!("Press A to connect to the CPP, or Start to exit"); let mut is_connected = false; while apt.main_loop() {