\r
/* These variables are used to check that all the tasks are still running. If a\r
task gets a calculation wrong it will stop setting its check variable. */\r
-static volatile unsigned short usTaskCheck[ mathNUMBER_OF_TASKS ] = { ( unsigned short ) 0 };\r
+static volatile uint16_t usTaskCheck[ mathNUMBER_OF_TASKS ] = { ( uint16_t ) 0 };\r
\r
/*-----------------------------------------------------------*/\r
\r
-void vStartMathTasks( unsigned portBASE_TYPE uxPriority )\r
+void vStartMathTasks( UBaseType_t uxPriority )\r
{\r
xTaskCreate( vCompetingMathTask1, "Math1", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 0 ] ), uxPriority, NULL );\r
xTaskCreate( vCompetingMathTask2, "Math2", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 1 ] ), uxPriority, NULL );\r
static portTASK_FUNCTION( vCompetingMathTask1, pvParameters )\r
{\r
volatile portDOUBLE d1, d2, d3, d4;\r
-volatile unsigned short *pusTaskCheckVariable;\r
+volatile uint16_t *pusTaskCheckVariable;\r
volatile portDOUBLE dAnswer;\r
short sError = pdFALSE;\r
\r
\r
/* The variable this task increments to show it is still running is passed in\r
as the parameter. */\r
- pusTaskCheckVariable = ( unsigned short * ) pvParameters;\r
+ pusTaskCheckVariable = ( uint16_t * ) pvParameters;\r
\r
/* Keep performing a calculation and checking the result against a constant. */\r
for(;;)\r
static portTASK_FUNCTION( vCompetingMathTask2, pvParameters )\r
{\r
volatile portDOUBLE d1, d2, d3, d4;\r
-volatile unsigned short *pusTaskCheckVariable;\r
+volatile uint16_t *pusTaskCheckVariable;\r
volatile portDOUBLE dAnswer;\r
short sError = pdFALSE;\r
\r
\r
/* The variable this task increments to show it is still running is passed in\r
as the parameter. */\r
- pusTaskCheckVariable = ( unsigned short * ) pvParameters;\r
+ pusTaskCheckVariable = ( uint16_t * ) pvParameters;\r
\r
/* Keep performing a calculation and checking the result against a constant. */\r
for( ;; )\r
static portTASK_FUNCTION( vCompetingMathTask3, pvParameters )\r
{\r
volatile portDOUBLE *pdArray, dTotal1, dTotal2, dDifference;\r
-volatile unsigned short *pusTaskCheckVariable;\r
+volatile uint16_t *pusTaskCheckVariable;\r
const size_t xArraySize = 10;\r
size_t xPosition;\r
short sError = pdFALSE;\r
\r
/* The variable this task increments to show it is still running is passed in\r
as the parameter. */\r
- pusTaskCheckVariable = ( unsigned short * ) pvParameters;\r
+ pusTaskCheckVariable = ( uint16_t * ) pvParameters;\r
\r
pdArray = ( portDOUBLE * ) pvPortMalloc( xArraySize * sizeof( portDOUBLE ) );\r
\r
static portTASK_FUNCTION( vCompetingMathTask4, pvParameters )\r
{\r
volatile portDOUBLE *pdArray, dTotal1, dTotal2, dDifference;\r
-volatile unsigned short *pusTaskCheckVariable;\r
+volatile uint16_t *pusTaskCheckVariable;\r
const size_t xArraySize = 10;\r
size_t xPosition;\r
short sError = pdFALSE;\r
\r
/* The variable this task increments to show it is still running is passed in\r
as the parameter. */\r
- pusTaskCheckVariable = ( unsigned short * ) pvParameters;\r
+ pusTaskCheckVariable = ( uint16_t * ) pvParameters;\r
\r
pdArray = ( portDOUBLE * ) pvPortMalloc( xArraySize * sizeof( portDOUBLE ) );\r
\r
/*-----------------------------------------------------------*/\r
\r
/* This is called to check that all the created tasks are still running. */\r
-portBASE_TYPE xAreMathsTaskStillRunning( void )\r
+BaseType_t xAreMathsTaskStillRunning( void )\r
{\r
-portBASE_TYPE xReturn = pdPASS, xTask;\r
+BaseType_t xReturn = pdPASS, xTask;\r
\r
/* Check the maths tasks are still running by ensuring their check variables\r
have been set to pdPASS. */\r