From 7403b9731b39a5e90f99c85c705f1473082328ed Mon Sep 17 00:00:00 2001 From: tmk Date: Thu, 14 Dec 2023 00:46:46 +0900 Subject: [PATCH] usb_usb: Support for remote wakeup from keyboard --- converter/usb_usb/usb_usb.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/converter/usb_usb/usb_usb.cpp b/converter/usb_usb/usb_usb.cpp index e649a9a2..af398e85 100644 --- a/converter/usb_usb/usb_usb.cpp +++ b/converter/usb_usb/usb_usb.cpp @@ -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(); +}