/**
* task. h
*
* Macro for forcing a context switch.
*
* page taskYIELD taskYIELD
* ingroup SchedulerControl
*/
#define taskYIELD() portYIELD()
#define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired )
{
portYIELD();
}
Also I am having trouble with these function when using within an CAN interrupt handler. My ISR sends messages to a queue and an RX task shall receive them. But after a while the task wating on the queue will not wake up although there are elements in the queue. All works fine without usage of portEND_SWITCHING_ISR. Does somebody have an explanation for this?
void __attribute__((vector(46), interrupt(ipl4), nomips16)) CAN1InterruptHandler(void)
{
char temp=0; //This shall be the CAN data to be received
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
xQueueSendFromISR(xQueueIDCanRx, &temp, &xHigherPriorityTaskWoken);
/* If sending or receiving necessitates a context switch, then switch now.*/
if( xHigherPriorityTaskWoken )
{
portEND_SWITCHING_ISR(xHigherPriorityTaskWoken);
}
}
Best regards,Nils