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]
## [6.2.0]
## Changed
- Added aura support for FX607V: thanks @jomp16
- Added testing support for G835LW
## [6.1.22]
### Changed

View File

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

View File

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

View File

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