/* These variables are used to check that all the tasks are still running. If a \r
task gets a calculation wrong it will\r
stop incrementing 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 float f1, f2, f3, f4;\r
-volatile unsigned short *pusTaskCheckVariable;\r
+volatile uint16_t *pusTaskCheckVariable;\r
volatile float fAnswer;\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 float f1, f2, f3, f4;\r
-volatile unsigned short *pusTaskCheckVariable;\r
+volatile uint16_t *pusTaskCheckVariable;\r
volatile float fAnswer;\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 float *pfArray, fTotal1, fTotal2, fDifference, fPosition;\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
pfArray = ( float * ) pvPortMalloc( xArraySize * sizeof( float ) );\r
\r
static portTASK_FUNCTION( vCompetingMathTask4, pvParameters )\r
{\r
volatile float *pfArray, fTotal1, fTotal2, fDifference, fPosition;\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
pfArray = ( float * ) pvPortMalloc( xArraySize * sizeof( float ) );\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
/* Keep a history of the check variables so we know if they have been incremented \r
since the last call. */\r
-static unsigned short usLastTaskCheck[ mathNUMBER_OF_TASKS ] = { ( unsigned short ) 0 };\r
-portBASE_TYPE xReturn = pdTRUE, xTask;\r
+static uint16_t usLastTaskCheck[ mathNUMBER_OF_TASKS ] = { ( uint16_t ) 0 };\r
+BaseType_t xReturn = pdTRUE, xTask;\r
\r
/* Check the maths tasks are still running by ensuring their check variables \r
are still incrementing. */\r