Hi
I would like to know if FreeRTOS uses the pendsv interrupt?
And if so for what purpose?
thanks
Hi
I would like to know if FreeRTOS uses the pendsv interrupt?
And if so for what purpose?
thanks
Maybe this piece of code ( taken from the ARM_CM4F port ) makes it clear:
void xPortSysTickHandler( void )
{
/* The SysTick runs at the lowest interrupt priority, so when this interrupt
* executes all interrupts must be unmasked. There is therefore no need to
* save and then restore the interrupt mask value as its value is already
* known. */
portDISABLE_INTERRUPTS();
{
/* Increment the RTOS tick. */
if( xTaskIncrementTick() != pdFALSE )
{
/* A context switch is required. Context switching is performed in
* the PendSV interrupt. Pend the PendSV interrupt. */
portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT;
}
}
portENABLE_INTERRUPTS();
}
/*-----------------------------------------------------------*/
The actual code for the PENDSV interrupt can be found in xPortPendSVHandler()
.
In the above systick function, the PENDSV will be triggered, but a yield will do the same.