本文整理汇总了C++中xArePollingQueuesStillRunning函数的典型用法代码示例。如果您正苦于以下问题:C++ xArePollingQueuesStillRunning函数的具体用法?C++ xArePollingQueuesStillRunning怎么用?C++ xArePollingQueuesStillRunning使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了xArePollingQueuesStillRunning函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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 );
//.........这里部分代码省略.........
示例2: 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 );
}
}
示例3: prvCheckTimerCallback
static void prvCheckTimerCallback( TimerHandle_t 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 );
//.........这里部分代码省略.........
示例4: prvCheckTimerCallback
static void prvCheckTimerCallback( TimerHandle_t xTimer )
{
static long lChangedTimerPeriodAlready = pdFALSE;
static unsigned long ulLastRegTest1Value = 0, ulLastRegTest2Value = 0;
unsigned long ulErrorFound = pdFALSE;
/* 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( xAreMathsTaskStillRunning() != pdTRUE )
{
ulErrorFound = pdTRUE;
}
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;
}
/* 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;
/* 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. */
mainTOGGLE_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 );
}
}
}
示例5: vCheckTask
static void vCheckTask( void *pvParameters )
{
portBASE_TYPE xErrorOccurred = pdFALSE;
TickType_t xLastExecutionTime;
unsigned portBASE_TYPE uxColumn = 0;
xLCDMessage xMessage;
xLastExecutionTime = xTaskGetTickCount();
xMessage.xColumn = 0;
xMessage.pcMessage = "PASS";
for( ;; )
{
/* Perform this check every mainCHECK_DELAY milliseconds. */
vTaskDelayUntil( &xLastExecutionTime, mainCHECK_DELAY );
/* Has an error been found in any task? */
if( xAreBlockingQueuesStillRunning() != pdTRUE )
{
xErrorOccurred = pdTRUE;
}
if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
{
xErrorOccurred = pdTRUE;
}
if( xAreSemaphoreTasksStillRunning() != pdTRUE )
{
xErrorOccurred = pdTRUE;
}
if( xArePollingQueuesStillRunning() != pdTRUE )
{
xErrorOccurred = pdTRUE;
}
if( xIsCreateTaskStillRunning() != pdTRUE )
{
xErrorOccurred = pdTRUE;
}
if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
{
xErrorOccurred = pdTRUE;
}
LCD_cls();
xMessage.xColumn++;
LCD_gotoxy( ( uxColumn & 0x07 ) + 1, ( uxColumn & 0x01 ) + 1 );
if( xErrorOccurred == pdTRUE )
{
xMessage.pcMessage = "FAIL";
}
/* Send the message to the LCD gatekeeper for display. */
xQueueSend( xLCDQueue, &xMessage, portMAX_DELAY );
}
}
示例6: prvCheckTimerCallback
static void prvCheckTimerCallback( TimerHandle_t xTimer )
{
/* Check the standard demo tasks are running without error. Latch the
latest reported error in the pcStatusMessage character pointer. */
if( xAreGenericQueueTasksStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: GenQueue";
}
if( xAreQueuePeekTasksStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: QueuePeek\r\n";
}
if( xAreBlockingQueuesStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: BlockQueue\r\n";
}
if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: BlockTime\r\n";
}
if( xAreSemaphoreTasksStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: SemTest\r\n";
}
if( xIsCreateTaskStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: Death\r\n";
}
if( xAreRecursiveMutexTasksStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: RecMutex\r\n";
}
if( xAreComTestTasksStillRunning() != pdPASS )
{
pcStatusMessage = "Error: ComTest\r\n";
}
if( xAreTimerDemoTasksStillRunning( ( mainCHECK_TIMER_PERIOD_MS ) ) != pdTRUE )
{
pcStatusMessage = "Error: TimerDemo";
}
if( xArePollingQueuesStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: PollQueue";
}
if( xAreCountingSemaphoreTasksStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: CountSem";
}
if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )
{
pcStatusMessage = "Error: DynamicPriority";
}
/* 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()
is not used to toggle this particular LED as it is on a different IP port
to to the LEDs controlled by ParTest.c. A critical section is not required
as the only other place this port is accessed is from another timer - and
only one timer can be running at any one time. */
if( ( FM3_GPIO->PDOR3 & mainCHECK_LED ) != 0 )
{
FM3_GPIO->PDOR3 &= ~mainCHECK_LED;
}
else
{
FM3_GPIO->PDOR3 |= mainCHECK_LED;
}
/* Have any errors been latch in pcStatusMessage? 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( pcStatusMessage != NULL )
{
/* 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 );
}
}
示例7: prvCheckTimerCallback
static void prvCheckTimerCallback( TimerHandle_t xTimer )
{
static portBASE_TYPE xChangedTimerPeriodAlready = pdFALSE, xErrorStatus = pdPASS;
/* Inspect the status of the standard demo tasks. */
if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )
{
xErrorStatus = pdFAIL;
}
if( xArePollingQueuesStillRunning() != pdTRUE )
{
xErrorStatus = pdFAIL;
}
if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
{
xErrorStatus = pdFAIL;
}
/* Inspect the status of the reg test tasks. */
if( sRegTestStatus != pdPASS )
{
xErrorStatus = pdFAIL;
}
/* Ensure that the demo software timer has expired
mainDEMO_TIMER_INCREMENTS_PER_CHECK_TIMER_TIMEOUT times in between
each call of this function. A critical section is not required to access
ulDemoSoftwareTimerCounter as the variable is only accessed from another
software timer callback, and only one software timer callback can be
executing at any time. */
if( ( ulDemoSoftwareTimerCounter < ( mainDEMO_TIMER_INCREMENTS_PER_CHECK_TIMER_TIMEOUT - 1 ) ) ||
( ulDemoSoftwareTimerCounter > ( mainDEMO_TIMER_INCREMENTS_PER_CHECK_TIMER_TIMEOUT + 1 ) )
)
{
xErrorStatus = pdFAIL;
}
else
{
ulDemoSoftwareTimerCounter = 0UL;
}
if( ( xErrorStatus == pdFAIL ) && ( xChangedTimerPeriodAlready == pdFALSE ) )
{
/* An error has occurred, but the timer's period has not yet been changed,
change it now, and remember that it has been changed. Shortening the
timer's period means the LED will toggle at a faster rate, giving a
visible indication that something has gone wrong. */
xChangedTimerPeriodAlready = 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 );
}
/* Toggle the LED. The toggle rate will depend on whether or not an error
has been found in any tasks. */
mainLED_0 = !mainLED_0;
}
示例8: prvCheckTimerCallback
static void prvCheckTimerCallback( TimerHandle_t xTimer )
{
static portBASE_TYPE xChangedTimerPeriodAlready = pdFALSE, xErrorStatus = pdPASS;
static unsigned short usLastRegTest1Counter = 0, usLastRegTest2Counter = 0;
/* Remove compiler warning about unused parameter. */
( void ) xTimer;
/* Inspect the status of the standard demo tasks. */
if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )
{
xErrorStatus = pdFAIL;
}
if( xArePollingQueuesStillRunning() != pdTRUE )
{
xErrorStatus = pdFAIL;
}
if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
{
/* Un-comment this line if the block time tasks are included in the
demo. */
/* xErrorStatus = pdFAIL; */
}
/* Indicate an error if either of the reg test loop counters have not
incremented since the last time this function was called. */
if( usLastRegTest1Counter == usRegTest1LoopCounter )
{
xErrorStatus = pdFAIL;
}
else
{
usLastRegTest1Counter = usRegTest1LoopCounter;
}
if( usLastRegTest2Counter == usRegTest2LoopCounter )
{
xErrorStatus = pdFAIL;
}
else
{
usLastRegTest2Counter = usRegTest2LoopCounter;
}
/* Ensure that the demo software timer has expired
mainDEMO_TIMER_INCREMENTS_PER_CHECK_TIMER_TIMEOUT times in between
each call of this function. A critical section is not required to access
ulDemoSoftwareTimerCounter as the variable is only accessed from another
software timer callback, and only one software timer callback can be
executing at any time. */
if( ( ulDemoSoftwareTimerCounter < ( mainDEMO_TIMER_INCREMENTS_PER_CHECK_TIMER_TIMEOUT - 1 ) ) ||
( ulDemoSoftwareTimerCounter > ( mainDEMO_TIMER_INCREMENTS_PER_CHECK_TIMER_TIMEOUT + 1 ) )
)
{
xErrorStatus = pdFAIL;
}
else
{
ulDemoSoftwareTimerCounter = 0UL;
}
if( ( xErrorStatus == pdFAIL ) && ( xChangedTimerPeriodAlready == pdFALSE ) )
{
/* An error has occurred, but the timer's period has not yet been changed,
change it now, and remember that it has been changed. Shortening the
timer's period means the LED will toggle at a faster rate, giving a
visible indication that something has gone wrong. */
xChangedTimerPeriodAlready = 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 );
}
/* Toggle the LED. The toggle rate will depend on whether or not an error
has been found in any tasks. */
LED_BIT = !LED_BIT;
}
示例9: prvCheckOtherTasksAreStillRunning
static void prvCheckOtherTasksAreStillRunning( void )
{
static short sErrorHasOccurred = pdFALSE;
static unsigned long long uxLastHookCallCount = 0, uxLastQueueSendCount = 0;
if( prvCheckMathTasksAreStillRunning() != pdTRUE )
{
vDisplayMessage( "Maths task count unchanged!\r\n" );
sErrorHasOccurred = pdTRUE;
}
if( xAreComTestTasksStillRunning() != pdTRUE )
{
vDisplayMessage( "Com test count unchanged!\r\n" );
sErrorHasOccurred = pdTRUE;
}
if( xAreBlockingQueuesStillRunning() != pdTRUE )
{
vDisplayMessage( "Blocking queues count unchanged!\r\n" );
sErrorHasOccurred = pdTRUE;
}
if( xAreAltBlockingQueuesStillRunning() != pdTRUE )
{
vDisplayMessage( "Alt blocking queues count unchanged!\r\n" );
sErrorHasOccurred = pdTRUE;
}
if( xArePollingQueuesStillRunning() != pdTRUE )
{
vDisplayMessage( "Polling queue count unchanged!\r\n" );
sErrorHasOccurred = pdTRUE;
}
if( xAreAltPollingQueuesStillRunning() != pdTRUE )
{
vDisplayMessage( "Alt 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( xAreDynamicPriorityTasksStillRunning() != pdTRUE )
{
vDisplayMessage( "Dynamic priority count unchanged!\r\n" );
sErrorHasOccurred = pdTRUE;
}
if( xAreMultiEventTasksStillRunning() != pdTRUE )
{
vDisplayMessage( "Error in multi events tasks!\r\n" );
sErrorHasOccurred = pdTRUE;
}
if( xAreFlashCoRoutinesStillRunning() != pdTRUE )
{
vDisplayMessage( "Error in co-routine flash tasks!\r\n" );
sErrorHasOccurred = pdTRUE;
}
if( xAreHookCoRoutinesStillRunning() != pdTRUE )
{
vDisplayMessage( "Error in tick hook to co-routine communications!\r\n" );
sErrorHasOccurred = pdTRUE;
}
if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
{
vDisplayMessage( "Error in block time test tasks!\r\n" );
sErrorHasOccurred = pdTRUE;
}
if( xAreAltBlockTimeTestTasksStillRunning() != pdTRUE )
{
vDisplayMessage( "Error in fast block time test tasks!\r\n" );
sErrorHasOccurred = pdTRUE;
}
if( xAreGenericQueueTasksStillRunning() != pdTRUE )
{
vDisplayMessage( "Error in generic queue test task!\r\n" );
sErrorHasOccurred = pdTRUE;
}
if( xAreAltGenericQueueTasksStillRunning() != pdTRUE )
{
vDisplayMessage( "Error in fast generic queue test task!\r\n" );
sErrorHasOccurred = pdTRUE;
}
//.........这里部分代码省略.........
示例10: vCheckTask
static void vCheckTask( void *pvParameters )
{
portBASE_TYPE xErrorOccurred = pdFALSE;
portTickType xLastExecutionTime;
const char * const pcPassMessage = "PASS\n";
const char * const pcFailMessage = "FAIL\n";
/* Just to remove compiler warnings. */
( void ) pvParameters;
/* Initialise xLastExecutionTime so the first call to vTaskDelayUntil()
works correctly. */
xLastExecutionTime = xTaskGetTickCount();
for( ;; )
{
/* Perform this check every mainCHECK_DELAY milliseconds. */
vTaskDelayUntil( &xLastExecutionTime, mainCHECK_DELAY );
/* Has an error been found in any task? */
if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
{
xErrorOccurred = pdTRUE;
}
if( xArePollingQueuesStillRunning() != pdTRUE )
{
xErrorOccurred = pdTRUE;
}
if( xAreSemaphoreTasksStillRunning() != pdTRUE )
{
xErrorOccurred = pdTRUE;
}
if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )
{
xErrorOccurred = pdTRUE;
}
if( xAreBlockingQueuesStillRunning() != pdTRUE )
{
xErrorOccurred = pdTRUE;
}
#if configUSE_PREEMPTION == 1
{
/* The timing of console output when not using the preemptive
scheduler causes the block time tests to detect a timing problem. */
if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
{
xErrorOccurred = pdTRUE;
}
}
#endif
if( xAreRecursiveMutexTasksStillRunning() != pdTRUE )
{
xErrorOccurred = pdTRUE;
}
/* Send either a pass or fail message. If an error is found it is
never cleared again. */
if( xErrorOccurred == pdTRUE )
{
xLED_Delay = mainERROR_LED_DELAY;
xQueueSend( xPrintQueue, &pcFailMessage, portMAX_DELAY );
}
else
{
xQueueSend( xPrintQueue, &pcPassMessage, portMAX_DELAY );
}
}
}
示例11: 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;
}
示例12: prvCheckTask
static void prvCheckTask( void * pvParameters )
{
portTickType xNextWakeTime, xPeriod = mainNO_ERROR_PERIOD;
static volatile unsigned long ulErrorCode = 0UL;
/* Just to remove the compiler warning. */
( void ) pvParameters;
/* Initialise xNextWakeTime prior to its first use. From this point on
the value of the variable is handled automatically by the kernel. */
xNextWakeTime = xTaskGetTickCount();
for( ;; )
{
/* Delay until it is time for this task to execute again. */
vTaskDelayUntil( &xNextWakeTime, xPeriod );
/* Check all the other tasks in the system - latch any reported errors
into the ulErrorCode variable. */
if( xAreBlockingQueuesStillRunning() != pdTRUE )
{
ulErrorCode |= 0x01UL;
}
if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
{
ulErrorCode |= 0x02UL;
}
if( xAreCountingSemaphoreTasksStillRunning() != pdTRUE )
{
ulErrorCode |= 0x04UL;
}
if( xIsCreateTaskStillRunning() != pdTRUE )
{
ulErrorCode |= 0x08UL;
}
if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )
{
ulErrorCode |= 0x10UL;
}
if( xAreGenericQueueTasksStillRunning() != pdTRUE )
{
ulErrorCode |= 0x20UL;
}
if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
{
ulErrorCode |= 0x40UL;
}
if( xArePollingQueuesStillRunning() != pdTRUE )
{
ulErrorCode |= 0x80UL;
}
if( xAreQueuePeekTasksStillRunning() != pdTRUE )
{
ulErrorCode |= 0x100UL;
}
if( xAreRecursiveMutexTasksStillRunning() != pdTRUE )
{
ulErrorCode |= 0x200UL;
}
if( xAreSemaphoreTasksStillRunning() != pdTRUE )
{
ulErrorCode |= 0x400UL;
}
if( xAreComTestTasksStillRunning() != pdTRUE )
{
ulErrorCode |= 0x800UL;
}
/* Reduce the block period and in so doing increase the frequency at
which this task executes if any errors have been latched. The increased
frequency causes the LED toggle rate to increase and so gives some
visual feedback that an error has occurred. */
if( ulErrorCode != 0x00 )
{
xPeriod = mainERROR_PERIOD;
}
/* Finally toggle the LED. */
vParTestToggleLED( LED_POWER );
}
}
示例13: vErrorChecks
static void vErrorChecks( void *pvParameters )
{
TickType_t xToggleRate = mainNO_ERROR_TOGGLE_PERIOD, xLastWakeTime;
/* Ensure the parameter was passed in as expected. This is just a test of
the kernel port, the parameter is not actually used for anything. The
pointer will only actually be either 3 or 2 bytes, depending on the memory
model. */
if( pvParameters != ( void * ) mainCHECK_PARAMETER_VALUE )
{
xToggleRate = mainERROR_TOGGLE_PERIOD;
}
/* 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, xToggleRate );
if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )
{
xToggleRate = mainERROR_TOGGLE_PERIOD;
}
if( sRegTestStatus != pdPASS )
{
xToggleRate = mainERROR_TOGGLE_PERIOD;
}
#ifdef __IAR_78K0R_Kx3__
{
/* Only the Kx3 runs all the tasks. */
if( xArePollingQueuesStillRunning() != pdTRUE)
{
xToggleRate = mainERROR_TOGGLE_PERIOD;
}
if( xAreSemaphoreTasksStillRunning() != pdTRUE)
{
xToggleRate = mainERROR_TOGGLE_PERIOD;
}
if( xAreGenericQueueTasksStillRunning() != pdTRUE )
{
xToggleRate = mainERROR_TOGGLE_PERIOD;
}
if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
{
xToggleRate = mainERROR_TOGGLE_PERIOD;
}
}
#endif
/* Toggle the LED. The toggle rate will depend on whether or not an
error has been found in any tasks. */
mainLED_0 = !mainLED_0;
}
}
示例14: 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();
}
示例15: prvCheckTask
static void prvCheckTask( void *pvParameters )
{
static volatile unsigned long ulLastRegTest1CycleCount = 0UL, ulLastRegTest2CycleCount = 0UL;
portTickType 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 );
}
//.........这里部分代码省略.........