]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/portable/GCC/ARM_CM3/port.c
Ensure the definition of prvTaskExitError()does not result in a compiler warning...
[freertos] / FreeRTOS / Source / portable / GCC / ARM_CM3 / port.c
index ed15b927c156d599a9ec18beb637ce728d9811a5..3967a6a88c21f38d1443e8a0d4c36d1e58c96c73 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-    FreeRTOS V7.5.3 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+    FreeRTOS V7.5.3 - Copyright (C) 2013 Real Time Engineers Ltd.\r
     All rights reserved\r
 \r
     VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
@@ -218,13 +218,13 @@ portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE
 static void prvTaskExitError( void )\r
 {\r
        /* A function that implements a task must not exit or attempt to return to\r
-       its caller as there is nothing to return to.  If a task wants to exit it \r
+       its caller as there is nothing to return to.  If a task wants to exit it\r
        should instead call vTaskDelete( NULL ).\r
-       \r
-       Artificially force an assert() to be triggered if configASSERT() is \r
+\r
+       Artificially force an assert() to be triggered if configASSERT() is\r
        defined, then stop here so application writers can catch the error. */\r
        configASSERT( uxCriticalNesting == ~0UL );\r
-       portDISABLE_INTERRUPTS();       \r
+       portDISABLE_INTERRUPTS();\r
        for( ;; );\r
 }\r
 /*-----------------------------------------------------------*/\r
@@ -329,6 +329,12 @@ portBASE_TYPE xPortStartScheduler( void )
        /* Start the first task. */\r
        prvPortStartFirstTask();\r
 \r
+       /* Should never get here as the tasks will now be executing!  Call the task\r
+       exit error function to prevent compiler warnings about a static function\r
+       not being called in the case that the application writer overrides this\r
+       functionality by defining configTASK_RETURN_ADDRESS. */\r
+       prvTaskExitError();\r
+\r
        /* Should not get here! */\r
        return 0;\r
 }\r
@@ -497,10 +503,10 @@ void xPortSysTickHandler( void )
                        /* Restart from whatever is left in the count register to complete\r
                        this tick period. */\r
                        portNVIC_SYSTICK_LOAD_REG = portNVIC_SYSTICK_CURRENT_VALUE_REG;\r
-                       \r
+\r
                        /* Restart SysTick. */\r
                        portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT;\r
-                       \r
+\r
                        /* Reset the reload register to the value required for normal tick\r
                        periods. */\r
                        portNVIC_SYSTICK_LOAD_REG = ulTimerCountsForOneTick - 1UL;\r
@@ -549,23 +555,23 @@ void xPortSysTickHandler( void )
                        if( ( portNVIC_SYSTICK_CTRL_REG & portNVIC_SYSTICK_COUNT_FLAG_BIT ) != 0 )\r
                        {\r
                                unsigned long ulCalculatedLoadValue;\r
-                               \r
+\r
                                /* The tick interrupt has already executed, and the SysTick\r
                                count reloaded with ulReloadValue.  Reset the\r
                                portNVIC_SYSTICK_LOAD_REG with whatever remains of this tick\r
                                period. */\r
                                ulCalculatedLoadValue = ( ulTimerCountsForOneTick - 1UL ) - ( ulReloadValue - portNVIC_SYSTICK_CURRENT_VALUE_REG );\r
 \r
-                               /* Don't allow a tiny value, or values that have somehow \r
-                               underflowed because the post sleep hook did something \r
+                               /* Don't allow a tiny value, or values that have somehow\r
+                               underflowed because the post sleep hook did something\r
                                that took too long. */\r
                                if( ( ulCalculatedLoadValue < ulStoppedTimerCompensation ) || ( ulCalculatedLoadValue > ulTimerCountsForOneTick ) )\r
                                {\r
                                        ulCalculatedLoadValue = ( ulTimerCountsForOneTick - 1UL );\r
                                }\r
-                               \r
+\r
                                portNVIC_SYSTICK_LOAD_REG = ulCalculatedLoadValue;\r
-                               \r
+\r
                                /* The tick interrupt handler will already have pended the tick\r
                                processing in the kernel.  As the pending tick will be\r
                                processed as soon as this function exits, the tick value\r