usb_usb: Support for remote wakeup from keyboard
This commit is contained in:
parent
ed1da263a5
commit
7403b9731b
1 changed files with 17 additions and 1 deletions
|
|
@ -236,10 +236,26 @@ void hook_usb_suspend_loop(void)
|
|||
suspend_power_down();
|
||||
#endif
|
||||
if (USB_Device_RemoteWakeupEnabled) {
|
||||
if (suspend_wakeup_condition()) {
|
||||
if (usb_host.checkRemoteWakeup()) {
|
||||
USB_Device_SendRemoteWakeup();
|
||||
}
|
||||
} else {
|
||||
matrix_scan();
|
||||
}
|
||||
}
|
||||
|
||||
static uint8_t _led_stats = 0;
|
||||
void hook_usb_suspend_entry(void)
|
||||
{
|
||||
matrix_clear();
|
||||
clear_keyboard();
|
||||
|
||||
usb_host.suspend();
|
||||
}
|
||||
|
||||
void hook_usb_wakeup(void)
|
||||
{
|
||||
suspend_wakeup_init();
|
||||
|
||||
usb_host.resume();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue