IntQueue.h File Reference

Go to the source code of this file.

Functions

void vStartInterruptQueueTasks (void)
portBASE_TYPE xAreIntQueueTasksStillRunning (void)
portBASE_TYPE xFirstTimerHandler (void)
portBASE_TYPE xSecondTimerHandler (void)


Function Documentation

void vStartInterruptQueueTasks ( void   ) 

Definition at line 211 of file IntQueue.c.

References configMINIMAL_STACK_SIZE, intqHIGH_PRIORITY_TASK1, intqHIGH_PRIORITY_TASK2, intqHIGHER_PRIORITY, intqLOWER_PRIORITY, intqQUEUE_LENGTH, portBASE_TYPE, portCHAR, prv1stHigherPriorityNormallyFullTask(), prv2ndHigherPriorityNormallyFullTask(), prvHigherPriorityNormallyEmptyTask(), prvLowerPriorityNormallyEmptyTask(), prvLowerPriorityNormallyFullTask(), vQueueAddToRegistry, xHighPriorityNormallyEmptyTask1, xHighPriorityNormallyEmptyTask2, xHighPriorityNormallyFullTask1, xHighPriorityNormallyFullTask2, xNormallyEmptyQueue, xNormallyFullQueue, xQueueCreate(), and xTaskCreate.

00212 {
00213     /* Start the test tasks. */
00214     xTaskCreate( prvHigherPriorityNormallyEmptyTask, ( signed portCHAR * ) "H1QRx", configMINIMAL_STACK_SIZE, ( void * ) intqHIGH_PRIORITY_TASK1, intqHIGHER_PRIORITY, &xHighPriorityNormallyEmptyTask1 );
00215     xTaskCreate( prvHigherPriorityNormallyEmptyTask, ( signed portCHAR * ) "H2QRx", configMINIMAL_STACK_SIZE, ( void * ) intqHIGH_PRIORITY_TASK2, intqHIGHER_PRIORITY, &xHighPriorityNormallyEmptyTask2 );
00216     xTaskCreate( prvLowerPriorityNormallyEmptyTask, ( signed portCHAR * ) "LQRx", configMINIMAL_STACK_SIZE, NULL, intqLOWER_PRIORITY, NULL );
00217     xTaskCreate( prv1stHigherPriorityNormallyFullTask, ( signed portCHAR * ) "H1QTx", configMINIMAL_STACK_SIZE, ( void * ) intqHIGH_PRIORITY_TASK1, intqHIGHER_PRIORITY, &xHighPriorityNormallyFullTask1 );
00218     xTaskCreate( prv2ndHigherPriorityNormallyFullTask, ( signed portCHAR * ) "H1QTx", configMINIMAL_STACK_SIZE, ( void * ) intqHIGH_PRIORITY_TASK2, intqHIGHER_PRIORITY, &xHighPriorityNormallyFullTask2 );
00219     xTaskCreate( prvLowerPriorityNormallyFullTask, ( signed portCHAR * ) "LQRx", configMINIMAL_STACK_SIZE, NULL, intqLOWER_PRIORITY, NULL );
00220 
00221     /* Create the queues that are accessed by multiple tasks and multiple
00222     interrupts. */
00223     xNormallyFullQueue = xQueueCreate( intqQUEUE_LENGTH, ( unsigned portBASE_TYPE ) sizeof( unsigned portBASE_TYPE ) );
00224     xNormallyEmptyQueue = xQueueCreate( intqQUEUE_LENGTH, ( unsigned portBASE_TYPE ) sizeof( unsigned portBASE_TYPE ) );
00225 
00226     /* vQueueAddToRegistry() adds the queue to the queue registry, if one is
00227     in use.  The queue registry is provided as a means for kernel aware
00228     debuggers to locate queues and has no purpose if a kernel aware debugger
00229     is not being used.  The call to vQueueAddToRegistry() will be removed
00230     by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is
00231     defined to be less than 1. */
00232     vQueueAddToRegistry( xNormallyFullQueue, ( signed portCHAR * ) "NormallyFull" );
00233     vQueueAddToRegistry( xNormallyEmptyQueue, ( signed portCHAR * ) "NormallyEmpty" );
00234 }

portBASE_TYPE xAreIntQueueTasksStillRunning ( void   ) 

Definition at line 681 of file IntQueue.c.

