This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430 RTOS 如何创建多线程

Expert 2115 points


MSP430 RTOS 如何创建多线程,在主函数加入以下代码:

Task_Params params;
    Error_Block eb;
    Error_init(&eb);
    Task_Params_init(&params);
    params.instance->name = "myTsk0";
    Task_Handle myTsk0 = Task_create(myTsk0Func, &params, &eb);
    if (myTsk0 == NULL)
    {
      System_abort("myTsk0 create failed");
    }

线程函数:

Void myTsk0Func(UArg arg0, UArg arg1)
{
 System_printf("myTsk0 Entering\n");
 Task_yield();
 System_printf("myTsk0 Exiting\n");
 GPIO_write(Board_LED0, Board_LED_ON);
}

但是线程并为真正创建,这是为什么?