Go to the source code of this file.
Functions | |
void | vStartMathTasks (unsigned portBASE_TYPE uxPriority) |
portBASE_TYPE | xAreMathsTaskStillRunning (void) |
void vStartMathTasks | ( | unsigned portBASE_TYPE | uxPriority | ) |
Definition at line 94 of file flop.c.
References mathSTACK_SIZE, usTaskCheck, and xTaskCreate.
Referenced by main().
00095 { 00096 xTaskCreate( vCompetingMathTask1, ( signed char * ) "Math1", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 0 ] ), uxPriority, NULL ); 00097 xTaskCreate( vCompetingMathTask2, ( signed char * ) "Math2", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 1 ] ), uxPriority, NULL ); 00098 xTaskCreate( vCompetingMathTask3, ( signed char * ) "Math3", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 2 ] ), uxPriority, NULL ); 00099 xTaskCreate( vCompetingMathTask4, ( signed char * ) "Math4", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 3 ] ), uxPriority, NULL ); 00100 xTaskCreate( vCompetingMathTask1, ( signed char * ) "Math5", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 4 ] ), uxPriority, NULL ); 00101 xTaskCreate( vCompetingMathTask2, ( signed char * ) "Math6", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 5 ] ), uxPriority, NULL ); 00102 xTaskCreate( vCompetingMathTask3, ( signed char * ) "Math7", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 6 ] ), uxPriority, NULL ); 00103 xTaskCreate( vCompetingMathTask4, ( signed char * ) "Math8", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 7 ] ), uxPriority, NULL ); 00104 }
portBASE_TYPE xAreMathsTaskStillRunning | ( | void | ) |
Definition at line 327 of file flop.c.
References mathNUMBER_OF_TASKS, pdFALSE, pdTRUE, portBASE_TYPE, and usTaskCheck.
Referenced by prvCheckOtherTasksAreStillRunning().
00328 { 00329 /* Keep a history of the check variables so we know if they have been incremented 00330 since the last call. */ 00331 static unsigned short usLastTaskCheck[ mathNUMBER_OF_TASKS ] = { ( unsigned short ) 0 }; 00332 portBASE_TYPE xReturn = pdTRUE, xTask; 00333 00334 /* Check the maths tasks are still running by ensuring their check variables 00335 are still incrementing. */ 00336 for( xTask = 0; xTask < mathNUMBER_OF_TASKS; xTask++ ) 00337 { 00338 if( usTaskCheck[ xTask ] == usLastTaskCheck[ xTask ] ) 00339 { 00340 /* The check has not incremented so an error exists. */ 00341 xReturn = pdFALSE; 00342 } 00343 00344 usLastTaskCheck[ xTask ] = usTaskCheck[ xTask ]; 00345 } 00346 00347 return xReturn; 00348 }