]> git.friedersdorff.com Git - max/tmk_keyboard.git/blobdiff - tmk_core/protocol/chibios/main.c
Chibios: Fix a HardFault bug (wait after start).
[max/tmk_keyboard.git] / tmk_core / protocol / chibios / main.c
index b62cfa9c57e8392131e652be40135b69a41ef376..d588e4de06f9beaab67e8fa82dae5755d1bc2a13 100644 (file)
@@ -101,6 +101,13 @@ int main(void) {
   while(USB_DRIVER.state != USB_ACTIVE)
     chThdSleepMilliseconds(50);
 
+  /* Do need to wait here!
+   * Otherwise the next print might start a transfer on console EP
+   * before the USB is completely ready, which sometimes causes
+   * HardFaults.
+   */
+  chThdSleepMilliseconds(50);
+
   print("USB configured.\n");
 
   /* init TMK modules */