;/*\r
-; FreeRTOS V7.1.1 - Copyright (C) 2012 Real Time Engineers Ltd.\r
+; FreeRTOS V9.0.0rc2 - Copyright (C) 2016 Real Time Engineers Ltd.\r
+; All rights reserved\r
;\r
;\r
; ***************************************************************************\r
CODE32\r
\r
EXTERN vTaskSwitchContext\r
- EXTERN vTaskIncrementTick\r
+ EXTERN xTaskIncrementTick\r
\r
PUBLIC vPortYieldProcessor\r
PUBLIC vPortPreemptiveTick\r
; Manual context switch function. This is the SWI hander.\r
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\r
vPortYieldProcessor:\r
- ADD LR, LR, #4 ; Add 4 to the LR to make the LR appear exactly \r
- ; as if the context was saved during and IRQ \r
+ ADD LR, LR, #4 ; Add 4 to the LR to make the LR appear exactly\r
+ ; as if the context was saved during and IRQ\r
; handler.\r
- \r
+\r
portSAVE_CONTEXT ; Save the context of the current task...\r
LDR R0, =vTaskSwitchContext ; before selecting the next task to execute.\r
mov lr, pc\r
vPortPreemptiveTick:\r
portSAVE_CONTEXT ; Save the context of the current task.\r
\r
- LDR R0, =vTaskIncrementTick ; Increment the tick count - this may wake a task.\r
+ LDR R0, =xTaskIncrementTick ; Increment the tick count - this may wake a task.\r
mov lr, pc\r
BX R0\r
+\r
+ CMP R0, #0\r
+ BEQ SkipContextSwitch\r
LDR R0, =vTaskSwitchContext ; Select the next task to execute.\r
mov lr, pc\r
BX R0\r
-\r
+SkipContextSwitch\r
LDR R14, =AT91C_BASE_PITC ; Clear the PIT interrupt\r
LDR R0, [R14, #PITC_PIVR ]\r
\r