Hi,
looking at this API sample code:
void vANInterruptHandler( void )
{
BaseType_t xHigherPriorityTaskWoken;
uint32_t ulStatusRegister;
ulStatusRegister = ulReadPeripheralInterruptStatus();
vClearPeripheralInterruptStatus( ulStatusRegister );
xHigherPriorityTaskWoken = pdFALSE;
xTaskNotifyIndexedFromISR( xHandlingTask,
0,
ulStatusRegister,
eSetBits,
&xHigherPriorityTaskWoken );
/* Force a context switch if xHigherPriorityTaskWoken is now set to pdTRUE.
The macro used to do this is dependent on the port and may be called
portEND_SWITCHING_ISR. */
portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
}
If xHandlingTask is at priority 2 and there are other tasks at priority 1 and 3, which one will be immediately executed? xHandlingTask at priority 2 because the ISR just sent the notification to it or 3 if it was its turn?
What if the ISR was called in the middle of a task at priority 3, after the ISR, will the control go back to that priority 3 task until it is completed or to xHandlingTask (priority 2) because the ISR sent a notify and yielded from an ISR?
Thank you