Add "Unknown" to (not really) supported AniMe list

Intention is to allow users to at least control the power state of the
device (turn off) if the phyciscal display isn't yet supported.

Partial address of #354
This commit is contained in:
Luke D. Jones
2023-05-28 21:04:43 +12:00
parent fa671e53d8
commit 3a18506510
4 changed files with 21 additions and 1 deletions

View File

@@ -38,6 +38,7 @@ pub struct AnimePowerStates {
pub enum AnimeType {
GA401,
GA402,
Unknown,
}
impl AnimeType {
@@ -45,6 +46,7 @@ impl AnimeType {
pub fn width(&self) -> usize {
match self {
AnimeType::GA401 | AnimeType::GA402 => 74,
AnimeType::Unknown => 0,
}
}
@@ -53,6 +55,7 @@ impl AnimeType {
match self {
AnimeType::GA401 => 36,
AnimeType::GA402 => 39,
AnimeType::Unknown => 0,
}
}
@@ -61,6 +64,7 @@ impl AnimeType {
match self {
AnimeType::GA401 => PANE_LEN * 2,
AnimeType::GA402 => PANE_LEN * 3,
AnimeType::Unknown => 0,
}
}
}
@@ -125,6 +129,7 @@ impl TryFrom<AnimeDataBuffer> for AnimePacketType {
let mut buffers = match anime.anime {
AnimeType::GA401 => vec![[0; 640]; 2],
AnimeType::GA402 => vec![[0; 640]; 3],
AnimeType::Unknown => vec![[0; 640]; 1],
};
for (idx, chunk) in anime.data.as_slice().chunks(PANE_LEN).enumerate() {