Update chibios.c

This commit is contained in:
lalalademaxiya1 2023-10-23 10:15:58 +08:00
parent de124f6f25
commit 944aa4a88e

View File

@ -179,31 +179,6 @@ void protocol_post_init(void) {
host_set_driver(driver); 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) { void protocol_pre_task(void) {
usb_event_queue_task(); usb_event_queue_task();
@ -228,7 +203,6 @@ void protocol_pre_task(void) {
} }
#endif #endif
} }
#endif
void protocol_post_task(void) { void protocol_post_task(void) {
#ifdef CONSOLE_ENABLE #ifdef CONSOLE_ENABLE