References portBASE_TYPE, prvQueueAccessLogError(), uxHighPriorityLoops1, uxHighPriorityLoops2, uxLowPriorityLoops1, uxLowPriorityLoops2, and xErrorStatus.

00682 {
00683 static unsigned portBASE_TYPE uxLastHighPriorityLoops1 = 0, uxLastHighPriorityLoops2 = 0, uxLastLowPriorityLoops1 = 0, uxLastLowPriorityLoops2 = 0;
00684 
00685     /* xErrorStatus can be set outside of this function.  This function just
00686     checks that all the tasks are still cycling. */
00687 
00688     if( uxHighPriorityLoops1 == uxLastHighPriorityLoops1 )
00689     {
00690         /* The high priority 1 task has stalled. */
00691         prvQueueAccessLogError( __LINE__ );
00692     }
00693 
00694     uxLastHighPriorityLoops1 = uxHighPriorityLoops1;
00695 
00696     if( uxHighPriorityLoops2 == uxLastHighPriorityLoops2 )
00697     {
00698         /* The high priority 2 task has stalled. */
00699         prvQueueAccessLogError( __LINE__ );
00700     }
00701 
00702     uxLastHighPriorityLoops2 = uxHighPriorityLoops2;
00703 
00704     if( uxLowPriorityLoops1 == uxLastLowPriorityLoops1 )
00705     {
00706         /* The low priority 1 task has stalled. */
00707         prvQueueAccessLogError( __LINE__ );
00708     }
00709 
00710     uxLastLowPriorityLoops1 = uxLowPriorityLoops1;
00711 
00712     if( uxLowPriorityLoops2 == uxLastLowPriorityLoops2 )
00713     {
00714         /* The low priority 2 task has stalled. */
00715         prvQueueAccessLogError( __LINE__ );
00716     }
00717 
00718     uxLastLowPriorityLoops2 = uxLowPriorityLoops2;
00719 
00720     return xErrorStatus;
00721 }

portBASE_TYPE xFirstTimerHandler ( void   ) 

Definition at line 621 of file IntQueue.c.

References pdFALSE, portBASE_TYPE, timerNORMALLY_EMPTY_TX, and timerNORMALLY_FULL_RX.

00622 {
00623 portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE, uxRxedValue;
00624 static unsigned portBASE_TYPE uxNextOperation = 0;
00625 
00626     /* Called from a timer interrupt.  Perform various read and write
00627     accesses on the queues. */
00628 
00629     uxNextOperation++;
00630 
00631     if( uxNextOperation & ( unsigned portBASE_TYPE ) 0x01 )
00632     {
00633         timerNORMALLY_EMPTY_TX();
00634         timerNORMALLY_EMPTY_TX();
00635         timerNORMALLY_EMPTY_TX();
00636     }
00637     else
00638     {
00639         timerNORMALLY_FULL_RX();
00640         timerNORMALLY_FULL_RX();
00641         timerNORMALLY_FULL_RX();
00642     }
00643 
00644     return xHigherPriorityTaskWoken;
00645 }

portBASE_TYPE xSecondTimerHandler ( void   ) 

Definition at line 648 of file IntQueue.c.

References pdFALSE, portBASE_TYPE, timerNORMALLY_EMPTY_RX, timerNORMALLY_EMPTY_TX, timerNORMALLY_FULL_RX, and timerNORMALLY_FULL_TX.

00649 {
00650 unsigned portBASE_TYPE uxRxedValue;
00651 portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
00652 static unsigned portBASE_TYPE uxNextOperation = 0;
00653 
00654     /* Called from a timer interrupt.  Perform various read and write
00655     accesses on the queues. */
00656 
00657     uxNextOperation++;
00658 
00659     if( uxNextOperation & ( unsigned portBASE_TYPE ) 0x01 )
00660     {
00661         timerNORMALLY_EMPTY_TX();
00662         timerNORMALLY_EMPTY_TX();
00663 
00664         timerNORMALLY_EMPTY_RX();
00665         timerNORMALLY_EMPTY_RX();
00666     }
00667     else
00668     {
00669         timerNORMALLY_FULL_RX();
00670         timerNORMALLY_FULL_TX();
00671         timerNORMALLY_FULL_TX();
00672         timerNORMALLY_FULL_TX();
00673         timerNORMALLY_FULL_TX();
00674     }
00675 
00676     return xHigherPriorityTaskWoken;
00677 }


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