AltBlock.h File Reference

Go to the source code of this file.

Functions

void vCreateAltBlockTimeTasks (void)
portBASE_TYPE xAreAltBlockTimeTestTasksStillRunning (void)


Function Documentation

void vCreateAltBlockTimeTasks ( void   ) 

Definition at line 104 of file AltBlock.c.

References bktPRIMARY_PRIORITY, bktQUEUE_LENGTH, bktSECONDARY_PRIORITY, configMINIMAL_STACK_SIZE, portBASE_TYPE, portCHAR, vPrimaryBlockTimeTestTask(), vQueueAddToRegistry, vSecondaryBlockTimeTestTask(), xQueueCreate(), xSecondary, xTaskCreate, and xTestQueue.

00105 {
00106     /* Create the queue on which the two tasks block. */
00107     xTestQueue = xQueueCreate( bktQUEUE_LENGTH, sizeof( portBASE_TYPE ) );
00108 
00109     /* vQueueAddToRegistry() adds the queue to the queue registry, if one is
00110     in use.  The queue registry is provided as a means for kernel aware 
00111     debuggers to locate queues and has no purpose if a kernel aware debugger
00112     is not being used.  The call to vQueueAddToRegistry() will be removed
00113     by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is 
00114     defined to be less than 1. */
00115     vQueueAddToRegistry( xTestQueue, ( signed portCHAR * ) "AltBlockQueue" );
00116 
00117 
00118     /* Create the two test tasks. */
00119     xTaskCreate( vPrimaryBlockTimeTestTask, ( signed portCHAR * )"FBTest1", configMINIMAL_STACK_SIZE, NULL, bktPRIMARY_PRIORITY, NULL );
00120     xTaskCreate( vSecondaryBlockTimeTestTask, ( signed portCHAR * )"FBTest2", configMINIMAL_STACK_SIZE, NULL, bktSECONDARY_PRIORITY, &xSecondary );
00121 }

portBASE_TYPE xAreAltBlockTimeTestTasksStillRunning ( void   ) 

Definition at line 511 of file AltBlock.c.

References pdFAIL, pdPASS, pdTRUE, portBASE_TYPE, xErrorOccurred, xPrimaryCycles, and xSecondaryCycles.

00512 {
00513 static portBASE_TYPE xLastPrimaryCycleCount = 0, xLastSecondaryCycleCount = 0;
00514 portBASE_TYPE xReturn = pdPASS;
00515 
00516     /* Have both tasks performed at least one cycle since this function was
00517     last called? */
00518     if( xPrimaryCycles == xLastPrimaryCycleCount )
00519     {
00520         xReturn = pdFAIL;
00521     }
00522 
00523     if( xSecondaryCycles == xLastSecondaryCycleCount )
00524     {
00525         xReturn = pdFAIL;
00526     }
00527 
00528     if( xErrorOccurred == pdTRUE )
00529     {
00530         xReturn = pdFAIL;
00531     }
00532 
00533     xLastSecondaryCycleCount = xSecondaryCycles;
00534     xLastPrimaryCycleCount = xPrimaryCycles;
00535 
00536     return xReturn;
00537 }


Generated on Thu Dec 17 20:02:00 2009 for AVR32 UC3 - FreeRTOS Real Time Kernel by  doxygen 1.5.5