Wait for USB starting up to make debug print available
authortmk <nobody@nowhere>
Mon, 18 Nov 2013 18:20:25 +0000 (03:20 +0900)
committertmk <nobody@nowhere>
Mon, 18 Nov 2013 18:20:25 +0000 (03:20 +0900)
common/action_util.h
protocol/lufa/lufa.c

index 939bc2b662df53123567861d567a85e050da6b8f..f9d3161a800200be9b808c2a799e4f930107e095 100644 (file)
@@ -18,6 +18,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define ACTION_UTIL_H
 
 #include <stdint.h>
+#include "report.h"
 
 extern report_keyboard_t *keyboard_report;
 
index a230d5ba20f2920b01c0eee7717ac783b08dd98e..04e8e78f381fd9f821be2a45aea3b9bcab4cee2a 100644 (file)
@@ -539,11 +539,18 @@ int main(void)
 {
     SetupHardware();
     sei();
+
+    /* wait for USB startup & debug output */
+    while (USB_DeviceState != DEVICE_STATE_Configured) {
 #if defined(INTERRUPT_CONTROL_ENDPOINT)
-    while (USB_DeviceState != DEVICE_STATE_Configured) ;
+        ;
+#else
+        USB_USBTask();
 #endif
+    }
     print("USB configured.\n");
 
+    /* init modules */
     keyboard_init();
     host_set_driver(&lufa_driver);
 #ifdef SLEEP_LED_ENABLE
Imprint / Impressum