mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Prepare for next work
This commit is contained in:
@@ -110,20 +110,26 @@ fn select_1866_device(prod: u16) -> LaptopBase {
|
||||
// TODO: actual check for the AniMe device here
|
||||
laptop.support_animatrix = true;
|
||||
// No AniMe, no RGB
|
||||
} else if board_name.starts_with("GA502")
|
||||
|| board_name.starts_with("GU502")
|
||||
{
|
||||
} else if board_name.starts_with("GA502") || board_name.starts_with("GU502") {
|
||||
info!("No RGB control available");
|
||||
// RGB, per-key settings, no zones
|
||||
} else if board_name.starts_with("GX502")
|
||||
|| board_name.starts_with("GX701")
|
||||
|| board_name.starts_with("G531")
|
||||
|| board_name.starts_with("GL531")
|
||||
|| board_name.starts_with("G532")
|
||||
{
|
||||
laptop.supported_modes = vec![
|
||||
SINGLE, BREATHING, STROBE, RAINBOW, STAR, RAIN, HIGHLIGHT, LASER, RIPPLE, PULSE, COMET,
|
||||
FLASH, RGB,
|
||||
];
|
||||
} else if board_name.starts_with("G531")
|
||||
|| board_name.starts_with("G731")
|
||||
{
|
||||
laptop.supported_modes = vec![
|
||||
SINGLE, BREATHING, STROBE, RAINBOW, STAR, RAIN, HIGHLIGHT, LASER, RIPPLE, PULSE, COMET,
|
||||
FLASH, MULTISTATIC, RGB,
|
||||
];
|
||||
// RGB, limited effects, no zones
|
||||
} else if board_name.starts_with("G512LI") || board_name.starts_with("G712LI") {
|
||||
laptop.supported_modes = vec![SINGLE, BREATHING, STROBE, RAINBOW, PULSE];
|
||||
|
||||
@@ -83,12 +83,28 @@ where
|
||||
/// Should only be used if the bytes you are writing are verified correct
|
||||
#[inline]
|
||||
async fn write_bytes(&self, message: &[u8]) -> Result<(), RogError> {
|
||||
println!("1 Wrote: {:X?}", message);
|
||||
match unsafe { self.handle.as_ref() }.write_interrupt(
|
||||
self.led_endpoint,
|
||||
message,
|
||||
Duration::from_millis(5),
|
||||
) {
|
||||
Ok(_) => {}
|
||||
Ok(_) => {
|
||||
let mut buf = [0; 32];
|
||||
match unsafe { self.handle.as_ref() }.read_interrupt(
|
||||
0x83,
|
||||
&mut buf,
|
||||
Duration::from_millis(5),
|
||||
) {
|
||||
Ok(_) => {
|
||||
println!("2 Read: {:X?}", buf);
|
||||
}
|
||||
Err(err) => match err {
|
||||
rusb::Error::Timeout => {}
|
||||
_ => error!("Failed to read to led interrupt: {:?}", err),
|
||||
},
|
||||
}
|
||||
}
|
||||
Err(err) => match err {
|
||||
rusb::Error::Timeout => {}
|
||||
_ => error!("Failed to write to led interrupt: {:?}", err),
|
||||
|
||||
Reference in New Issue
Block a user