本文整理汇总了C++中xIsCreateTaskStillRunning函数的典型用法代码示例。如果您正苦于以下问题:C++ xIsCreateTaskStillRunning函数的具体用法?C++ xIsCreateTaskStillRunning怎么用?C++ xIsCreateTaskStillRunning使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了xIsCreateTaskStillRunning函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: vApplicationTickHook
void vApplicationTickHook( void )
{
static xOLEDMessage xMessage = { "PASS" };
static unsigned portLONG ulTicksSinceLastDisplay = 0;
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
/* Called from every tick interrupt. Have enough ticks passed to make it
time to perform our health status check again? */
ulTicksSinceLastDisplay++;
if( ulTicksSinceLastDisplay >= mainCHECK_DELAY )
{
ulTicksSinceLastDisplay = 0;
/* Has an error been found in any task? */
if( xAreGenericQueueTasksStillRunning() != pdTRUE )
{
xMessage.pcMessage = "ERROR IN GEN Q";
}
else if( xIsCreateTaskStillRunning() != pdTRUE )
{
xMessage.pcMessage = "ERROR IN CREATE";
}
else if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
{
xMessage.pcMessage = "ERROR IN MATH";
}
else if( xAreIntQueueTasksStillRunning() != pdTRUE )
{
xMessage.pcMessage = "ERROR IN INT QUEUE";
}
else if( xAreBlockingQueuesStillRunning() != pdTRUE )
{
xMessage.pcMessage = "ERROR IN BLOCK Q";
}
else if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
{
xMessage.pcMessage = "ERROR IN BLOCK TIME";
}
else if( xAreSemaphoreTasksStillRunning() != pdTRUE )
{
xMessage.pcMessage = "ERROR IN SEMAPHORE";
}
else if( xArePollingQueuesStillRunning() != pdTRUE )
{
xMessage.pcMessage = "ERROR IN POLL Q";
}
else if( xAreQueuePeekTasksStillRunning() != pdTRUE )
{
xMessage.pcMessage = "ERROR IN PEEK Q";
}
else if( xAreRecursiveMutexTasksStillRunning() != pdTRUE )
{
xMessage.pcMessage = "ERROR IN REC MUTEX";
}
/* Send the message to the OLED gatekeeper for display. */
xHigherPriorityTaskWoken = pdFALSE;
xQueueSendFromISR( xOLEDQueue, &xMessage, &xHigherPriorityTaskWoken );
}
}
示例2: prvCheckOtherTasksAreStillRunning
static void prvCheckOtherTasksAreStillRunning( void )
{
short sErrorHasOccurred = pdFALSE;
if( xAreComTestTasksStillRunning() != pdTRUE )
{
vDisplayMessage( "Com test count unchanged!\r\n" );
sErrorHasOccurred = pdTRUE;
}
if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
{
vDisplayMessage( "Integer maths task count unchanged!\r\n" );
sErrorHasOccurred = pdTRUE;
}
if( xAreBlockingQueuesStillRunning() != pdTRUE )
{
vDisplayMessage( "Blocking queues count unchanged!\r\n" );
sErrorHasOccurred = pdTRUE;
}
if( xArePollingQueuesStillRunning() != pdTRUE )
{
vDisplayMessage( "Polling queue count unchanged!\r\n" );
sErrorHasOccurred = pdTRUE;
}
if( xIsCreateTaskStillRunning() != pdTRUE )
{
vDisplayMessage( "Incorrect number of tasks running!\r\n" );
sErrorHasOccurred = pdTRUE;
}
if( xAreSemaphoreTasksStillRunning() != pdTRUE )
{
vDisplayMessage( "Semaphore take count unchanged!\r\n" );
sErrorHasOccurred = pdTRUE;
}
if( sErrorHasOccurred == pdFALSE )
{
vDisplayMessage( "OK " );
/* Toggle the LED if everything is okay so we know if an error occurs even if not
using console IO. */
prvToggleLED();
}
else
{
for( ;; )
{
/* An error has occurred in one of the tasks. Don't go any further and
flash the LED rapidly in case console IO is not being used. */
prvToggleLED();
vTaskDelay( mainERROR_FLASH_RATE );
}
}
}
示例3: prvCheckOtherTasksAreStillRunning
/*!
* \brief Checks that all the demo application tasks are still executing without error.
*/
static portBASE_TYPE prvCheckOtherTasksAreStillRunning( void )
{
static portBASE_TYPE xErrorHasOccurred = pdFALSE;
if( xAreComTestTasksStillRunning() != pdTRUE )
{
xErrorHasOccurred = pdTRUE;
}
if( xArePollingQueuesStillRunning() != pdTRUE )
{
xErrorHasOccurred = pdTRUE;
}
#if (BOARD != UC3L_EK)
if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
{
xErrorHasOccurred = pdTRUE;
}
#endif
#if (BOARD != UC3L_EK)
if( xAreSemaphoreTasksStillRunning() != pdTRUE )
{
xErrorHasOccurred = pdTRUE;
}
#endif
#if (BOARD != EVK1101) && (BOARD != UC3L_EK)
if( xAreBlockingQueuesStillRunning() != pdTRUE )
{
xErrorHasOccurred = pdTRUE;
}
#endif
#if (BOARD != UC3L_EK)
if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )
{
xErrorHasOccurred = pdTRUE;
}
#endif
#if (BOARD != EVK1101) && (BOARD != UC3L_EK)
if( xAreMathsTaskStillRunning() != pdTRUE )
{
xErrorHasOccurred = pdTRUE;
}
#endif
if( xIsCreateTaskStillRunning() != pdTRUE )
{
xErrorHasOccurred = pdTRUE;
}
return ( xErrorHasOccurred );
}
示例4: prvCheckOtherTasksAreStillRunning
static char prvCheckOtherTasksAreStillRunning( void )
{
char cErrorHasOccurred = ( char ) pdFALSE;
if( xIsCreateTaskStillRunning() != pdTRUE )
{
cErrorHasOccurred = ( char ) pdTRUE;
}
return cErrorHasOccurred;
}
示例5: vCheckTask
/*-----------------------------------------------------------*/
static void vCheckTask( void *pvParameters )
{
portTickType xLastExecutionTime;
xLCDMessage xMessage;
static signed portCHAR cPassMessage[ mainMAX_MSG_LEN ];
extern unsigned portSHORT usMaxJitter;
xLastExecutionTime = xTaskGetTickCount();
xMessage.pcMessage = cPassMessage;
for( ;; )
{
/* Perform this check every mainCHECK_DELAY milliseconds. */
vTaskDelayUntil( &xLastExecutionTime, mainCHECK_DELAY );
/* Has an error been found in any task? */
if( xAreBlockingQueuesStillRunning() != pdTRUE )
{
xMessage.pcMessage = (signed char *)"ERROR IN BLOCK Q\n";
}
else if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
{
xMessage.pcMessage = (signed char *)"ERROR IN BLOCK TIME\n";
}
else if( xAreSemaphoreTasksStillRunning() != pdTRUE )
{
xMessage.pcMessage = (signed char *)"ERROR IN SEMAPHORE\n";
}
else if( xArePollingQueuesStillRunning() != pdTRUE )
{
xMessage.pcMessage = (signed char *)"ERROR IN POLL Q\n";
}
else if( xIsCreateTaskStillRunning() != pdTRUE )
{
xMessage.pcMessage = (signed char *)"ERROR IN CREATE\n";
}
else if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
{
xMessage.pcMessage = (signed char *)"ERROR IN MATH\n";
}
else if( xAreComTestTasksStillRunning() != pdTRUE )
{
xMessage.pcMessage = (signed char *)"ERROR IN COM TEST\n";
}
else
{
sprintf( ( portCHAR * ) cPassMessage, "PASS [%uns]\n",(unsigned int) (( ( unsigned portLONG ) usMaxJitter ) * mainNS_PER_CLOCK) );
}
/* Send the message to the LCD gatekeeper for display. */
xQueueSend( xLCDQueue, &xMessage, portMAX_DELAY );
}
}
示例6: vApplicationTickHook
void vApplicationTickHook( void )
{
static xOLEDMessage xMessage = { "PASS" };
static unsigned long ulTicksSinceLastDisplay = 0;
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
/* Called from every tick interrupt. Have enough ticks passed to make it
time to perform our health status check again? */
ulTicksSinceLastDisplay++;
if( ulTicksSinceLastDisplay >= mainCHECK_DELAY ) {
ulTicksSinceLastDisplay = 0;
/* Has an error been found in any task? */
if( xAreGenericQueueTasksStillRunning() != pdTRUE ) {
xMessage.pcMessage = "ERROR IN GEN Q";
} else if( xIsCreateTaskStillRunning() != pdTRUE ) {
xMessage.pcMessage = "ERROR IN CREATE";
} else if( xAreIntegerMathsTaskStillRunning() != pdTRUE ) {
xMessage.pcMessage = "ERROR IN MATH";
} else if( xAreIntQueueTasksStillRunning() != pdTRUE ) {
xMessage.pcMessage = "ERROR IN INT QUEUE";
} else if( xAreBlockingQueuesStillRunning() != pdTRUE ) {
xMessage.pcMessage = "ERROR IN BLOCK Q";
} else if( xAreBlockTimeTestTasksStillRunning() != pdTRUE ) {
xMessage.pcMessage = "ERROR IN BLOCK TIME";
} else if( xAreSemaphoreTasksStillRunning() != pdTRUE ) {
xMessage.pcMessage = "ERROR IN SEMAPHORE";
} else if( xArePollingQueuesStillRunning() != pdTRUE ) {
xMessage.pcMessage = "ERROR IN POLL Q";
} else if( xAreQueuePeekTasksStillRunning() != pdTRUE ) {
xMessage.pcMessage = "ERROR IN PEEK Q";
} else if( xAreRecursiveMutexTasksStillRunning() != pdTRUE ) {
xMessage.pcMessage = "ERROR IN REC MUTEX";
} else if( xAreQueueSetTasksStillRunning() != pdPASS ) {
xMessage.pcMessage = "ERROR IN Q SET";
} else if( xAreEventGroupTasksStillRunning() != pdTRUE ) {
xMessage.pcMessage = "ERROR IN EVNT GRP";
}
configASSERT( strcmp( ( const char * ) xMessage.pcMessage, "PASS" ) == 0 );
/* Send the message to the OLED gatekeeper for display. */
xHigherPriorityTaskWoken = pdFALSE;
xQueueSendFromISR( xOLEDQueue, &xMessage, &xHigherPriorityTaskWoken );
}
/* Write to a queue that is in use as part of the queue set demo to
demonstrate using queue sets from an ISR. */
vQueueSetAccessQueueSetFromISR();
/* Call the event group ISR tests. */
vPeriodicEventGroupsProcessing();
}
示例7: prvCheckOtherTasksAreStillRunning
static long prvCheckOtherTasksAreStillRunning( void )
{
long lReturn = ( long ) pdPASS;
/* Check all the demo tasks (other than the flash tasks) to ensure
that they are all still running, and that none of them have detected
an error. */
if( xArePollingQueuesStillRunning() != pdTRUE )
{
lReturn = ( long ) pdFAIL;
}
if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )
{
lReturn = ( long ) pdFAIL;
}
if( xAreSemaphoreTasksStillRunning() != pdTRUE )
{
lReturn = ( long ) pdFAIL;
}
if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
{
lReturn = ( long ) pdFAIL;
}
if( xAreMathsTaskStillRunning() != pdTRUE )
{
lReturn = ( long ) pdFAIL;
}
if( xAreBlockingQueuesStillRunning() != pdTRUE )
{
lReturn = ( long ) pdFAIL;
}
if( xIsCreateTaskStillRunning() != pdTRUE )
{
lReturn = ( long ) pdFAIL;
}
return lReturn;
}
示例8: prvCheckOtherTasksAreStillRunning
static long prvCheckOtherTasksAreStillRunning( void )
{
portBASE_TYPE xAllTasksPassed = pdPASS;
if( xArePollingQueuesStillRunning() != pdTRUE )
{
xAllTasksPassed = pdFAIL;
}
if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )
{
xAllTasksPassed = pdFAIL;
}
if( xAreComTestTasksStillRunning() != pdTRUE )
{
xAllTasksPassed = pdFALSE;
}
if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
{
xAllTasksPassed = pdFALSE;
}
if( xAreBlockingQueuesStillRunning() != pdTRUE )
{
xAllTasksPassed = pdFALSE;
}
if( xIsCreateTaskStillRunning() != pdTRUE )
{
xAllTasksPassed = pdFALSE;
}
/* Also check the status flag for the tasks defined within this function. */
if( xLocalError != pdFALSE )
{
xAllTasksPassed = pdFAIL;
}
return xAllTasksPassed;
}
示例9: prvCheckTask
static void prvCheckTask( void *pvParameter )
{
TickType_t xNextWakeTime, xCycleFrequency = mainNO_ERROR_CYCLE_TIME;
unsigned long ulLastRegTest1CycleCount = 0UL, ulLastRegTest2CycleCount = 0UL;
/* Just to remove compiler warning. */
( void ) pvParameter;
/* Initialise xNextWakeTime - this only needs to be done once. */
xNextWakeTime = xTaskGetTickCount();
for( ;; )
{
/* Place this task in the blocked state until it is time to run again. */
vTaskDelayUntil( &xNextWakeTime, xCycleFrequency );
/* Inspect all the other tasks to ensure none have experienced any errors. */
if( xAreGenericQueueTasksStillRunning() != pdTRUE )
{
/* Increase the rate at which this task cycles, which will increase the
rate at which mainCHECK_LED flashes to give visual feedback that an error
has occurred. */
xCycleFrequency = mainERROR_CYCLE_TIME;
pcStatusMessage = "Error in GenQ test.";
}
else if( xAreQueuePeekTasksStillRunning() != pdTRUE )
{
xCycleFrequency = mainERROR_CYCLE_TIME;
pcStatusMessage = "Error in Queue Peek test.";
}
else if( xAreBlockingQueuesStillRunning() != pdTRUE )
{
xCycleFrequency = mainERROR_CYCLE_TIME;
pcStatusMessage = "Error in Blocking Queue test.";
}
else if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
{
xCycleFrequency = mainERROR_CYCLE_TIME;
pcStatusMessage = "Error in BlockTim test.";
}
else if( xAreSemaphoreTasksStillRunning() != pdTRUE )
{
xCycleFrequency = mainERROR_CYCLE_TIME;
pcStatusMessage = "Error in Semaphore test.";
}
else if( xArePollingQueuesStillRunning() != pdTRUE )
{
xCycleFrequency = mainERROR_CYCLE_TIME;
pcStatusMessage = "Error in Polling Queue test.";
}
else if( xIsCreateTaskStillRunning() != pdTRUE )
{
xCycleFrequency = mainERROR_CYCLE_TIME;
pcStatusMessage = "Error in Create test.";
}
else if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
{
xCycleFrequency = mainERROR_CYCLE_TIME;
pcStatusMessage = "Error in integer Math test.";
}
else if( xAreRecursiveMutexTasksStillRunning() != pdTRUE )
{
xCycleFrequency = mainERROR_CYCLE_TIME;
pcStatusMessage = "Error in recursive mutex test.";
}
else if( xAreMathsTaskStillRunning() != pdTRUE )
{
xCycleFrequency = mainERROR_CYCLE_TIME;
pcStatusMessage = "Error in floating point Math test.";
}
/* Check the reg test tasks are still cycling. They will stop incrementing
their loop counters if they encounter an error. */
if( ulRegTest1CycleCount == ulLastRegTest1CycleCount )
{
xCycleFrequency = mainERROR_CYCLE_TIME;
pcStatusMessage = "Error in RegTest.";
}
if( ulRegTest2CycleCount == ulLastRegTest2CycleCount )
{
xCycleFrequency = mainERROR_CYCLE_TIME;
pcStatusMessage = "Error in RegTest.";
}
ulLastRegTest1CycleCount = ulRegTest1CycleCount;
ulLastRegTest2CycleCount = ulRegTest2CycleCount;
/* Toggle the check LED to give an indication of the system status. If the
LED toggles every 5 seconds then everything is ok. A faster toggle indicates
an error. */
vParTestToggleLED( mainCHECK_LED );
}
}
示例10: prvCheckTask
static void prvCheckTask( void *pvParameters )
{
static volatile unsigned long ulLastRegTest1CycleCount = 0UL, ulLastRegTest2CycleCount = 0UL;
TickType_t xNextWakeTime, xCycleFrequency = mainNO_ERROR_CYCLE_TIME;
extern void vSetupHighFrequencyTimer( void );
/* If this is being executed then the kernel has been started. Start the high
frequency timer test as described at the top of this file. This is only
included in the optimised build configuration - otherwise it takes up too much
CPU time. */
#ifdef INCLUDE_HIGH_FREQUENCY_TIMER_TEST
vSetupHighFrequencyTimer();
#endif
/* Initialise xNextWakeTime - this only needs to be done once. */
xNextWakeTime = xTaskGetTickCount();
for( ;; )
{
/* Place this task in the blocked state until it is time to run again. */
vTaskDelayUntil( &xNextWakeTime, xCycleFrequency );
/* Check the standard demo tasks are running without error. */
if( xAreGenericQueueTasksStillRunning() != pdTRUE )
{
/* Increase the rate at which this task cycles, which will increase the
rate at which mainCHECK_LED flashes to give visual feedback that an error
has occurred. */
pcStatusMessage = "Error: GenQueue";
xPrintf( pcStatusMessage );
}
if( xAreQueuePeekTasksStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: QueuePeek\r\n";
xPrintf( pcStatusMessage );
}
if( xAreBlockingQueuesStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: BlockQueue\r\n";
xPrintf( pcStatusMessage );
}
if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: BlockTime\r\n";
xPrintf( pcStatusMessage );
}
if( xAreSemaphoreTasksStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: SemTest\r\n";
xPrintf( pcStatusMessage );
}
if( xArePollingQueuesStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: PollQueue\r\n";
xPrintf( pcStatusMessage );
}
if( xIsCreateTaskStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: Death\r\n";
xPrintf( pcStatusMessage );
}
if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: IntMath\r\n";
xPrintf( pcStatusMessage );
}
if( xAreRecursiveMutexTasksStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: RecMutex\r\n";
xPrintf( pcStatusMessage );
}
if( xAreIntQueueTasksStillRunning() != pdPASS )
{
pcStatusMessage = "Error: IntQueue\r\n";
xPrintf( pcStatusMessage );
}
if( xAreMathsTaskStillRunning() != pdPASS )
{
pcStatusMessage = "Error: Flop\r\n";
xPrintf( pcStatusMessage );
}
/* Check the reg test tasks are still cycling. They will stop incrementing
their loop counters if they encounter an error. */
if( ulRegTest1CycleCount == ulLastRegTest1CycleCount )
{
pcStatusMessage = "Error: RegTest1\r\n";
xPrintf( pcStatusMessage );
}
//.........这里部分代码省略.........
示例11: prvCheckOtherTasksAreStillRunning
static long prvCheckOtherTasksAreStillRunning( void )
{
long lReturn = pdPASS;
unsigned long ulHighFrequencyTimerTaskIterations, ulExpectedIncFrequency_ms;
/* Check all the demo tasks (other than the flash tasks) to ensure
that they are all still running, and that none have detected an error. */
if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
{
lReturn = pdFAIL;
}
if( xAreComTestTasksStillRunning() != pdTRUE )
{
lReturn = pdFAIL;
}
if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )
{
lReturn = pdFAIL;
}
if( xAreBlockingQueuesStillRunning() != pdTRUE )
{
lReturn = pdFAIL;
}
if ( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
{
lReturn = pdFAIL;
}
if ( xAreGenericQueueTasksStillRunning() != pdTRUE )
{
lReturn = pdFAIL;
}
if ( xAreRecursiveMutexTasksStillRunning() != pdTRUE )
{
lReturn = pdFAIL;
}
if( prvAreRegTestTasksStillRunning() != pdTRUE )
{
lReturn = pdFAIL;
}
if( xIsCreateTaskStillRunning() != pdTRUE )
{
lReturn = pdFAIL;
}
if( xAreTimerDemoTasksStillRunning( mainNO_ERROR_FLASH_PERIOD_MS ) != pdTRUE )
{
lReturn = pdFAIL;
}
if( xArePollingQueuesStillRunning() != pdTRUE )
{
lReturn = pdFAIL;
}
if( xAreSemaphoreTasksStillRunning() != pdTRUE )
{
lReturn = pdFAIL;
}
/* Obtain the number of times the task associated with the high frequency
(interrupt nesting) timer test has increment since the check task last
executed, and the frequency at which it is expected to execute in ms. */
ulHighFrequencyTimerTaskIterations = ulInterruptNestingTestGetIterationCount( &ulExpectedIncFrequency_ms );
if( ( ulHighFrequencyTimerTaskIterations < ( ( mainNO_ERROR_FLASH_PERIOD_MS / ulExpectedIncFrequency_ms ) - 1 ) )
||
( ulHighFrequencyTimerTaskIterations > ( ( mainNO_ERROR_FLASH_PERIOD_MS / ulExpectedIncFrequency_ms ) +5 ) )
)
{
/* Would have expected the high frequency timer task to have
incremented its execution count more times that reported. */
lReturn = pdFAIL;
}
return lReturn;
}
示例12: prvCheckTimerCallback
static void prvCheckTimerCallback( xTimerHandle xTimer )
{
static long lChangeToRedLEDsAlready = pdFALSE;
static unsigned long ulLastRegTest1Counter = 0, ulLastRegTest2Counter = 0;
unsigned long ulErrorFound = pdFALSE;
/* LEDs are defaulted to use the Green LEDs. The Red LEDs are used if an error
is found. */
static unsigned long ulLED1 = 8, ulLED2 = 11;
const unsigned long ulRedLED1 = 6, ulRedLED2 = 9;
/* Check all the demo tasks (other than the flash tasks) to ensure
they are all still running, and that none have detected an error. */
if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
{
ulErrorFound = pdTRUE;
}
if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )
{
ulErrorFound = pdTRUE;
}
if( xAreBlockingQueuesStillRunning() != pdTRUE )
{
ulErrorFound = pdTRUE;
}
if ( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
{
ulErrorFound = pdTRUE;
}
if ( xAreGenericQueueTasksStillRunning() != pdTRUE )
{
ulErrorFound = pdTRUE;
}
if ( xAreRecursiveMutexTasksStillRunning() != pdTRUE )
{
ulErrorFound = pdTRUE;
}
if( xIsCreateTaskStillRunning() != pdTRUE )
{
ulErrorFound = pdTRUE;
}
if( xArePollingQueuesStillRunning() != pdTRUE )
{
ulErrorFound = pdTRUE;
}
if( xAreSemaphoreTasksStillRunning() != pdTRUE )
{
ulErrorFound = pdTRUE;
}
if( xAreMathsTaskStillRunning() != pdTRUE )
{
ulErrorFound = pdTRUE;
}
if( xAreComTestTasksStillRunning() != pdTRUE )
{
ulErrorFound = pdTRUE;
}
/* Check the reg test tasks are still cycling. They will stop
incrementing their loop counters if they encounter an error. */
if( ulRegTest1Counter == ulLastRegTest1Counter )
{
ulErrorFound = pdTRUE;
}
if( ulRegTest2Counter == ulLastRegTest2Counter )
{
ulErrorFound = pdTRUE;
}
ulLastRegTest1Counter = ulRegTest1Counter;
ulLastRegTest2Counter = ulRegTest2Counter;
/* Toggle the check LEDs to give an indication of the system status. If
the green LEDs are toggling, then no errors have been detected. If the red
LEDs are toggling, then an error has been reported in at least one task. */
vParTestToggleLED( ulLED1 );
vParTestToggleLED( ulLED2 );
/* Have any errors been latch in ulErrorFound? If so, ensure the gree LEDs
are off, then switch to using the red LEDs. */
if( ulErrorFound != pdFALSE )
{
if( lChangeToRedLEDsAlready == pdFALSE )
{
lChangeToRedLEDsAlready = pdTRUE;
/* An error has been found. Switch to use the red LEDs. */
vParTestSetLED( ulLED1, pdFALSE );
vParTestSetLED( ulLED2, pdFALSE );
//.........这里部分代码省略.........
示例13: prvCheckTask
static void prvCheckTask( void *pvParameters )
{
TickType_t xDelayPeriod = mainNO_ERROR_DELAY, xLastWakeTime;
unsigned portBASE_TYPE uxLEDToUse = 0;
/* Ensure parameter is passed in correctly. */
if( pvParameters != mainCHECK_PARAMETER )
{
xDelayPeriod = mainERROR_DELAY;
}
/* Initialise xLastWakeTime before it is used. After this point it is not
written to directly. */
xLastWakeTime = xTaskGetTickCount();
/* Cycle for ever, delaying then checking all the other tasks are still
operating without error. */
for( ;; )
{
/* Wait until it is time to check all the other tasks again. */
vTaskDelayUntil( &xLastWakeTime, xDelayPeriod );
if( lRegTestStatus != pdPASS )
{
xDelayPeriod = mainERROR_DELAY;
}
if( xAreGenericQueueTasksStillRunning() != pdTRUE )
{
xDelayPeriod = mainERROR_DELAY;
}
if( xAreQueuePeekTasksStillRunning() != pdTRUE )
{
xDelayPeriod = mainERROR_DELAY;
}
if( xAreSemaphoreTasksStillRunning() != pdTRUE )
{
xDelayPeriod = mainERROR_DELAY;
}
if( xIsCreateTaskStillRunning() != pdTRUE )
{
xDelayPeriod = mainERROR_DELAY;
}
/* The Fx3 runs more tasks, so more checks are performed. */
#ifdef __IAR_V850ES_Fx3__
{
if( xAreComTestTasksStillRunning() != pdTRUE )
{
xDelayPeriod = mainERROR_DELAY;
}
if( xArePollingQueuesStillRunning() != pdTRUE )
{
xDelayPeriod = mainERROR_DELAY;
}
if( xAreBlockingQueuesStillRunning() != pdTRUE )
{
xDelayPeriod = mainERROR_DELAY;
}
if( xAreRecursiveMutexTasksStillRunning() != pdTRUE )
{
xDelayPeriod = mainERROR_DELAY;
}
/* The application board has more LEDs and uses the flash tasks
so the check task instead uses LED3 as LED3 is still spare. */
uxLEDToUse = 3;
}
#endif
/* Toggle the LED. The toggle rate will depend on whether or not an
error has been found in any tasks. */
vParTestToggleLED( uxLEDToUse );
}
}
示例14: prvCheckTimerCallback
static void prvCheckTimerCallback( TimerHandle_t xTimer )
{
static long lChangedTimerPeriodAlready = pdFALSE, lErrorStatus = pdPASS;
static volatile unsigned long ulLastRegTest1CycleCount = 0UL, ulLastRegTest2CycleCount = 0UL;
/* Remove compiler warnings about unused parameters. */
( void ) xTimer;
/* Check the standard demo tasks are running without error. */
if( xAreGenericQueueTasksStillRunning() != pdTRUE )
{
lErrorStatus = pdFAIL;
}
else if( xIsCreateTaskStillRunning() != pdTRUE )
{
lErrorStatus = pdFAIL;
}
else if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
{
lErrorStatus = pdFAIL;
}
else if( xAreRecursiveMutexTasksStillRunning() != pdTRUE )
{
lErrorStatus = pdFAIL;
}
/* Check the reg test tasks are still cycling. They will stop incrementing
their loop counters if they encounter an error. */
if( ulRegTest1CycleCount == ulLastRegTest1CycleCount )
{
lErrorStatus = pdFAIL;
}
if( ulRegTest2CycleCount == ulLastRegTest2CycleCount )
{
lErrorStatus = pdFAIL;
}
/* Remember the loop counter values this time around so they can be checked
again the next time this callback function executes. */
ulLastRegTest1CycleCount = ulRegTest1CycleCount;
ulLastRegTest2CycleCount = ulRegTest2CycleCount;
/* Toggle the check LED to give an indication of the system status. If
the LED toggles every three seconds then everything is ok. A faster toggle
indicates an error. */
vParTestToggleLED( mainCHECK_LED );
/* Was an error detected this time through the callback execution? */
if( lErrorStatus != pdPASS )
{
if( lChangedTimerPeriodAlready == pdFALSE )
{
lChangedTimerPeriodAlready = pdTRUE;
/* This call to xTimerChangePeriod() uses a zero block time.
Functions called from inside of a timer callback function must
*never* attempt to block. */
xTimerChangePeriod( xCheckTimer, ( mainERROR_CHECK_TIMER_PERIOD_MS ), mainDONT_BLOCK );
}
}
}
示例15: prvCheckTimerCallback
static void prvCheckTimerCallback( TimerHandle_t xTimer )
{
static long lChangedTimerPeriodAlready = pdFALSE;
unsigned long ulErrorFound = pdFALSE;
/* Check all the demo tasks (other than the flash tasks) to ensure
they are all still running, and that none have detected an error. */
if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
{
ulErrorFound = pdTRUE;
}
if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )
{
ulErrorFound = pdTRUE;
}
if( xAreBlockingQueuesStillRunning() != pdTRUE )
{
ulErrorFound = pdTRUE;
}
if ( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
{
ulErrorFound = pdTRUE;
}
if ( xAreGenericQueueTasksStillRunning() != pdTRUE )
{
ulErrorFound = pdTRUE;
}
if ( xAreRecursiveMutexTasksStillRunning() != pdTRUE )
{
ulErrorFound = pdTRUE;
}
if( xIsCreateTaskStillRunning() != pdTRUE )
{
ulErrorFound = pdTRUE;
}
if( xArePollingQueuesStillRunning() != pdTRUE )
{
ulErrorFound = pdTRUE;
}
if( xAreSemaphoreTasksStillRunning() != pdTRUE )
{
ulErrorFound = pdTRUE;
}
/* Toggle the check LED to give an indication of the system status. If
the LED toggles every mainCHECK_TIMER_PERIOD_MS milliseconds then
everything is ok. A faster toggle indicates an error. */
vParTestToggleLED( mainCHECK_LED );
/* Have any errors been latch in ulErrorFound? If so, shorten the
period of the check timer to mainERROR_CHECK_TIMER_PERIOD_MS milliseconds.
This will result in an increase in the rate at which mainCHECK_LED
toggles. */
if( ulErrorFound != pdFALSE )
{
if( lChangedTimerPeriodAlready == pdFALSE )
{
lChangedTimerPeriodAlready = pdTRUE;
/* This call to xTimerChangePeriod() uses a zero block time.
Functions called from inside of a timer callback function must
*never* attempt to block. */
xTimerChangePeriod( xTimer, ( mainERROR_CHECK_TIMER_PERIOD_MS ), mainDONT_BLOCK );
}
}
}