int main (void) { // Explicitly set the vector table since the bootloader might not set // it to what we expect. #if DAPLINK_ROM_BL_SIZE > 0 SCB->VTOR = SCB_VTOR_TBLOFF_Msk & DAPLINK_ROM_IF_START; #endif os_sys_init_user(main_task, MAIN_TASK_PRIORITY, stk_main_task, MAIN_TASK_STACK); }
osThreadId_t osThreadNew(osThreadFunc_t func, void *argument, const osThreadAttr_t *attr) { OS_TID tid = 0; //first task will init the rtx if (taskCount == 0) { os_sys_init_user((void (*)(void))func, MAIN_TASK_PRIORITY, stk_main_task, MAIN_TASK_STACK); } else { tid = os_tsk_create((void (*)(void))func, MAIN_TASK_PRIORITY+1); } taskCount++; return (osThreadId_t) tid; }
// Main Program int main (void) { os_sys_init_user(main_task, MAIN_TASK_PRIORITY, stk_main_task, MAIN_TASK_STACK); }
// Main Program int main (void) { /* Allow the board to do some last initialization before the main task is started */ board_init(); os_sys_init_user(main_task, MAIN_TASK_PRIORITY, stk_main_task, MAIN_TASK_STACK); }