From 944aa4a88eeec4210c0273a822a3d9177ef50b97 Mon Sep 17 00:00:00 2001 From: lalalademaxiya1 <2831039915@qq.com> Date: Mon, 23 Oct 2023 10:15:58 +0800 Subject: [PATCH] Update chibios.c --- tmk_core/protocol/chibios/chibios.c | 34 ++++------------------------- 1 file changed, 4 insertions(+), 30 deletions(-) diff --git a/tmk_core/protocol/chibios/chibios.c b/tmk_core/protocol/chibios/chibios.c index 74d8040df5..4d97f1cd82 100644 --- a/tmk_core/protocol/chibios/chibios.c +++ b/tmk_core/protocol/chibios/chibios.c @@ -179,35 +179,10 @@ void protocol_post_init(void) { host_set_driver(driver); } -#if defined(STM32_USB_USE_OTG1) -void protocol_pre_task(void) { -# if !defined(NO_USB_STARTUP_CHECK) - if (USB_DRIVER.state == USB_SUSPENDED) { - dprintln("suspending keyboard"); - while (USB_DRIVER.state == USB_SUSPENDED) { - /* Do this in the suspended state */ - suspend_power_down(); // on AVR this deep sleeps for 15ms - /* Remote wakeup */ - if ((USB_DRIVER.status & USB_GETSTATUS_REMOTE_WAKEUP_ENABLED) && suspend_wakeup_condition()) { - usbWakeupHost(&USB_DRIVER); - wait_ms(300); - } - } - /* Woken up */ - // variables has been already cleared by the wakeup hook - send_keyboard_report(); -# ifdef MOUSEKEY_ENABLE - mousekey_send(); -# endif /* MOUSEKEY_ENABLE */ - } -# endif - usb_event_queue_task(); -} -#else void protocol_pre_task(void) { usb_event_queue_task(); -# if !defined(NO_USB_STARTUP_CHECK) +#if !defined(NO_USB_STARTUP_CHECK) if (USB_DRIVER.state == USB_SUSPENDED) { dprintln("suspending keyboard"); while (USB_DRIVER.state == USB_SUSPENDED) { @@ -222,13 +197,12 @@ void protocol_pre_task(void) { /* Woken up */ // variables has been already cleared by the wakeup hook send_keyboard_report(); -# ifdef MOUSEKEY_ENABLE +# ifdef MOUSEKEY_ENABLE mousekey_send(); -# endif /* MOUSEKEY_ENABLE */ +# endif /* MOUSEKEY_ENABLE */ } -# endif -} #endif +} void protocol_post_task(void) { #ifdef CONSOLE_ENABLE