PollQ.h File Reference

Go to the source code of this file.

Functions

void vStartPolledQueueTasks (unsigned portBASE_TYPE uxPriority)
portBASE_TYPE xArePollingQueuesStillRunning (void)


Function Documentation

void vStartPolledQueueTasks ( unsigned portBASE_TYPE  uxPriority  ) 

Definition at line 114 of file PollQ.c.

References pollqQUEUE_SIZE, pollqSTACK_SIZE, portBASE_TYPE, vQueueAddToRegistry, xQueueCreate(), and xTaskCreate.

Referenced by main().

00115 {
00116 static xQueueHandle xPolledQueue;
00117 
00118     /* Create the queue used by the producer and consumer. */
00119     xPolledQueue = xQueueCreate( pollqQUEUE_SIZE, ( unsigned portBASE_TYPE ) sizeof( unsigned short ) );
00120 
00121     /* vQueueAddToRegistry() adds the queue to the queue registry, if one is
00122     in use.  The queue registry is provided as a means for kernel aware 
00123     debuggers to locate queues and has no purpose if a kernel aware debugger
00124     is not being used.  The call to vQueueAddToRegistry() will be removed
00125     by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is 
00126     defined to be less than 1. */
00127     vQueueAddToRegistry( xPolledQueue, ( signed char * ) "Poll_Test_Queue" );
00128 
00129     /* Spawn the producer and consumer. */
00130     xTaskCreate( vPolledQueueConsumer, ( signed char * ) "QConsNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( xTaskHandle * ) NULL );
00131     xTaskCreate( vPolledQueueProducer, ( signed char * ) "QProdNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( xTaskHandle * ) NULL );
00132 }

portBASE_TYPE xArePollingQueuesStillRunning ( void   ) 

Definition at line 221 of file PollQ.c.

References pdFALSE, pdTRUE, pollqINITIAL_VALUE, portBASE_TYPE, xPollingConsumerCount, and xPollingProducerCount.

Referenced by prvCheckOtherTasksAreStillRunning().

00222 {
00223 portBASE_TYPE xReturn;
00224 
00225     /* Check both the consumer and producer poll count to check they have both
00226     been changed since out last trip round.  We do not need a critical section
00227     around the check variables as this is called from a higher priority than
00228     the other tasks that access the same variables. */
00229     if( ( xPollingConsumerCount == pollqINITIAL_VALUE ) ||
00230         ( xPollingProducerCount == pollqINITIAL_VALUE )
00231       )
00232     {
00233         xReturn = pdFALSE;
00234     }
00235     else
00236     {
00237         xReturn = pdTRUE;
00238     }
00239 
00240     /* Set the check variables back down so we know if they have been
00241     incremented the next time around. */
00242     xPollingConsumerCount = pollqINITIAL_VALUE;
00243     xPollingProducerCount = pollqINITIAL_VALUE;
00244 
00245     return xReturn;
00246 }


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