mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-19 09:00:54 +00:00
tweak delays for more consistent key down reporting
This commit is contained in:
parent
71f5183766
commit
3f779d5def
2 changed files with 1 additions and 4 deletions
|
|
@ -543,10 +543,6 @@ impl UsbBus for SpinalUsbDevice {
|
||||||
|
|
||||||
core::sync::atomic::compiler_fence(core::sync::atomic::Ordering::SeqCst);
|
core::sync::atomic::compiler_fence(core::sync::atomic::Ordering::SeqCst);
|
||||||
log::debug!("ep{} write: {:x?}", ep_addr.index(), &buf);
|
log::debug!("ep{} write: {:x?}", ep_addr.index(), &buf);
|
||||||
if ep_addr.index() == 0 {
|
|
||||||
// TODO: why is this delay necessary? there is a race condition, but I don't know where.
|
|
||||||
//self.tt.sleep_ms(1).unwrap();
|
|
||||||
}
|
|
||||||
Ok(buf.len())
|
Ok(buf.len())
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -206,6 +206,7 @@ fn xmain() -> ! {
|
||||||
let code = hid_convert(key);
|
let code = hid_convert(key);
|
||||||
keyboard.interface().write_report(&code).ok();
|
keyboard.interface().write_report(&code).ok();
|
||||||
keyboard.interface().tick().unwrap();
|
keyboard.interface().tick().unwrap();
|
||||||
|
tt.sleep_ms(20).unwrap();
|
||||||
keyboard.interface().write_report(&[]).ok(); // this is the key-up
|
keyboard.interface().write_report(&[]).ok(); // this is the key-up
|
||||||
keyboard.interface().tick().unwrap();
|
keyboard.interface().tick().unwrap();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue