From de1604b36468f35abfee10b7a894f5ebd32c51d9 Mon Sep 17 00:00:00 2001 From: AzureMarker Date: Tue, 2 Jan 2024 17:29:26 -0500 Subject: [PATCH] Add ir:rst disable in CPP demo to improve New 3DS compatibility --- ctru-rs/examples/ir-user-circle-pad-pro.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ctru-rs/examples/ir-user-circle-pad-pro.rs b/ctru-rs/examples/ir-user-circle-pad-pro.rs index c3de057..43cf0e2 100644 --- a/ctru-rs/examples/ir-user-circle-pad-pro.rs +++ b/ctru-rs/examples/ir-user-circle-pad-pro.rs @@ -9,6 +9,7 @@ use ctru::services::svc::HandleExt; use ctru_sys::Handle; use std::time::Duration; +// Configuration for this demo of the Circle Pad Pro (not general purpose ir:USER values). const PACKET_INFO_SIZE: usize = 8; const MAX_PACKET_SIZE: usize = 32; const PACKET_COUNT: usize = 1; @@ -16,6 +17,13 @@ const PACKET_BUFFER_SIZE: usize = PACKET_COUNT * (PACKET_INFO_SIZE + MAX_PACKET_ const CPP_CONNECTION_POLLING_PERIOD_MS: u8 = 0x08; const CPP_POLLING_PERIOD_MS: u8 = 0x32; +// This export tells libctru to not initialize ir:rst when initializing HID. +// This is necessary on the New 3DS because ir:rst is mutually exclusive with ir:USER. +#[no_mangle] +unsafe extern "C" fn hidShouldUseIrrst() -> bool { + false +} + fn main() { let apt = Apt::new().unwrap(); let gfx = Gfx::new().unwrap();