本文整理汇总了C++中xAreGenericQueueTasksStillRunning函数的典型用法代码示例。如果您正苦于以下问题:C++ xAreGenericQueueTasksStillRunning函数的具体用法?C++ xAreGenericQueueTasksStillRunning怎么用?C++ xAreGenericQueueTasksStillRunning使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了xAreGenericQueueTasksStillRunning函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: vApplicationTickHook
void vApplicationTickHook( void )
{
static unsigned long ulCounter = 0;
static const unsigned long ulCheckFrequency = 5000UL / portTICK_RATE_MS;
long lHigherPriorityTaskWoken = pdFALSE;
/* Define the status message that is sent to the LCD task. By default the
status is PASS. */
static xQueueMessage xStatusMessage = { mainMESSAGE_STATUS, pdPASS };
/* This is called from within the tick interrupt and performs the 'check'
functionality as described in the comments at the top of this file.
Is it time to perform the 'check' functionality again? */
ulCounter++;
if( ulCounter >= ulCheckFrequency )
{
/* See if the standard demo tasks are executing as expected, changing
the message that is sent to the LCD task from PASS to an error code if
any tasks set reports an error. */
if( xAreDynamicPriorityTasksStillRunning() != pdPASS )
{
xStatusMessage.lMessageValue = mainERROR_DYNAMIC_TASKS;
}
if( xAreComTestTasksStillRunning() != pdPASS )
{
xStatusMessage.lMessageValue = mainERROR_COM_TEST;
}
if( xAreGenericQueueTasksStillRunning() != pdPASS )
{
xStatusMessage.lMessageValue = mainERROR_GEN_QUEUE_TEST;
}
/* As this is the tick hook the lHigherPriorityTaskWoken parameter is not
needed (a context switch is going to be performed anyway), but it must
still be provided. */
xQueueSendFromISR( xLCDQueue, &xStatusMessage, &lHigherPriorityTaskWoken );
ulCounter = 0;
}
}
示例2: prvCheckOtherTasksAreStillRunning
/*-----------------------------------------------------------*/
static portSHORT prvCheckOtherTasksAreStillRunning( void )
{
static portSHORT sNoErrorFound = pdTRUE;
/* The demo tasks maintain a count that increments every cycle of the task
provided that the task has never encountered an error. This function
checks the counts maintained by the tasks to ensure they are still being
incremented. A count remaining at the same value between calls therefore
indicates that an error has been detected. Only tasks that do not flash
an LED are checked. */
#if ( INCLUDE_StartIntegerMathTasks == 1 )
if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
{
sNoErrorFound = pdFALSE;
}
#endif
#if ( INCLUDE_AltStartComTestTasks == 1 )
if( xAreComTestTasksStillRunning() != pdTRUE )
{
sNoErrorFound = pdFALSE;
}
#endif
#if ( INCLUDE_StartPolledQueueTasks == 1 )
if( xArePollingQueuesStillRunning() != pdTRUE )
{
sNoErrorFound = pdFALSE;
}
#endif
#if ( INCLUDE_StartSemaphoreTasks == 1 )
if( xAreSemaphoreTasksStillRunning() != pdTRUE )
{
sNoErrorFound = pdFALSE;
}
#endif
#if ( INCLUDE_StartBlockingQueueTasks == 1 )
if( xAreBlockingQueuesStillRunning() != pdTRUE )
{
sNoErrorFound = pdFALSE;
}
#endif
#if ( INCLUDE_StartDynamicPriorityTasks == 1 )
if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )
{
sNoErrorFound = pdFALSE;
}
#endif
#if ( INCLUDE_StartMathTasks == 1 )
if( xAreMathsTaskStillRunning() != pdTRUE )
{
sNoErrorFound = pdFALSE;
}
#endif
#if ( INCLUDE_StartFlashCoRoutines == 1 )
if( xAreFlashCoRoutinesStillRunning() != pdTRUE )
{
sNoErrorFound = pdFALSE;
}
#endif
#if ( INCLUDE_StartHookCoRoutines == 1 )
if( xAreHookCoRoutinesStillRunning() != pdTRUE )
{
sNoErrorFound = pdFALSE;
}
#endif
#if ( INCLUDE_StartGenericQueueTasks == 1 )
if( xAreGenericQueueTasksStillRunning() != pdTRUE )
{
sNoErrorFound = pdFALSE;
}
#endif
#if ( INCLUDE_StartQueuePeekTasks == 1 )
if( xAreQueuePeekTasksStillRunning() != pdTRUE )
{
sNoErrorFound = pdFALSE;
}
#endif
#if ( INCLUDE_CreateBlockTimeTasks == 1 )
if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
{
sNoErrorFound = pdFALSE;
}
#endif
#if ( INCLUDE_CreateSuicidalTasks == 1 )
if( xIsCreateTaskStillRunning() != pdTRUE )
{
sNoErrorFound = pdFALSE;
}
//.........这里部分代码省略.........
示例3: 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 );
}
}
}
示例4: prvCheckTimerCallback
/* See the description at the top of this file. */
static void prvCheckTimerCallback( xTimerHandle xTimer )
{
static long lChangedTimerPeriodAlready = pdFALSE;
static unsigned long ulLastRegTest1Value = 0, ulLastRegTest2Value = 0;
unsigned long ulErrorFound = pdFALSE;
/* Check all the demo and test tasks to ensure that they are all still
running, and that none have detected an error. */
if( xAreDynamicPriorityTasksStillRunning() != pdPASS )
{
ulErrorFound = pdTRUE;
}
if( xAreBlockTimeTestTasksStillRunning() != pdPASS )
{
ulErrorFound = pdTRUE;
}
if( xAreCountingSemaphoreTasksStillRunning() != pdPASS )
{
ulErrorFound = pdTRUE;
}
if( xAreRecursiveMutexTasksStillRunning() != pdPASS )
{
ulErrorFound = pdTRUE;
}
/* Check that the register test 1 task is still running. */
if( ulLastRegTest1Value == ulRegTest1LoopCounter )
{
ulErrorFound = pdTRUE;
}
ulLastRegTest1Value = ulRegTest1LoopCounter;
/* Check that the register test 2 task is still running. */
if( ulLastRegTest2Value == ulRegTest2LoopCounter )
{
ulErrorFound = pdTRUE;
}
ulLastRegTest2Value = ulRegTest2LoopCounter;
if( xAreQueueSetTasksStillRunning() != pdPASS )
{
ulErrorFound = pdTRUE;
}
if( xIsQueueOverwriteTaskStillRunning() != pdPASS )
{
ulErrorFound = pdTRUE;
}
if( xAreGenericQueueTasksStillRunning() != pdPASS )
{
ulErrorFound = pdTRUE;
}
if( xAreQueuePeekTasksStillRunning() != pdPASS )
{
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. */
port_pin_toggle_output_level( LED_0_PIN );
/* Have any errors been latched 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 the 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 );
}
}
}
示例5: 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();
}
示例6: prvCheckOtherTasksAreStillRunning
static short prvCheckOtherTasksAreStillRunning( void )
{
static short sNoErrorFound = pdTRUE;
/* The demo tasks maintain a count that increments every cycle of the task
provided that the task has never encountered an error. This function
checks the counts maintained by the tasks to ensure they are still being
incremented. A count remaining at the same value between calls therefore
indicates that an error has been detected. Only tasks that do not flash
an LED are checked. */
if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
{
sNoErrorFound = pdFALSE;
}
if( xArePollingQueuesStillRunning() != pdTRUE )
{
sNoErrorFound = pdFALSE;
}
if( xAreSemaphoreTasksStillRunning() != pdTRUE )
{
sNoErrorFound = pdFALSE;
}
if( xAreBlockingQueuesStillRunning() != pdTRUE )
{
sNoErrorFound = pdFALSE;
}
if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )
{
sNoErrorFound = pdFALSE;
}
if( xAreFlashCoRoutinesStillRunning() != pdTRUE )
{
sNoErrorFound = pdFALSE;
}
if( xAreGenericQueueTasksStillRunning() != pdTRUE )
{
sNoErrorFound = pdFALSE;
}
if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
{
sNoErrorFound = pdFALSE;
}
if( xIsCreateTaskStillRunning() != pdTRUE )
{
sNoErrorFound = pdFALSE;
}
#if INCLUDE_TraceListTasks == 0
{
if( xAreComTestTasksStillRunning() != pdTRUE )
{
sNoErrorFound = pdFALSE;
}
}
#endif
return sNoErrorFound;
}
示例7: 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 );
}
}
示例8: 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 );
}
}
示例9: 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;
}
示例10: prvCheckTask
static void prvCheckTask( void *pvParameters )
{
TickType_t xNextWakeTime;
const TickType_t xCycleFrequency = pdMS_TO_TICKS( 2500UL );
/* Just to remove compiler warning. */
( void ) pvParameters;
/* 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( configUSE_PREEMPTION != 0 )
{
/* These tasks are only created when preemption is used. */
if( xAreTimerDemoTasksStillRunning( xCycleFrequency ) != pdTRUE )
{
pcStatusMessage = "Error: TimerDemo";
}
}
#endif
if( xAreTaskNotificationTasksStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: Notification";
}
if( xAreInterruptSemaphoreTasksStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: IntSem";
}
else if( xAreEventGroupTasksStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: EventGroup";
}
else if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: IntMath";
}
else if( xAreGenericQueueTasksStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: GenQueue";
}
else if( xAreQueuePeekTasksStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: QueuePeek";
}
else if( xAreBlockingQueuesStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: BlockQueue";
}
else if( xAreSemaphoreTasksStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: SemTest";
}
else if( xArePollingQueuesStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: PollQueue";
}
else if( xAreMathsTaskStillRunning() != pdPASS )
{
pcStatusMessage = "Error: Flop";
}
else if( xAreRecursiveMutexTasksStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: RecMutex";
}
else if( xAreCountingSemaphoreTasksStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: CountSem";
}
else if( xIsCreateTaskStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: Death";
}
else if( xAreDynamicPriorityTasksStillRunning() != pdPASS )
{
pcStatusMessage = "Error: Dynamic";
}
else if( xAreQueueSetTasksStillRunning() != pdPASS )
{
pcStatusMessage = "Error: Queue set";
}
else if( xIsQueueOverwriteTaskStillRunning() != pdPASS )
{
pcStatusMessage = "Error: Queue overwrite";
}
else if( xAreQueueSetPollTasksStillRunning() != pdPASS )
{
pcStatusMessage = "Error: Queue set polling";
}
else if( xAreBlockTimeTestTasksStillRunning() != pdPASS )
{
pcStatusMessage = "Error: Block time";
}
//.........这里部分代码省略.........
示例11: prvCheckTask
static void prvCheckTask( void *pvParameters )
{
portTickType xNextWakeTime;
const portTickType xCycleFrequency = 1000 / portTICK_RATE_MS;
char *pcStatusMessage = "OK";
/* Just to remove compiler warning. */
( void ) pvParameters;
/* 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( xAreTimerDemoTasksStillRunning( xCycleFrequency ) != pdTRUE )
{
pcStatusMessage = "Error: TimerDemo";
}
else if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: IntMath";
}
else if( xAreGenericQueueTasksStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: GenQueue";
}
else if( xAreQueuePeekTasksStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: QueuePeek";
}
else if( xAreBlockingQueuesStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: BlockQueue";
}
else if( xAreSemaphoreTasksStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: SemTest";
}
else if( xArePollingQueuesStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: PollQueue";
}
else if( xAreMathsTaskStillRunning() != pdPASS )
{
pcStatusMessage = "Error: Flop";
}
else if( xAreRecursiveMutexTasksStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: RecMutex";
}
else if( xAreCountingSemaphoreTasksStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: CountSem";
}
/* This is the only task that uses stdout so its ok to call printf()
directly. */
printf( "%s - %d\r\n", pcStatusMessage, xTaskGetTickCount() );
}
}
示例12: prvCheckTimerCallback
static void prvCheckTimerCallback( TimerHandle_t xTimer )
{
static long lChangedTimerPeriodAlready = pdFALSE;
static unsigned long ulLastRegTest1Value = 0, ulLastRegTest2Value = 0, ulLastHighFrequencyTimerInterrupts = 0;
static const unsigned long ulExpectedHighFrequencyInterrupts = ( ( mainTEST_INTERRUPT_FREQUENCY / 1000UL ) * mainCHECK_TIMER_PERIOD_MS ) - 10; /* 10 allows for a margin of error. */
unsigned long ulErrorOccurred = pdFALSE;
/* The count of the high frequency timer interrupts. */
extern unsigned long ulHighFrequencyTimerInterrupts;
/* Avoid compiler warnings. */
( void ) xTimer;
/* Check that the register test 1 task is still running. */
if( ulLastRegTest1Value == ulRegTest1Cycles )
{
ulErrorOccurred |= ( 0x01UL << 1UL );
}
ulLastRegTest1Value = ulRegTest1Cycles;
/* Check that the register test 2 task is still running. */
if( ulLastRegTest2Value == ulRegTest2Cycles )
{
ulErrorOccurred |= ( 0x01UL << 2UL );
}
ulLastRegTest2Value = ulRegTest2Cycles;
/* Have any of the standard demo tasks detected an error in their
operation? */
if( xAreGenericQueueTasksStillRunning() != pdTRUE )
{
ulErrorOccurred |= ( 0x01UL << 3UL );
}
else if( xAreQueuePeekTasksStillRunning() != pdTRUE )
{
ulErrorOccurred |= ( 0x01UL << 4UL );
}
else if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
{
ulErrorOccurred |= ( 0x01UL << 5UL );
}
else if( xAreSemaphoreTasksStillRunning() != pdTRUE )
{
ulErrorOccurred |= ( 0x01UL << 6UL );
}
else if( xAreIntQueueTasksStillRunning() != pdTRUE )
{
ulErrorOccurred |= ( 0x01UL << 7UL );
}
else if( xAreCountingSemaphoreTasksStillRunning() != pdTRUE )
{
ulErrorOccurred |= ( 0x01UL << 8UL );
}
else if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )
{
ulErrorOccurred |= ( 0x01UL << 9UL );
}
else if( xIsQueueOverwriteTaskStillRunning() != pdTRUE )
{
ulErrorOccurred |= ( 0x01UL << 10UL );
}
else if( xAreQueueSetTasksStillRunning() != pdTRUE )
{
ulErrorOccurred |= ( 0x01UL << 11UL );
}
else if( xAreRecursiveMutexTasksStillRunning() != pdTRUE )
{
ulErrorOccurred |= ( 0x01UL << 12UL );
}
else if( xAreEventGroupTasksStillRunning() != pdTRUE )
{
ulErrorOccurred |= ( 0x01UL << 13UL );
}
else if( xAreMathsTaskStillRunning() != pdTRUE )
{
ulErrorOccurred |= ( 0x01UL << 15UL );
}
/* Ensure the expected number of high frequency interrupts have occurred. */
if( ulLastHighFrequencyTimerInterrupts != 0 )
{
if( ( ulHighFrequencyTimerInterrupts - ulLastHighFrequencyTimerInterrupts ) < ulExpectedHighFrequencyInterrupts )
{
ulErrorOccurred |= ( 0x01UL << 14UL );
}
}
ulLastHighFrequencyTimerInterrupts = ulHighFrequencyTimerInterrupts;
if( ulErrorOccurred != pdFALSE )
{
/* An error occurred. Increase the frequency at which the check timer
toggles its LED to give visual feedback of the potential error
condition. */
if( lChangedTimerPeriodAlready == pdFALSE )
{
lChangedTimerPeriodAlready = pdTRUE;
/* This call to xTimerChangePeriod() uses a zero block time.
Functions called from inside of a timer callback function must
//.........这里部分代码省略.........
示例13: vCheckTask
void vCheckTask( void *pvParameters )
{
unsigned long ulRow = 0;
portTickType xDelay = 0;
unsigned short usErrorCode = 0;
unsigned long ulIteration = 0;
extern unsigned portSHORT usMaxJitter;
/* Intialise the sleeper. */
xDelay = xTaskGetTickCount();
for( ;; )
{
/* Perform this check every mainCHECK_DELAY milliseconds. */
vTaskDelayUntil( &xDelay, mainCHECK_DELAY );
/* Check that all of the Demo tasks are still running. */
if( pdTRUE != xAreBlockingQueuesStillRunning() )
{
usErrorCode |= 0x1;
}
if( pdTRUE != xAreBlockTimeTestTasksStillRunning() )
{
usErrorCode |= 0x2;
}
if( pdTRUE != xAreCountingSemaphoreTasksStillRunning() )
{
usErrorCode |= 0x4;
}
if( pdTRUE != xIsCreateTaskStillRunning() )
{
usErrorCode |= 0x8;
}
if( pdTRUE != xAreDynamicPriorityTasksStillRunning() )
{
usErrorCode |= 0x10;
}
if( pdTRUE != xAreMathsTaskStillRunning() )
{
usErrorCode |= 0x20;
}
if( pdTRUE != xAreGenericQueueTasksStillRunning() )
{
usErrorCode |= 0x40;
}
if( pdTRUE != xAreIntegerMathsTaskStillRunning() )
{
usErrorCode |= 0x80;
}
if( pdTRUE != xArePollingQueuesStillRunning() )
{
usErrorCode |= 0x100;
}
if( pdTRUE != xAreQueuePeekTasksStillRunning() )
{
usErrorCode |= 0x200;
}
if( pdTRUE != xAreSemaphoreTasksStillRunning() )
{
usErrorCode |= 0x400;
}
if( pdTRUE != xAreComTestTasksStillRunning() )
{
usErrorCode |= 0x800;
}
if( pdTRUE != xAreIntQueueTasksStillRunning() )
{
usErrorCode |= 0x1000;
}
/* Clear the display. */
LCD_Character_Display_ClearDisplay();
if( 0 == usErrorCode )
{
LCD_Character_Display_Position( ( ulRow ) & 0x1, 0);
LCD_Character_Display_PrintString( "Pass: " );
LCD_Character_Display_PrintNumber( ulIteration++ );
LCD_Character_Display_Position( ( ++ulRow ) & 0x1, 0 );
LCD_Character_Display_PrintString( "Jitter(ns):" );
LCD_Character_Display_PrintNumber( ( usMaxJitter * mainNS_PER_CLOCK ) );
}
else
{
/* Do something to indicate the failure. */
LCD_Character_Display_Position( ( ulRow ) & 0x1, 0 );
LCD_Character_Display_PrintString( "Fail at: " );
LCD_Character_Display_PrintNumber( ulIteration );
LCD_Character_Display_Position( ( ++ulRow ) & 0x1, 0 );
//.........这里部分代码省略.........
示例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: vApplicationTickHook
void vApplicationTickHook( void )
{
static unsigned long ulCallCount = 0, ulErrorFound = pdFALSE;
/* The rate at which LED D4 will toggle if an error has been found in one or
more of the standard demo tasks. */
const unsigned long ulErrorFlashRate = 500 / portTICK_RATE_MS;
/* The rate at which LED D4 will toggle if no errors have been found in any
of the standard demo tasks. */
const unsigned long ulNoErrorCheckRate = 5000 / portTICK_RATE_MS;
ulCallCount++;
if( ulErrorFound != pdFALSE )
{
/* We have already found an error, so flash the LED with the appropriate
frequency. */
if( ulCallCount > ulErrorFlashRate )
{
ulCallCount = 0;
vParTestToggleLED( mainERROR_LED );
}
}
else
{
if( ulCallCount > ulNoErrorCheckRate )
{
ulCallCount = 0;
/* We have not yet found an error. Check all the demo tasks to ensure
this is still the case. */
if( xAreBlockingQueuesStillRunning() != pdTRUE )
{
ulErrorFound |= 0x01;
}
if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
{
ulErrorFound |= 0x02;
}
if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )
{
ulErrorFound |= 0x04;
}
if( xAreGenericQueueTasksStillRunning() != pdTRUE )
{
ulErrorFound |= 0x08;
}
if( xAreQueuePeekTasksStillRunning() != pdTRUE )
{
ulErrorFound |= 0x10;
}
vParTestToggleLED( mainERROR_LED );
}
}
}