mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Feat: add AniMe support for G835LW
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user