mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
make keyboard tick() blocks non-fatal
at the moment if for some reason the USB stack can't send a tick there's a panic. it's not actually a life-ending event if that happens.
This commit is contained in:
parent
0e5fb14894
commit
a7ce3e6204
1 changed files with 5 additions and 5 deletions
|
|
@ -180,7 +180,7 @@ fn main() -> ! {
|
||||||
{
|
{
|
||||||
let keyboard = composite.interface::<NKROBootKeyboardInterface<'_, _, _,>, _>();
|
let keyboard = composite.interface::<NKROBootKeyboardInterface<'_, _, _,>, _>();
|
||||||
keyboard.write_report(&Vec::<Keyboard>::new()).ok();
|
keyboard.write_report(&Vec::<Keyboard>::new()).ok();
|
||||||
keyboard.tick().unwrap();
|
keyboard.tick().ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(any(target_os = "none", target_os = "xous"))]
|
#[cfg(any(target_os = "none", target_os = "xous"))]
|
||||||
|
|
@ -414,11 +414,11 @@ fn main() -> ! {
|
||||||
{
|
{
|
||||||
let keyboard = composite.interface::<NKROBootKeyboardInterface<'_, _, _,>, _>();
|
let keyboard = composite.interface::<NKROBootKeyboardInterface<'_, _, _,>, _>();
|
||||||
keyboard.write_report(&codes).ok();
|
keyboard.write_report(&codes).ok();
|
||||||
keyboard.tick().unwrap();
|
keyboard.tick().ok();
|
||||||
tt.sleep_ms(30).ok();
|
tt.sleep_ms(30).ok();
|
||||||
if auto_up {
|
if auto_up {
|
||||||
keyboard.write_report(&[]).ok(); // this is the key-up
|
keyboard.write_report(&[]).ok(); // this is the key-up
|
||||||
keyboard.tick().unwrap();
|
keyboard.tick().ok();
|
||||||
tt.sleep_ms(30).ok();
|
tt.sleep_ms(30).ok();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -450,10 +450,10 @@ fn main() -> ! {
|
||||||
{
|
{
|
||||||
let keyboard = composite.interface::<NKROBootKeyboardInterface<'_, _, _,>, _>();
|
let keyboard = composite.interface::<NKROBootKeyboardInterface<'_, _, _,>, _>();
|
||||||
keyboard.write_report(&codes).ok();
|
keyboard.write_report(&codes).ok();
|
||||||
keyboard.tick().unwrap();
|
keyboard.tick().ok();
|
||||||
tt.sleep_ms(30).ok();
|
tt.sleep_ms(30).ok();
|
||||||
keyboard.write_report(&[]).ok(); // this is the key-up
|
keyboard.write_report(&[]).ok(); // this is the key-up
|
||||||
keyboard.tick().unwrap();
|
keyboard.tick().ok();
|
||||||
tt.sleep_ms(30).ok();
|
tt.sleep_ms(30).ok();
|
||||||
}
|
}
|
||||||
sent += 1;
|
sent += 1;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue