mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Reformat with trailing comma
This commit is contained in:
@@ -65,5 +65,5 @@ pub const GA401: [Row; 63] = [
|
||||
Row(0xe7, 7 + 155, 11, 23),
|
||||
Row(0xe7, 7 + 166, 10, 24),
|
||||
Row(0xe7, 7 + 176, 10, 24),
|
||||
Row(0xe7, 7 + 186, 9, 25)
|
||||
Row(0xe7, 7 + 186, 9, 25),
|
||||
];
|
||||
|
||||
@@ -66,5 +66,5 @@ pub const GA402: [Row; 63] = [
|
||||
Row(0xe7, 7 + 155, 11, 23),
|
||||
Row(0xe7, 7 + 166, 10, 24),
|
||||
Row(0xe7, 7 + 176, 10, 24),
|
||||
Row(0xe7, 7 + 186, 9, 25)
|
||||
Row(0xe7, 7 + 186, 9, 25),
|
||||
];
|
||||
|
||||
@@ -66,5 +66,5 @@ pub const GU604: [Row; 64] = [
|
||||
Row(0xe7, 7 + 403, 14, 25),
|
||||
Row(0xe7, 7 + 417, 14, 25),
|
||||
Row(0xe7, 7 + 431, 13, 26),
|
||||
Row(0xe7, 7 + 444, 13, 26)
|
||||
Row(0xe7, 7 + 444, 13, 26),
|
||||
];
|
||||
|
||||
@@ -20,7 +20,7 @@ pub struct Row(
|
||||
/// The length to read inclusive
|
||||
pub usize,
|
||||
/// Offset to the right by how many LEDs
|
||||
pub i32
|
||||
pub i32,
|
||||
);
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
@@ -28,12 +28,12 @@ pub struct LedShape {
|
||||
/// Vertical offset from center for the top/bottom points
|
||||
pub vertical: i32,
|
||||
/// Horizontal offset from center for the top/bottom points
|
||||
pub horizontal: i32
|
||||
pub horizontal: i32,
|
||||
}
|
||||
|
||||
pub struct AniMatrix {
|
||||
rows: Vec<Row>,
|
||||
led_shape: LedShape
|
||||
led_shape: LedShape,
|
||||
}
|
||||
|
||||
impl AniMatrix {
|
||||
@@ -41,23 +41,23 @@ impl AniMatrix {
|
||||
let led_shape = match model {
|
||||
AnimeType::GA401 => LedShape {
|
||||
vertical: 2,
|
||||
horizontal: 5
|
||||
horizontal: 5,
|
||||
},
|
||||
AnimeType::GA402 | AnimeType::Unsupported => LedShape {
|
||||
vertical: 2,
|
||||
horizontal: 5
|
||||
horizontal: 5,
|
||||
},
|
||||
AnimeType::GU604 => LedShape {
|
||||
vertical: 2,
|
||||
horizontal: 5
|
||||
}
|
||||
horizontal: 5,
|
||||
},
|
||||
};
|
||||
|
||||
// Do a hard mapping of each (derived from wireshardk captures)
|
||||
let rows = match model {
|
||||
AnimeType::GA401 => GA401.to_vec(),
|
||||
AnimeType::GA402 | AnimeType::Unsupported => GA402.to_vec(),
|
||||
AnimeType::GU604 => GU604.to_vec()
|
||||
AnimeType::GU604 => GU604.to_vec(),
|
||||
};
|
||||
|
||||
Self { rows, led_shape }
|
||||
|
||||
@@ -17,7 +17,7 @@ use animatrix::*;
|
||||
pub struct VirtAnimeMatrix {
|
||||
device: UHIDDevice<std::fs::File>,
|
||||
buffer: [u8; 640],
|
||||
animatrix: AniMatrix
|
||||
animatrix: AniMatrix,
|
||||
}
|
||||
|
||||
impl VirtAnimeMatrix {
|
||||
@@ -84,10 +84,10 @@ impl VirtAnimeMatrix {
|
||||
|
||||
/* 85 bytes */
|
||||
]
|
||||
.to_vec()
|
||||
.to_vec(),
|
||||
})
|
||||
.map_err(|err| error!("Could not create virtual device: {:?}", err))
|
||||
.expect("Could not create virtual device")
|
||||
.expect("Could not create virtual device"),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user