licensing and training services.\r
*/\r
\r
-/* Standard includes. */\r
-#include <stdlib.h>\r
-\r
/* Scheduler includes. */\r
#include "FreeRTOS.h"\r
#include "task.h"\r
\r
/* The critical nesting value is initialised to a non zero value to ensure\r
interrupts don't accidentally become enabled before the scheduler is started. */\r
-#define portINITIAL_CRITICAL_NESTING (( unsigned short ) 10)\r
+#define portINITIAL_CRITICAL_NESTING ( ( unsigned short ) 10 )\r
\r
/* Initial PSW value allocated to a newly created task.\r
* 1100011000000000\r
* |--------------------- Zero Flag set\r
* ---------------------- Global Interrupt Flag set (enabled)\r
*/\r
-#define portPSW (0xc6UL)\r
+#define portPSW ( 0xc6U )\r
\r
-/* We require the address of the pxCurrentTCB variable, but don't want to know\r
-any details of its type. */\r
+/* The address of the pxCurrentTCB variable, but don't know or need to know its\r
+type. */\r
typedef void tskTCB;\r
extern volatile tskTCB * volatile pxCurrentTCB;\r
\r
-/* Most ports implement critical sections by placing the interrupt flags on\r
-the stack before disabling interrupts. Exiting the critical section is then\r
-simply a case of popping the flags from the stack. As 78K0 IAR does not use\r
-a frame pointer this cannot be done as modifying the stack will clobber all\r
-the stack variables. Instead each task maintains a count of the critical\r
-section nesting depth. Each time a critical section is entered the count is\r
-incremented. Each time a critical section is left the count is decremented -\r
-with interrupts only being re-enabled if the count is zero.\r
+/* Each task maintains a count of the critical section nesting depth. Each time\r
+a critical section is entered the count is incremented. Each time a critical\r
+section is exited the count is decremented - with interrupts only being\r
+re-enabled if the count is zero.\r
\r
usCriticalNesting will get set to zero when the scheduler starts, but must\r
-not be initialised to zero as this will cause problems during the startup\r
+not be initialised to zero as that could cause problems during the startup\r
sequence. */\r
volatile unsigned short usCriticalNesting = portINITIAL_CRITICAL_NESTING;\r
+\r
/*-----------------------------------------------------------*/\r
\r
/*\r
* Sets up the periodic ISR used for the RTOS tick.\r
*/\r
static void prvSetupTimerInterrupt( void );\r
+\r
/*-----------------------------------------------------------*/\r
\r
/*\r
first starts. */\r
*pxTopOfStack = ( portSTACK_TYPE ) portNO_CRITICAL_SECTION_NESTING; \r
\r
- /* Return a pointer to the top of the stack we have generated so this can\r
- be stored in the task control block for the task. */\r
+ /* Return a pointer to the top of the stack that has beene generated so it\r
+ can be stored in the task control block for the task. */\r
return pxTopOfStack;\r
}\r
/*-----------------------------------------------------------*/\r
/* Restore the context of the first task that is going to run. */\r
vPortStart();\r
\r
- /* Should not get here as the tasks are now running! */\r
+ /* Execution should not reach here as the tasks are now running! */\r
return pdTRUE;\r
}\r
/*-----------------------------------------------------------*/\r