From 5c83f0dcf4507dfda90fffa99879bf7ab92507e6 Mon Sep 17 00:00:00 2001 From: Naxdy Date: Mon, 14 Oct 2024 21:34:38 +0200 Subject: [PATCH] chore: add 1.2.0 notes --- .changelogs/v1.2.0.md | 9 +++++++++ Cargo.lock | 2 +- Cargo.toml | 2 +- src/usb_comms.rs | 30 ++++++++++++++++++------------ 4 files changed, 29 insertions(+), 14 deletions(-) create mode 100644 .changelogs/v1.2.0.md diff --git a/.changelogs/v1.2.0.md b/.changelogs/v1.2.0.md new file mode 100644 index 0000000..f5b2e22 --- /dev/null +++ b/.changelogs/v1.2.0.md @@ -0,0 +1,9 @@ +This release introduces a major new feature to combat a regression introduced in Switch firmware 19.0.0. For those unaware, Switch firmware 19.0.0 breaks compatibility with GCC adapters, including NaxGCC, which advertises itself as a GCC adapter. + +Starting with this version, you will be able to connect NaxGCC in "Pro-Controller Mode" by pressing and holding `Start` while plugging it in. This will cause the NaxGCC to advertise itself as a Nintendo Switch Pro Controller, and therefore be unaffected by the bug in the latest Switch firmware. All input consistency modes remain fully functional while in this mode, and your settings (including calibration) carry over as well. + +While in Pro-Controller Mode, pressing `Z+Start` will act like the home button on a regular Pro Controller. Additionally, pressing `L` will press both `L` and `ZL` at the same time (since the GCC only has one left shoulder button). This is useful if you want to map things like jump (short-hop macro) or shield (prevent rolling) to it. + +--- + +To update your firmware, plug in your controller while keeping the `A+X+Y` buttons held. Then drag & drop the `.uf2` file (found below, under Downloads) onto the storage device that appears. diff --git a/Cargo.lock b/Cargo.lock index e69fe6e..018213b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -866,7 +866,7 @@ checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "naxgcc-fw" -version = "1.1.1" +version = "1.2.0" dependencies = [ "cortex-m", "cortex-m-rt", diff --git a/Cargo.toml b/Cargo.toml index c02148b..491a026 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "naxgcc-fw" -version = "1.1.1" +version = "1.2.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/usb_comms.rs b/src/usb_comms.rs index d0b7333..85e41f2 100644 --- a/src/usb_comms.rs +++ b/src/usb_comms.rs @@ -117,6 +117,23 @@ struct UsbConfig { report_descriptor: &'static [u8], } +impl From for UsbConfig { + fn from(value: ControllerMode) -> Self { + match value { + ControllerMode::GcAdapter => Self { + vid: 0x057e, + pid: 0x0337, + report_descriptor: GCC_REPORT_DESCRIPTOR, + }, + ControllerMode::Procon => Self { + vid: 0x57e, + pid: 0x2009, + report_descriptor: PROCON_REPORT_DESCRIPTOR, + }, + } + } +} + struct MyDeviceHandler { configured: bool, } @@ -306,18 +323,7 @@ pub async fn usb_transfer_task(raw_serial: [u8; 8], driver: EmbassyDriver<'stati MUTEX_CONTROLLER_MODE.lock().await.unwrap() }; - let config = match controller_mode { - ControllerMode::GcAdapter => UsbConfig { - vid: 0x057e, - pid: 0x0337, - report_descriptor: GCC_REPORT_DESCRIPTOR, - }, - ControllerMode::Procon => UsbConfig { - vid: 0x57e, - pid: 0x2009, - report_descriptor: PROCON_REPORT_DESCRIPTOR, - }, - }; + let config = UsbConfig::from(controller_mode); let mut serial_buffer = [0u8; 64];