/*------------- MAIN -------------*/ int main(void) { board_init(); tusb_init(); while (1) { // tinyusb device task tud_task(); led_blinking_task(); } return 0; }
//TODO try to run with optimization Os int main(void) { board_init(); // TODO blocking wait --> systick handler --> ...... freeRTOS hardfault //wait_blocking_ms(1000); // wait a bit for power stable // print_greeting(); TODO uart output before freeRTOS scheduler start will lead to hardfault // find a way to fix this as tusb_init can output to uart when an error occurred tusb_init(); //------------- application task init -------------// (void) osal_task_create(&led_blinking_task_def); #if TUSB_CFG_HOST_HID_KEYBOARD keyboard_app_init(); #endif #if TUSB_CFG_HOST_HID_MOUSE mouse_app_init(); #endif #if TUSB_CFG_HOST_CDC cdc_serial_app_init(); #endif //------------- start OS scheduler (never return) -------------// #if TUSB_CFG_OS == TUSB_OS_FREERTOS vTaskStartScheduler(); #elif TUSB_CFG_OS == TUSB_OS_NONE os_none_start_scheduler(); #else #error need to start RTOS schduler #endif //------------- this part of code should not be reached -------------// hal_debugger_breakpoint(); while(1) { } return 0; }
//TODO try to run with optimization Os int main(void) { board_init(); // TODO blocking wait --> systick handler --> ...... freeRTOS hardfault //wait_blocking_ms(1000); // wait a bit for power stable // print_greeting(); TODO uart output before freeRTOS scheduler start will lead to hardfault // find a way to fix this as tusb_init can output to uart when an error occurred tusb_init(); //------------- start OS scheduler (never return) -------------// os_none_start_scheduler(); //------------- this part of code should not be reached -------------// hal_debugger_breakpoint(); while(1) { } return 0; }