Am I writing slow code? No, it's the keyboard EC who is slow - Seymour

This commit is contained in:
Luke
2020-04-24 23:41:00 +12:00
parent 9846437efb
commit f05103b5c9
4 changed files with 118 additions and 27 deletions

View File

@@ -128,9 +128,16 @@ impl RogCore {
}
pub fn aura_write(&mut self, message: &[u8]) -> Result<(), AuraError> {
self.handle
.write_interrupt(self.led_endpoint, message, Duration::from_micros(1))
.unwrap();
match self
.handle
.write_interrupt(self.led_endpoint, message, Duration::from_millis(1))
{
Ok(_) => {}
Err(err) => match err {
rusb::Error::Timeout => {}
_ => error!("Failed to read keyboard interrupt: {:?}", err),
},
}
Ok(())
}