]> git.friedersdorff.com Git - max/tmk_keyboard.git/commitdiff
core: lufa: Fix wait for console startup
authortmk <hasu@tmk-kbd.com>
Sun, 23 Sep 2018 02:40:06 +0000 (11:40 +0900)
committertmk <hasu@tmk-kbd.com>
Sun, 23 Sep 2018 03:36:18 +0000 (12:36 +0900)
tmk_core/protocol/lufa/lufa.c

index cfd76c2edfa6c6503325b5d77475c9fc51175df1..b1567fa9bdac242dfbe9a12395c7db8212177748 100644 (file)
@@ -634,15 +634,19 @@ int main(void)
     keyboard_init();
 
     /* wait for Console startup */
-    // TODO: long delay often works anyhoo but proper startup would be better
-    // 1000ms delay of hid_listen may affect this
-    uint16_t delay = 2000;
-    while (delay--) {
-#ifndef INTERRUPT_CONTROL_ENDPOINT
-        USB_USBTask();
-#endif
-        _delay_ms(1);
+    // TODO: 2000ms delay often works anyhoo but proper startup would be better
+    // 1000ms delay of hid_listen affects this probably
+    #ifdef CONSOLE_ENABLE
+    if (debug_enable) {
+        uint16_t delay = 2000;
+        while (delay--) {
+            #ifndef INTERRUPT_CONTROL_ENDPOINT
+            USB_USBTask();
+            #endif
+            _delay_ms(1);
+        }
     }
+    #endif
 
     hook_late_init();