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.

RTOS/CC2650: Recall task after interrupt

Part Number: CC2650

Tool/software: TI-RTOS

Hi there, I have a code that does this:

Fxn A (){

while(1){

task A;     

}

Callback fxn (){

interrupt A;

}

However, when interrupt A is triggered, my while(1) stops. 

Even though I try to put this code in the interrupt, hoping to recall the task, it still doesn't work.

Task_Params_init(&taskParams);

            taskParams.arg0 = 1000000 / Clock_tickPeriod;

            taskParams.stackSize = TASKSTACKSIZE;

            taskParams.stack = &task0Stack;

            Task_construct(&task0Struct, (Task_FuncPtr)ADXL362Fxn, &taskParams, NULL);

Anyone knows how to go back to the task A after an interrupt is triggered? 

  • Hi,

    You can't construct a Task from an interrupt, therefore you should not have that code in your interrupt.

    When your interrupt fires, once the interrupt is finished, the scheduler will run the Task with the highest priority ready to run. Therefore if you want your Task A to resume once the interrupt is finished you should make sure it has a higher priority than any other Task that could run at that time.

    Thanks,
    Gerardo