Fine tune RGB sleep period

This commit is contained in:
Luke
2020-06-02 11:09:45 +12:00
parent c4cef7a9fe
commit ca5d625cec
4 changed files with 9 additions and 5 deletions

View File

@@ -147,10 +147,11 @@ where
/// Should only be used if the bytes you are writing are verified correct
#[inline]
async fn write_bytes(&self, message: &[u8]) -> Result<(), AuraError> {
let prev_time = std::time::Instant::now();
match unsafe { self.handle.as_ref() }.write_interrupt(
self.led_endpoint,
message,
Duration::from_millis(2),
Duration::from_millis(5),
) {
Ok(_) => {}
Err(err) => match err {
@@ -158,6 +159,10 @@ where
_ => error!("Failed to write to led interrupt: {:?}", err),
},
}
println!(
"Took: {:?}",
std::time::Instant::now().duration_since(prev_time)
);
Ok(())
}