mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Adjust dbus sleep for aura crate
This commit is contained in:
@@ -1,13 +1,18 @@
|
|||||||
use rog_aura::AnimatrixDbusWriter;
|
use rog_aura::AnimatrixDbusWriter;
|
||||||
|
|
||||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
const PANE1_PREFIX: [u8; 7] = [0x5e, 0xc0, 0x02, 0x01, 0x00, 0x73, 0x02];
|
||||||
let mut writer = AnimatrixDbusWriter::new()?;
|
const PANE2_PREFIX: [u8; 7] = [0x5e, 0xc0, 0x02, 0x74, 0x02, 0x73, 0x02];
|
||||||
|
|
||||||
let mut send_buffer = [vec![0; 640], vec![0; 640]];
|
fn main() {
|
||||||
|
let mut writer = AnimatrixDbusWriter::new().unwrap();
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
writer.write_image(&send_buffer)?;
|
for brightness in 0..0xFF {
|
||||||
|
let mut buffers = [vec![brightness; 640], vec![brightness; 640]];
|
||||||
|
buffers[0][..7].copy_from_slice(&PANE1_PREFIX);
|
||||||
|
buffers[0][..7].copy_from_slice(&PANE2_PREFIX);
|
||||||
|
|
||||||
//std::thread::sleep(std::time::Duration::from_millis(60));
|
writer.write_image(&buffers).unwrap();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ impl AnimatrixDbusWriter {
|
|||||||
let connection = Connection::new_system()?;
|
let connection = Connection::new_system()?;
|
||||||
Ok(AnimatrixDbusWriter {
|
Ok(AnimatrixDbusWriter {
|
||||||
connection: Box::new(connection),
|
connection: Box::new(connection),
|
||||||
block_time: 100,
|
block_time: 25,
|
||||||
stop: Arc::new(AtomicBool::new(false)),
|
stop: Arc::new(AtomicBool::new(false)),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user