]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/portable/RVDS/ARM7_LPC21xx/portASM.s
Add additional critical section to the default tickless implementations.
[freertos] / FreeRTOS / Source / portable / RVDS / ARM7_LPC21xx / portASM.s
index 2f0376cdd475104b26cb0f0668e7872ec30f3b05..c63e0707f8d6e8f50149d5a1e26fc0d5b3dfc3eb 100644 (file)
@@ -1,5 +1,5 @@
 ;/*\r
-;    FreeRTOS V7.2.0 - Copyright (C) 2012 Real Time Engineers Ltd.\r
+;    FreeRTOS V7.5.2 - Copyright (C) 2013 Real Time Engineers Ltd.\r
 ;      \r
 ;\r
 ;    ***************************************************************************\r
@@ -54,7 +54,7 @@
        INCLUDE portmacro.inc\r
 \r
        IMPORT  vTaskSwitchContext\r
-       IMPORT  vTaskIncrementTick\r
+       IMPORT  xTaskIncrementTick\r
 \r
        EXPORT  vPortYieldProcessor\r
        EXPORT  vPortStartFirstTask\r
@@ -127,14 +127,16 @@ vPreemptiveTick
 \r
        portSAVE_CONTEXT                                        ; Save the context of the current task. \r
 \r
-       LDR R0, =vTaskIncrementTick                     ; Increment the tick count.  \r
+       LDR R0, =xTaskIncrementTick                     ; Increment the tick count.  \r
        MOV LR, PC                                                      ; This may make a delayed task ready\r
        BX R0                                                           ; to run.\r
-       \r
+\r
+       CMP R0, #0\r
+       BEQ SkipContextSwitch\r
        LDR R0, =vTaskSwitchContext                     ; Find the highest priority task that \r
        MOV LR, PC                                                      ; is ready to run.\r
        BX R0\r
-       \r
+SkipContextSwitch\r
        MOV R0, #T0MATCHBIT                                     ; Clear the timer event\r
        LDR R1, =T0IR\r
        STR R0, [R1] \r