forked from NaxdyOrg/NaxGCC-FW
feat(HID): get state on-demand to improve latency
This commit is contained in:
parent
84d531e80a
commit
c7fd7e72c9
1 changed files with 9 additions and 4 deletions
|
@ -353,11 +353,16 @@ pub async fn usb_transfer_task(
|
||||||
ticker.next().await;
|
ticker.next().await;
|
||||||
}
|
}
|
||||||
|
|
||||||
let state = gcc_subscriber.next_message_pure().await;
|
match writer
|
||||||
let report = get_gcinput_hid_report(&state);
|
.write(&{
|
||||||
match writer.write(&report).await {
|
let state = gcc_subscriber.next_message_pure().await;
|
||||||
Ok(()) => {
|
let report = get_gcinput_hid_report(&state);
|
||||||
trace!("Report Written: {:08b}", report);
|
trace!("Report Written: {:08b}", report);
|
||||||
|
report
|
||||||
|
})
|
||||||
|
.await
|
||||||
|
{
|
||||||
|
Ok(()) => {
|
||||||
let currtime = Instant::now();
|
let currtime = Instant::now();
|
||||||
let polltime = currtime.duration_since(lasttime);
|
let polltime = currtime.duration_since(lasttime);
|
||||||
let micros = polltime.as_micros();
|
let micros = polltime.as_micros();
|
||||||
|
|
Loading…
Reference in a new issue