From: flabbergast Date: Thu, 11 Feb 2016 21:12:19 +0000 (+0000) Subject: Chibios: Fix a HardFault bug (wait after start). X-Git-Url: https://git.friedersdorff.com/?a=commitdiff_plain;h=fdf808ee24fe8cdfbad7d3f6db905489549564bb;p=max%2Ftmk_keyboard.git Chibios: Fix a HardFault bug (wait after start). --- 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 */