mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Fine tune RGB sleep period
This commit is contained in:
@@ -24,6 +24,6 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
|
|
||||||
writer.write_colour_block(&key_colours)?;
|
writer.write_colour_block(&key_colours)?;
|
||||||
|
|
||||||
std::thread::sleep(std::time::Duration::from_millis(250));
|
//std::thread::sleep(std::time::Duration::from_millis(250));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
writer.init_effect()?;
|
writer.init_effect()?;
|
||||||
let rows = layout.get_rows();
|
let rows = layout.get_rows();
|
||||||
|
|
||||||
let mut fade = 17;
|
let mut fade = 50;
|
||||||
let mut flip = false;
|
let mut flip = false;
|
||||||
loop {
|
loop {
|
||||||
for row in rows {
|
for row in rows {
|
||||||
@@ -33,6 +33,5 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
} else {
|
} else {
|
||||||
flip = !flip;
|
flip = !flip;
|
||||||
}
|
}
|
||||||
std::thread::sleep(std::time::Duration::from_millis(10));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ impl AuraDbusWriter {
|
|||||||
let connection = Connection::new_system()?;
|
let connection = Connection::new_system()?;
|
||||||
Ok(AuraDbusWriter {
|
Ok(AuraDbusWriter {
|
||||||
connection: Box::new(connection),
|
connection: Box::new(connection),
|
||||||
block_time: 20,
|
block_time: 50,
|
||||||
stop: Arc::new(AtomicBool::new(false)),
|
stop: Arc::new(AtomicBool::new(false)),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -147,10 +147,11 @@ where
|
|||||||
/// Should only be used if the bytes you are writing are verified correct
|
/// Should only be used if the bytes you are writing are verified correct
|
||||||
#[inline]
|
#[inline]
|
||||||
async fn write_bytes(&self, message: &[u8]) -> Result<(), AuraError> {
|
async fn write_bytes(&self, message: &[u8]) -> Result<(), AuraError> {
|
||||||
|
let prev_time = std::time::Instant::now();
|
||||||
match unsafe { self.handle.as_ref() }.write_interrupt(
|
match unsafe { self.handle.as_ref() }.write_interrupt(
|
||||||
self.led_endpoint,
|
self.led_endpoint,
|
||||||
message,
|
message,
|
||||||
Duration::from_millis(2),
|
Duration::from_millis(5),
|
||||||
) {
|
) {
|
||||||
Ok(_) => {}
|
Ok(_) => {}
|
||||||
Err(err) => match err {
|
Err(err) => match err {
|
||||||
@@ -158,6 +159,10 @@ where
|
|||||||
_ => error!("Failed to write to led interrupt: {:?}", err),
|
_ => error!("Failed to write to led interrupt: {:?}", err),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
println!(
|
||||||
|
"Took: {:?}",
|
||||||
|
std::time::Instant::now().duration_since(prev_time)
|
||||||
|
);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user