Animatrix: simulators, add features

This commit is contained in:
Luke D. Jones
2023-06-25 18:29:19 +12:00
parent 3d6d92ae7d
commit 8b77078a6f
8 changed files with 50 additions and 24 deletions

View File

@@ -1,3 +1,5 @@
use rog_anime::AnimeType;
use self::map_ga401::GA401;
use self::map_ga402::GA402;
use self::map_gu604::GU604;
@@ -6,12 +8,6 @@ mod map_ga401;
mod map_ga402;
mod map_gu604;
pub enum Model {
GA401,
GA402,
GU604,
}
#[derive(Clone, Copy)]
pub struct Row(
/// The USB packet index, this is mapped to the 4th byte (idx = 3) and is
@@ -41,17 +37,17 @@ pub struct AniMatrix {
}
impl AniMatrix {
pub fn new(model: Model) -> Self {
pub fn new(model: AnimeType) -> Self {
let led_shape = match model {
Model::GA401 => LedShape {
AnimeType::GA401 => LedShape {
vertical: 2,
horizontal: 5,
},
Model::GA402 => LedShape {
AnimeType::GA402 | AnimeType::Unknown => LedShape {
vertical: 2,
horizontal: 5,
},
Model::GU604 => LedShape {
AnimeType::GU604 => LedShape {
vertical: 2,
horizontal: 5,
},
@@ -59,9 +55,9 @@ impl AniMatrix {
// Do a hard mapping of each (derived from wireshardk captures)
let rows = match model {
Model::GA401 => GA401.to_vec(),
Model::GA402 => GA402.to_vec(),
Model::GU604 => GU604.to_vec(),
AnimeType::GA401 => GA401.to_vec(),
AnimeType::GA402 | AnimeType::Unknown => GA402.to_vec(),
AnimeType::GU604 => GU604.to_vec(),
};
Self { rows, led_shape }