From 73a3399d0ef7e06db70fc2964a3f2a35e9aca25d Mon Sep 17 00:00:00 2001 From: yiancar Date: Fri, 24 Aug 2018 15:38:31 +0300 Subject: Add the ability to disable the USB startup check for Chibios - Added support for NO_USB_STARTUP_CHECK. This allows the keyboard do function and not get stuck in a SUSPENDED state loop in case of no USB connection. - Added support for WAIT_FOR_USB. In LUFA no keyboard has this flag enable therefor no keyboard waits for usb to be active. - Added documentation for both configuration flags as they were missing. --- tmk_core/protocol/chibios/main.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tmk_core') diff --git a/tmk_core/protocol/chibios/main.c b/tmk_core/protocol/chibios/main.c index 568c1edb2..dcc6d9d07 100644 --- a/tmk_core/protocol/chibios/main.c +++ b/tmk_core/protocol/chibios/main.c @@ -142,10 +142,15 @@ int main(void) { /* Wait until the USB or serial link is active */ while (true) { +#if defined(WAIT_FOR_USB) || defined(SERIAL_LINK_ENABLE) if(USB_DRIVER.state == USB_ACTIVE) { driver = &chibios_driver; break; } +#else + driver = &chibios_driver; + break; +#endif #ifdef SERIAL_LINK_ENABLE if(is_serial_link_connected()) { driver = get_serial_link_driver(); @@ -178,6 +183,7 @@ int main(void) { /* Main loop */ while(true) { +#if !defined(NO_USB_STARTUP_CHECK) if(USB_DRIVER.state == USB_SUSPENDED) { print("[s]"); #ifdef VISUALIZER_ENABLE @@ -205,6 +211,7 @@ int main(void) { visualizer_resume(); #endif } +#endif keyboard_task(); #ifdef CONSOLE_ENABLE -- cgit v1.2.3-24-g4f1b