blocktim.h File Reference

Go to the source code of this file.

Functions

void vCreateBlockTimeTasks (void)
portBASE_TYPE xAreBlockTimeTestTasksStillRunning (void)


Function Documentation

void vCreateBlockTimeTasks ( void   ) 

Definition at line 107 of file blocktim.c.

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

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

portBASE_TYPE xAreBlockTimeTestTasksStillRunning ( void   ) 

Definition at line 467 of file blocktim.c.

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

00468 {
00469 static portBASE_TYPE xLastPrimaryCycleCount = 0, xLastSecondaryCycleCount = 0;
00470 portBASE_TYPE xReturn = pdPASS;
00471 
00472     /* Have both tasks performed at least one cycle since this function was
00473     last called? */
00474     if( xPrimaryCycles == xLastPrimaryCycleCount )
00475     {
00476         xReturn = pdFAIL;
00477     }
00478 
00479     if( xSecondaryCycles == xLastSecondaryCycleCount )
00480     {
00481         xReturn = pdFAIL;
00482     }
00483 
00484     if( xErrorOccurred == pdTRUE )
00485     {
00486         xReturn = pdFAIL;
00487     }
00488 
00489     xLastSecondaryCycleCount = xSecondaryCycles;
00490     xLastPrimaryCycleCount = xPrimaryCycles;
00491 
00492     return xReturn;
00493 }


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