]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/portable/RVDS/ARM_CM0/port.c
Multiple tidy up, documentation corrections and typo corrections highlighted by Tamas...
[freertos] / FreeRTOS / Source / portable / RVDS / ARM_CM0 / port.c
index 560dcf725071442a24d1791d8c6e99e3c01800af..e7bb261b41e80250417c5b45385fe965cce75577 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-    FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+    FreeRTOS V7.6.0 - 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
@@ -142,20 +142,20 @@ 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
 \r
 void vPortSVCHandler( void )\r
 {\r
-       /* This function is no longer used, but retained for backward \r
+       /* This function is no longer used, but retained for backward\r
        compatibility. */\r
 }\r
 /*-----------------------------------------------------------*/\r
@@ -163,15 +163,15 @@ void vPortSVCHandler( void )
 __asm void prvPortStartFirstTask( void )\r
 {\r
        extern pxCurrentTCB;\r
-       \r
+\r
        PRESERVE8\r
-       \r
+\r
        /* The MSP stack is not reset as, unlike on M3/4 parts, there is no vector\r
        table offset register that can be used to locate the initial stack value.\r
        Not all M0 parts have the application vector table at address 0. */\r
-       \r
+\r
        ldr     r3, =pxCurrentTCB       /* Obtain location of pxCurrentTCB. */\r
-       ldr r1, [r3]                    \r
+       ldr r1, [r3]\r
        ldr r0, [r1]                    /* The first item in pxCurrentTCB is the task top of stack. */\r
        adds r0, #32                    /* Discard everything up to r0. */\r
        msr psp, r0                             /* This is now the new top of stack to use in the task. */\r
@@ -212,8 +212,9 @@ portBASE_TYPE xPortStartScheduler( void )
 \r
 void vPortEndScheduler( void )\r
 {\r
-  /* It is unlikely that the CM0 port will require this function as there\r
-    is nothing to return to.  */\r
+       /* Not implemented in ports where there is nothing to return to.\r
+       Artificially force an assert. */\r
+       configASSERT( uxCriticalNesting == 1000UL );\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
@@ -240,6 +241,7 @@ void vPortEnterCritical( void )
 \r
 void vPortExitCritical( void )\r
 {\r
+       configASSERT( uxCriticalNesting );\r
     uxCriticalNesting--;\r
     if( uxCriticalNesting == 0 )\r
     {\r