X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;f=tmk_core%2Fprotocol%2Fchibios%2Fmain.c;h=d588e4de06f9beaab67e8fa82dae5755d1bc2a13;hb=fdf808ee24fe8cdfbad7d3f6db905489549564bb;hp=b62cfa9c57e8392131e652be40135b69a41ef376;hpb=b1b30f167587349acbb7dc4f286a8742b8b63d00;p=max%2Ftmk_keyboard.git diff --git a/tmk_core/protocol/chibios/main.c b/tmk_core/protocol/chibios/main.c index b62cfa9c..d588e4de 100644 --- a/tmk_core/protocol/chibios/main.c +++ b/tmk_core/protocol/chibios/main.c @@ -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 */