summaryrefslogtreecommitdiff
path: root/FreeRTOS/Source/portable/GCC/ARM_CM0/port.c
diff options
context:
space:
mode:
Diffstat (limited to 'FreeRTOS/Source/portable/GCC/ARM_CM0/port.c')
-rw-r--r--FreeRTOS/Source/portable/GCC/ARM_CM0/port.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/FreeRTOS/Source/portable/GCC/ARM_CM0/port.c b/FreeRTOS/Source/portable/GCC/ARM_CM0/port.c
index 6b8a8a84f..d0540db2f 100644
--- a/FreeRTOS/Source/portable/GCC/ARM_CM0/port.c
+++ b/FreeRTOS/Source/portable/GCC/ARM_CM0/port.c
@@ -293,14 +293,14 @@ void xPortSysTickHandler( void )
{
unsigned long ulDummy;
- /* If using preemption, also force a context switch. */
- #if configUSE_PREEMPTION == 1
- *(portNVIC_INT_CTRL) = portNVIC_PENDSVSET;
- #endif
-
ulDummy = portSET_INTERRUPT_MASK_FROM_ISR();
{
- vTaskIncrementTick();
+ /* Increment the RTOS tick. */
+ if( xTaskIncrementTick() != pdFALSE )
+ {
+ /* Pend a context switch. */
+ *(portNVIC_INT_CTRL) = portNVIC_PENDSVSET;
+ }
}
portCLEAR_INTERRUPT_MASK_FROM_ISR( ulDummy );
}