]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/portable/IAR/ATMega323/portmacro.s90
Modify the GCC/AVR port to make use of the xTaskIncrementTick return value.
[freertos] / FreeRTOS / Source / portable / IAR / ATMega323 / portmacro.s90
index 7e892caf715af07c2ffa436b6654bfd7c7768ccf..b67705dac2a8eb5f1baa3a0b6a24aac4f712df3f 100644 (file)
@@ -1,6 +1,6 @@
 ;/*\r
 ;    FreeRTOS V7.4.2 - Copyright (C) 2013 Real Time Engineers Ltd.\r
-;      \r
+;\r
 ;\r
 ;    ***************************************************************************\r
 ;     *                                                                       *\r
@@ -103,7 +103,7 @@ PUBLIC vPortStart
        ORG USART_UDRE_vect                                     ; Vector address\r
                jmp SIG_UART_DATA                               ; ISR\r
 \r
-       \r
+\r
        RSEG CODE\r
 \r
 \r
@@ -222,7 +222,7 @@ portRESTORE_CONTEXT MACRO
        out SREG, r0\r
 \r
        ld      r0, y+                                  ; Finally we have finished with r0, so restore r0.\r
-       \r
+\r
        ENDM\r
 \r
 \r
@@ -244,7 +244,10 @@ vPortYield:
 vPortYieldFromTick:\r
        portSAVE_CONTEXT                        ; Save the context of the current task.\r
        call xTaskIncrementTick         ; Call the timer tick function.\r
+       tst r16\r
+       breq SkipTaskSwitch\r
        call vTaskSwitchContext         ; Call the scheduler.\r
+SkipTaskSwitch:\r
        portRESTORE_CONTEXT                     ; Restore the context of whichever task the ...\r
        ret                                                     ; ... scheduler decided should run.\r
 \r