/*\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
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
__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
\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
\r
void vPortExitCritical( void )\r
{\r
+ configASSERT( uxCriticalNesting );\r
uxCriticalNesting--;\r
if( uxCriticalNesting == 0 )\r
{\r