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.

两个任务的切换

Other Parts Discussed in Thread: CC1310

利用CC1310例程两个任务的原代码,jlink下载不能实现多任务的切换,不知道什么原因

  • 多任务的基本结构就是在main函数里启动任务初始化函数

    例如:

    int main(void)
    {

    /* Call board init functions. */
    Board_initGeneral();

    /* Open LED pins */
    ledPinHandle = PIN_open(&ledPinState, pinTable);
    if(!ledPinHandle) {
    System_abort("Error initializing board LED pins\n");
    }

    //add by barbara -- begin
    /* Open Button pins */
    buttonPinHandle = PIN_open(&buttonPinState, buttonPinTable);
    if (!buttonPinHandle) {
    System_abort("Error initializing button pins\n");
    }
    //add by barbara -- end
    //System_printf("main\n");

    /* Clear LED pins */
    PIN_setOutputValue(ledPinHandle, Board_LED1, 0);
    PIN_setOutputValue(ledPinHandle, Board_LED2, 0);

    rxTask_init(ledPinHandle);        //original code

    UartTask_init();                            //add by WBJ

    /* Start BIOS */
    BIOS_start();

    return (0);
    }

    在不同的task里面,使用event或者queue来实现消息传递就可以了

  • http://www.deyisupport.com/question_answer/wireless_connectivity/f/45/p/105583/285000.aspx#285000

    贴了个我写的例程 供参考