Wake up on keyboard events
This commit is contained in:
parent
2d93c01421
commit
d1c15375e7
|
@ -150,8 +150,13 @@ void process_kbd_queue_task(device_t *state) {
|
||||||
if (!queue_try_peek(&state->kbd_queue, &report))
|
if (!queue_try_peek(&state->kbd_queue, &report))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
bool succeeded = false;
|
||||||
|
|
||||||
|
if (tud_suspended())
|
||||||
|
succeeded = tud_remote_wakeup();
|
||||||
|
else
|
||||||
/* ... try sending it to the host, if it's successful */
|
/* ... try sending it to the host, if it's successful */
|
||||||
bool succeeded = tud_hid_keyboard_report(REPORT_ID_KEYBOARD, report.modifier, report.keycode);
|
succeeded = tud_hid_keyboard_report(REPORT_ID_KEYBOARD, report.modifier, report.keycode);
|
||||||
|
|
||||||
/* ... then we can remove it from the queue. Race conditions shouldn't happen [tm] */
|
/* ... then we can remove it from the queue. Race conditions shouldn't happen [tm] */
|
||||||
if (succeeded)
|
if (succeeded)
|
||||||
|
|
Loading…
Reference in New Issue