Feat: add AniMe support for G835LW

This commit is contained in:
Denis Benato
2025-12-13 13:35:56 +01:00
parent e565ce748a
commit ee0e612c04
4 changed files with 42 additions and 22 deletions

View File

@@ -2,6 +2,12 @@
## [Unreleased] ## [Unreleased]
## [6.2.0]
## Changed
- Added aura support for FX607V: thanks @jomp16
- Added testing support for G835LW
## [6.1.22] ## [6.1.22]
### Changed ### Changed

View File

@@ -64,6 +64,7 @@ pub enum AnimeType {
GA402, GA402,
GU604, GU604,
G635L, G635L,
G835LW,
#[default] #[default]
Unsupported, Unsupported,
} }
@@ -72,11 +73,12 @@ impl FromStr for AnimeType {
type Err = AnimeError; type Err = AnimeError;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> { fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(match s { Ok(match s.to_uppercase().as_str() {
"ga401" | "GA401" => Self::GA401, "GA401" => Self::GA401,
"ga402" | "GA402" => Self::GA402, "GA402" => Self::GA402,
"gu604" | "GU604" => Self::GU604, "GU604" => Self::GU604,
"g635L" | "G635L" => Self::G635L, "G635L" => Self::G635L,
"G835LW" => Self::G835LW,
_ => Self::Unsupported, _ => Self::Unsupported,
}) })
} }
@@ -102,6 +104,7 @@ impl AnimeType {
pub fn width(&self) -> usize { pub fn width(&self) -> usize {
match self { match self {
AnimeType::GU604 => 70, AnimeType::GU604 => 70,
AnimeType::G835LW => 74,
_ => 74, _ => 74,
} }
} }
@@ -111,6 +114,7 @@ impl AnimeType {
match self { match self {
AnimeType::GA401 => 36, AnimeType::GA401 => 36,
AnimeType::GU604 => 43, AnimeType::GU604 => 43,
AnimeType::G835LW => 39,
_ => 39, _ => 39,
} }
} }
@@ -120,6 +124,7 @@ impl AnimeType {
match self { match self {
AnimeType::GA401 => PANE_LEN * 2, AnimeType::GA401 => PANE_LEN * 2,
AnimeType::GU604 => PANE_LEN * 3, AnimeType::GU604 => PANE_LEN * 3,
AnimeType::G835LW => PANE_LEN * 3,
_ => PANE_LEN * 3, _ => PANE_LEN * 3,
} }
} }
@@ -184,7 +189,11 @@ impl TryFrom<AnimeDataBuffer> for AnimePacketType {
let mut buffers = match anime.anime { let mut buffers = match anime.anime {
AnimeType::GA401 => vec![[0; 640]; 2], AnimeType::GA401 => vec![[0; 640]; 2],
AnimeType::GA402 | AnimeType::GU604 | AnimeType::G635L | AnimeType::Unsupported => { AnimeType::GA402
| AnimeType::GU604
| AnimeType::G635L
| AnimeType::G835LW
| AnimeType::Unsupported => {
vec![[0; 640]; 3] vec![[0; 640]; 3]
} }
}; };
@@ -197,7 +206,11 @@ impl TryFrom<AnimeDataBuffer> for AnimePacketType {
if matches!( if matches!(
anime.anime, anime.anime,
AnimeType::GA402 | AnimeType::GU604 | AnimeType::Unsupported AnimeType::GA402
| AnimeType::GU604
| AnimeType::G635L
| AnimeType::G835LW
| AnimeType::Unsupported
) { ) {
buffers[2][..7].copy_from_slice(&USB_PREFIX3); buffers[2][..7].copy_from_slice(&USB_PREFIX3);
} }

View File

@@ -245,16 +245,13 @@ pub fn get_anime_type() -> AnimeType {
let dmi = DMIID::new().unwrap_or_default(); let dmi = DMIID::new().unwrap_or_default();
let board_name = dmi.board_name; let board_name = dmi.board_name;
if board_name.contains("GA401I") || board_name.contains("GA401Q") { match board_name.to_uppercase().as_str() {
AnimeType::GA401 "GA401I" | "GA401Q" => AnimeType::GA401,
} else if board_name.contains("GA402R") || board_name.contains("GA402X") { "GA402R" | "GA402X" => AnimeType::GA402,
AnimeType::GA402 "GU604V" => AnimeType::GU604,
} else if board_name.contains("GU604V") { "G635L" => AnimeType::G635L,
AnimeType::GU604 "G835LW" => AnimeType::G835LW,
} else if board_name.contains("G635L") { _ => AnimeType::Unsupported,
AnimeType::G635L
} else {
AnimeType::Unsupported
} }
} }

View File

@@ -43,10 +43,12 @@ impl AniMatrix {
vertical: 2, vertical: 2,
horizontal: 5, horizontal: 5,
}, },
AnimeType::GA402 | AnimeType::G635L | AnimeType::Unsupported => LedShape { AnimeType::GA402 | AnimeType::G635L | AnimeType::G835LW | AnimeType::Unsupported => {
vertical: 2, LedShape {
horizontal: 5, vertical: 2,
}, horizontal: 5,
}
}
AnimeType::GU604 => LedShape { AnimeType::GU604 => LedShape {
vertical: 2, vertical: 2,
horizontal: 5, horizontal: 5,
@@ -56,7 +58,9 @@ impl AniMatrix {
// Do a hard mapping of each (derived from wireshardk captures) // Do a hard mapping of each (derived from wireshardk captures)
let rows = match model { let rows = match model {
AnimeType::GA401 => GA401.to_vec(), AnimeType::GA401 => GA401.to_vec(),
AnimeType::GA402 | AnimeType::G635L | AnimeType::Unsupported => GA402.to_vec(), AnimeType::GA402 | AnimeType::G635L | AnimeType::G835LW | AnimeType::Unsupported => {
GA402.to_vec()
}
AnimeType::GU604 => GU604.to_vec(), AnimeType::GU604 => GU604.to_vec(),
}; };