From e565ce748a47dda40f6b963c9f284e1d509cf06c Mon Sep 17 00:00:00 2001 From: Denis Benato Date: Sat, 13 Dec 2025 13:21:58 +0100 Subject: [PATCH] Feat: GA403WR -> GA403W --- rog-slash/src/data.rs | 20 ++++++++++---------- rog-slash/src/usb.rs | 6 +++--- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/rog-slash/src/data.rs b/rog-slash/src/data.rs index 47c18dac..eb4c71bf 100644 --- a/rog-slash/src/data.rs +++ b/rog-slash/src/data.rs @@ -13,7 +13,7 @@ use crate::usb::{PROD_ID1, PROD_ID1_STR, PROD_ID2, PROD_ID2_STR}; #[derive(Default, Debug, Copy, Clone, PartialEq, Eq, Deserialize, Serialize)] pub enum SlashType { GA403, - GA403WR, + GA403W, GA605, GU605, #[default] @@ -23,7 +23,7 @@ pub enum SlashType { impl SlashType { pub const fn prod_id(&self) -> u16 { match self { - SlashType::GA403WR => PROD_ID2, + SlashType::GA403W => PROD_ID2, SlashType::GA403 => PROD_ID1, SlashType::GA605 => PROD_ID2, SlashType::GU605 => PROD_ID1, @@ -33,7 +33,7 @@ impl SlashType { pub const fn prod_id_str(&self) -> &str { match self { - SlashType::GA403WR => PROD_ID2_STR, + SlashType::GA403W => PROD_ID2_STR, SlashType::GA403 => PROD_ID1_STR, SlashType::GA605 => PROD_ID2_STR, SlashType::GU605 => PROD_ID1_STR, @@ -43,8 +43,8 @@ impl SlashType { pub fn from_dmi() -> Self { let board_name = DMIID::new().unwrap_or_default().board_name.to_uppercase(); - if board_name.contains("GA403WR") { - SlashType::GA403WR + if board_name.contains("GA403W") { + SlashType::GA403W } else if board_name.contains("GA403") { SlashType::GA403 } else if board_name.contains("GA605") { @@ -61,11 +61,11 @@ impl FromStr for SlashType { type Err = SlashError; fn from_str(s: &str) -> std::result::Result { - Ok(match s { - "ga403wr" | "GA403WR" => Self::GA403WR, - "ga403" | "GA403" => Self::GA403, - "ga605" | "GA605" => Self::GA605, - "gu605" | "GU605" => Self::GU605, + Ok(match s.to_uppercase().as_str() { + "GA403W" => Self::GA403W, + "GA403" => Self::GA403, + "GA605" => Self::GA605, + "GU605" => Self::GU605, _ => Self::Unsupported, }) } diff --git a/rog-slash/src/usb.rs b/rog-slash/src/usb.rs index f9ba7098..bdca7bf0 100644 --- a/rog-slash/src/usb.rs +++ b/rog-slash/src/usb.rs @@ -38,8 +38,8 @@ pub fn get_slash_type() -> SlashType { .map_err(|_| SlashError::NoDevice) .unwrap_or_default(); let board_name = dmi.board_name; - if board_name.contains("GA403WR") { - SlashType::GA403WR + if board_name.contains("GA403W") { + SlashType::GA403W } else if board_name.contains("GA403") { SlashType::GA403 } else if board_name.contains("GA605") { @@ -53,7 +53,7 @@ pub fn get_slash_type() -> SlashType { pub const fn report_id(slash_type: SlashType) -> u8 { match slash_type { - SlashType::GA403WR => REPORT_ID_19B6, + SlashType::GA403W => REPORT_ID_19B6, SlashType::GA403 => REPORT_ID_193B, SlashType::GA605 => REPORT_ID_19B6, SlashType::GU605 => REPORT_ID_193B,