Go to the source code of this file.
Functions | |
void | vStartAltPolledQueueTasks (unsigned portBASE_TYPE uxPriority) |
portBASE_TYPE | xAreAltPollingQueuesStillRunning (void) |
void vStartAltPolledQueueTasks | ( | unsigned portBASE_TYPE | uxPriority | ) |
Definition at line 112 of file AltPollQ.c.
References pollqQUEUE_SIZE, pollqSTACK_SIZE, portBASE_TYPE, portCHAR, portSHORT, vQueueAddToRegistry, xQueueCreate(), and xTaskCreate.
00113 { 00114 static xQueueHandle xPolledQueue; 00115 00116 /* Create the queue used by the producer and consumer. */ 00117 xPolledQueue = xQueueCreate( pollqQUEUE_SIZE, ( unsigned portBASE_TYPE ) sizeof( unsigned portSHORT ) ); 00118 00119 /* vQueueAddToRegistry() adds the queue to the queue registry, if one is 00120 in use. The queue registry is provided as a means for kernel aware 00121 debuggers to locate queues and has no purpose if a kernel aware debugger 00122 is not being used. The call to vQueueAddToRegistry() will be removed 00123 by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is 00124 defined to be less than 1. */ 00125 vQueueAddToRegistry( xPolledQueue, ( signed portCHAR * ) "AltPollQueue" ); 00126 00127 00128 /* Spawn the producer and consumer. */ 00129 xTaskCreate( vPolledQueueConsumer, ( signed portCHAR * ) "QConsNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( xTaskHandle * ) NULL ); 00130 xTaskCreate( vPolledQueueProducer, ( signed portCHAR * ) "QProdNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( xTaskHandle * ) NULL ); 00131 }
portBASE_TYPE xAreAltPollingQueuesStillRunning | ( | void | ) |
Definition at line 238 of file AltPollQ.c.
References pdFALSE, pdTRUE, pollqINITIAL_VALUE, portBASE_TYPE, xPollingConsumerCount, and xPollingProducerCount.
00239 { 00240 portBASE_TYPE xReturn; 00241 00242 /* Check both the consumer and producer poll count to check they have both 00243 been changed since out last trip round. We do not need a critical section 00244 around the check variables as this is called from a higher priority than 00245 the other tasks that access the same variables. */ 00246 if( ( xPollingConsumerCount == pollqINITIAL_VALUE ) || 00247 ( xPollingProducerCount == pollqINITIAL_VALUE ) 00248 ) 00249 { 00250 xReturn = pdFALSE; 00251 } 00252 else 00253 { 00254 xReturn = pdTRUE; 00255 } 00256 00257 /* Set the check variables back down so we know if they have been 00258 incremented the next time around. */ 00259 xPollingConsumerCount = pollqINITIAL_VALUE; 00260 xPollingProducerCount = pollqINITIAL_VALUE; 00261 00262 return xReturn; 00263 }