Hi,
In xQueueSend (or xQueueGenericSend) function, __disable_interrupt is called, but after that, queueYIELD_IF_USING_PREEMPTION() is called while interrupt is disabling
with below comment
BaseType_t xQueueGenericSend(・・・)
{
for( ; ; )
{
taskENTER_CRITICAL();
{
・・・
#else /* configUSE_QUEUE_SETS */
{
・・・
{
/* The unblocked task has a priority higher than
* our own so yield immediately. Yes it is ok to do
* this from within the critical section - the kernel
* takes care of that. */
queueYIELD_IF_USING_PREEMPTION();
}
}
}
}
queueYIELD_IF_USING_PREEMPTION()
↓
portYIELD_WITHIN_API()
↓
portYIELD
↓
vPortYield
↓
/* Set a PendSV to request a context switch. */
portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET;
↓
Could you tell me how the kernel takes care of PendSV interrupt within the critical section?