example to call tud_init() after freeRTOS kernel is started
add note for usb init when using with RTOS
This commit is contained in:
@@ -83,7 +83,6 @@ void cdc_task(void* params);
|
||||
int main(void)
|
||||
{
|
||||
board_init();
|
||||
tusb_init();
|
||||
|
||||
// soft timer for blinky
|
||||
blinky_tm = xTimerCreateStatic(NULL, pdMS_TO_TICKS(BLINK_NOT_MOUNTED), true, NULL, led_blinky_cb, &blinky_tmdef);
|
||||
@@ -116,6 +115,10 @@ void usb_device_task(void* param)
|
||||
{
|
||||
(void) param;
|
||||
|
||||
// This should be called after scheduler/kernel is started.
|
||||
// Otherwise it could cause kernel issue since USB IRQ handler does use RTOS queue API.
|
||||
tusb_init();
|
||||
|
||||
// RTOS forever loop
|
||||
while (1)
|
||||
{
|
||||
|
Reference in New Issue
Block a user