mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-20 13:31:58 -04:00
Add in example vQueueAddToRegistry() calls.
This commit is contained in:
parent
15881cdf39
commit
a5f3797949
|
@ -102,6 +102,15 @@ void vCreateAltBlockTimeTasks( void )
|
||||||
/* Create the queue on which the two tasks block. */
|
/* Create the queue on which the two tasks block. */
|
||||||
xTestQueue = xQueueCreate( bktQUEUE_LENGTH, sizeof( portBASE_TYPE ) );
|
xTestQueue = xQueueCreate( bktQUEUE_LENGTH, sizeof( portBASE_TYPE ) );
|
||||||
|
|
||||||
|
/* vQueueAddToRegistry() adds the queue to the queue registry, if one is
|
||||||
|
in use. The queue registry is provided as a means for kernel aware
|
||||||
|
debuggers to locate queues and has no purpose if a kernel aware debugger
|
||||||
|
is not being used. The call to vQueueAddToRegistry() will be removed
|
||||||
|
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is
|
||||||
|
defined to be less than 1. */
|
||||||
|
vQueueAddToRegistry( xTestQueue, ( signed portCHAR * ) "AltBlockQueue" );
|
||||||
|
|
||||||
|
|
||||||
/* Create the two test tasks. */
|
/* Create the two test tasks. */
|
||||||
xTaskCreate( vPrimaryBlockTimeTestTask, ( signed portCHAR * )"FBTest1", configMINIMAL_STACK_SIZE, NULL, bktPRIMARY_PRIORITY, NULL );
|
xTaskCreate( vPrimaryBlockTimeTestTask, ( signed portCHAR * )"FBTest1", configMINIMAL_STACK_SIZE, NULL, bktPRIMARY_PRIORITY, NULL );
|
||||||
xTaskCreate( vSecondaryBlockTimeTestTask, ( signed portCHAR * )"FBTest2", configMINIMAL_STACK_SIZE, NULL, bktSECONDARY_PRIORITY, &xSecondary );
|
xTaskCreate( vSecondaryBlockTimeTestTask, ( signed portCHAR * )"FBTest2", configMINIMAL_STACK_SIZE, NULL, bktSECONDARY_PRIORITY, &xSecondary );
|
||||||
|
|
|
@ -112,6 +112,15 @@ static xQueueHandle xPolledQueue;
|
||||||
/* Create the queue used by the producer and consumer. */
|
/* Create the queue used by the producer and consumer. */
|
||||||
xPolledQueue = xQueueCreate( pollqQUEUE_SIZE, ( unsigned portBASE_TYPE ) sizeof( unsigned portSHORT ) );
|
xPolledQueue = xQueueCreate( pollqQUEUE_SIZE, ( unsigned portBASE_TYPE ) sizeof( unsigned portSHORT ) );
|
||||||
|
|
||||||
|
/* vQueueAddToRegistry() adds the queue to the queue registry, if one is
|
||||||
|
in use. The queue registry is provided as a means for kernel aware
|
||||||
|
debuggers to locate queues and has no purpose if a kernel aware debugger
|
||||||
|
is not being used. The call to vQueueAddToRegistry() will be removed
|
||||||
|
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is
|
||||||
|
defined to be less than 1. */
|
||||||
|
vQueueAddToRegistry( xPolledQueue, ( signed portCHAR * ) "AltPollQueue" );
|
||||||
|
|
||||||
|
|
||||||
/* Spawn the producer and consumer. */
|
/* Spawn the producer and consumer. */
|
||||||
xTaskCreate( vPolledQueueConsumer, ( signed portCHAR * ) "QConsNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( xTaskHandle * ) NULL );
|
xTaskCreate( vPolledQueueConsumer, ( signed portCHAR * ) "QConsNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( xTaskHandle * ) NULL );
|
||||||
xTaskCreate( vPolledQueueProducer, ( signed portCHAR * ) "QProdNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( xTaskHandle * ) NULL );
|
xTaskCreate( vPolledQueueProducer, ( signed portCHAR * ) "QProdNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( xTaskHandle * ) NULL );
|
||||||
|
|
|
@ -132,6 +132,14 @@ xSemaphoreHandle xMutex;
|
||||||
prvSendFrontAndBackTest demo. */
|
prvSendFrontAndBackTest demo. */
|
||||||
xQueue = xQueueCreate( genqQUEUE_LENGTH, sizeof( unsigned portLONG ) );
|
xQueue = xQueueCreate( genqQUEUE_LENGTH, sizeof( unsigned portLONG ) );
|
||||||
|
|
||||||
|
/* vQueueAddToRegistry() adds the queue to the queue registry, if one is
|
||||||
|
in use. The queue registry is provided as a means for kernel aware
|
||||||
|
debuggers to locate queues and has no purpose if a kernel aware debugger
|
||||||
|
is not being used. The call to vQueueAddToRegistry() will be removed
|
||||||
|
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is
|
||||||
|
defined to be less than 1. */
|
||||||
|
vQueueAddToRegistry( xQueue, ( signed portCHAR * ) "Alt_Gen_Test_Queue" );
|
||||||
|
|
||||||
/* Create the demo task and pass it the queue just created. We are
|
/* Create the demo task and pass it the queue just created. We are
|
||||||
passing the queue handle by value so it does not matter that it is
|
passing the queue handle by value so it does not matter that it is
|
||||||
declared on the stack here. */
|
declared on the stack here. */
|
||||||
|
@ -140,6 +148,14 @@ xSemaphoreHandle xMutex;
|
||||||
/* Create the mutex used by the prvMutexTest task. */
|
/* Create the mutex used by the prvMutexTest task. */
|
||||||
xMutex = xSemaphoreCreateMutex();
|
xMutex = xSemaphoreCreateMutex();
|
||||||
|
|
||||||
|
/* vQueueAddToRegistry() adds the mutex to the registry, if one is
|
||||||
|
in use. The registry is provided as a means for kernel aware
|
||||||
|
debuggers to locate mutex and has no purpose if a kernel aware debugger
|
||||||
|
is not being used. The call to vQueueAddToRegistry() will be removed
|
||||||
|
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is
|
||||||
|
defined to be less than 1. */
|
||||||
|
vQueueAddToRegistry( ( xQueueHandle ) xMutex, ( signed portCHAR * ) "Alt_Q_Mutex" );
|
||||||
|
|
||||||
/* Create the mutex demo tasks and pass it the mutex just created. We are
|
/* Create the mutex demo tasks and pass it the mutex just created. We are
|
||||||
passing the mutex handle by value so it does not matter that it is declared
|
passing the mutex handle by value so it does not matter that it is declared
|
||||||
on the stack here. */
|
on the stack here. */
|
||||||
|
|
|
@ -134,6 +134,14 @@ xSemaphoreHandle xMutex;
|
||||||
prvSendFrontAndBackTest demo. */
|
prvSendFrontAndBackTest demo. */
|
||||||
xQueue = xQueueCreate( genqQUEUE_LENGTH, sizeof( unsigned portLONG ) );
|
xQueue = xQueueCreate( genqQUEUE_LENGTH, sizeof( unsigned portLONG ) );
|
||||||
|
|
||||||
|
/* vQueueAddToRegistry() adds the queue to the queue registry, if one is
|
||||||
|
in use. The queue registry is provided as a means for kernel aware
|
||||||
|
debuggers to locate queues and has no purpose if a kernel aware debugger
|
||||||
|
is not being used. The call to vQueueAddToRegistry() will be removed
|
||||||
|
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is
|
||||||
|
defined to be less than 1. */
|
||||||
|
vQueueAddToRegistry( xQueue, ( signed portCHAR * ) "Gen_Queue_Test" );
|
||||||
|
|
||||||
/* Create the demo task and pass it the queue just created. We are
|
/* Create the demo task and pass it the queue just created. We are
|
||||||
passing the queue handle by value so it does not matter that it is
|
passing the queue handle by value so it does not matter that it is
|
||||||
declared on the stack here. */
|
declared on the stack here. */
|
||||||
|
@ -142,6 +150,14 @@ xSemaphoreHandle xMutex;
|
||||||
/* Create the mutex used by the prvMutexTest task. */
|
/* Create the mutex used by the prvMutexTest task. */
|
||||||
xMutex = xSemaphoreCreateMutex();
|
xMutex = xSemaphoreCreateMutex();
|
||||||
|
|
||||||
|
/* vQueueAddToRegistry() adds the mutex to the registry, if one is
|
||||||
|
in use. The registry is provided as a means for kernel aware
|
||||||
|
debuggers to locate mutexes and has no purpose if a kernel aware debugger
|
||||||
|
is not being used. The call to vQueueAddToRegistry() will be removed
|
||||||
|
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is
|
||||||
|
defined to be less than 1. */
|
||||||
|
vQueueAddToRegistry( ( xQueueHandle ) xMutex, ( signed portCHAR * ) "Gen_Queue_Mutex" );
|
||||||
|
|
||||||
/* Create the mutex demo tasks and pass it the mutex just created. We are
|
/* Create the mutex demo tasks and pass it the mutex just created. We are
|
||||||
passing the mutex handle by value so it does not matter that it is declared
|
passing the mutex handle by value so it does not matter that it is declared
|
||||||
on the stack here. */
|
on the stack here. */
|
||||||
|
|
|
@ -218,6 +218,16 @@ void vStartInterruptQueueTasks( void )
|
||||||
interrupts. */
|
interrupts. */
|
||||||
xNormallyFullQueue = xQueueCreate( intqQUEUE_LENGTH, ( unsigned portBASE_TYPE ) sizeof( unsigned portBASE_TYPE ) );
|
xNormallyFullQueue = xQueueCreate( intqQUEUE_LENGTH, ( unsigned portBASE_TYPE ) sizeof( unsigned portBASE_TYPE ) );
|
||||||
xNormallyEmptyQueue = xQueueCreate( intqQUEUE_LENGTH, ( unsigned portBASE_TYPE ) sizeof( unsigned portBASE_TYPE ) );
|
xNormallyEmptyQueue = xQueueCreate( intqQUEUE_LENGTH, ( unsigned portBASE_TYPE ) sizeof( unsigned portBASE_TYPE ) );
|
||||||
|
|
||||||
|
/* vQueueAddToRegistry() adds the queue to the queue registry, if one is
|
||||||
|
in use. The queue registry is provided as a means for kernel aware
|
||||||
|
debuggers to locate queues and has no purpose if a kernel aware debugger
|
||||||
|
is not being used. The call to vQueueAddToRegistry() will be removed
|
||||||
|
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is
|
||||||
|
defined to be less than 1. */
|
||||||
|
vQueueAddToRegistry( xNormallyFullQueue, ( signed portCHAR * ) "NormallyFull" );
|
||||||
|
vQueueAddToRegistry( xNormallyEmptyQueue, ( signed portCHAR * ) "NormallyEmpty" );
|
||||||
|
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
|
@ -114,6 +114,14 @@ static xQueueHandle xPolledQueue;
|
||||||
/* Create the queue used by the producer and consumer. */
|
/* Create the queue used by the producer and consumer. */
|
||||||
xPolledQueue = xQueueCreate( pollqQUEUE_SIZE, ( unsigned portBASE_TYPE ) sizeof( unsigned portSHORT ) );
|
xPolledQueue = xQueueCreate( pollqQUEUE_SIZE, ( unsigned portBASE_TYPE ) sizeof( unsigned portSHORT ) );
|
||||||
|
|
||||||
|
/* vQueueAddToRegistry() adds the queue to the queue registry, if one is
|
||||||
|
in use. The queue registry is provided as a means for kernel aware
|
||||||
|
debuggers to locate queues and has no purpose if a kernel aware debugger
|
||||||
|
is not being used. The call to vQueueAddToRegistry() will be removed
|
||||||
|
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is
|
||||||
|
defined to be less than 1. */
|
||||||
|
vQueueAddToRegistry( xPolledQueue, ( signed portCHAR * ) "Poll_Test_Queue" );
|
||||||
|
|
||||||
/* Spawn the producer and consumer. */
|
/* Spawn the producer and consumer. */
|
||||||
xTaskCreate( vPolledQueueConsumer, ( signed portCHAR * ) "QConsNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( xTaskHandle * ) NULL );
|
xTaskCreate( vPolledQueueConsumer, ( signed portCHAR * ) "QConsNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( xTaskHandle * ) NULL );
|
||||||
xTaskCreate( vPolledQueueProducer, ( signed portCHAR * ) "QProdNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( xTaskHandle * ) NULL );
|
xTaskCreate( vPolledQueueProducer, ( signed portCHAR * ) "QProdNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( xTaskHandle * ) NULL );
|
||||||
|
|
|
@ -107,6 +107,14 @@ xQueueHandle xQueue;
|
||||||
/* Create the queue that we are going to use for the test/demo. */
|
/* Create the queue that we are going to use for the test/demo. */
|
||||||
xQueue = xQueueCreate( qpeekQUEUE_LENGTH, sizeof( unsigned portLONG ) );
|
xQueue = xQueueCreate( qpeekQUEUE_LENGTH, sizeof( unsigned portLONG ) );
|
||||||
|
|
||||||
|
/* vQueueAddToRegistry() adds the queue to the queue registry, if one is
|
||||||
|
in use. The queue registry is provided as a means for kernel aware
|
||||||
|
debuggers to locate queues and has no purpose if a kernel aware debugger
|
||||||
|
is not being used. The call to vQueueAddToRegistry() will be removed
|
||||||
|
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is
|
||||||
|
defined to be less than 1. */
|
||||||
|
vQueueAddToRegistry( xQueue, ( signed portCHAR * ) "QPeek_Test_Queue" );
|
||||||
|
|
||||||
/* Create the demo tasks and pass it the queue just created. We are
|
/* Create the demo tasks and pass it the queue just created. We are
|
||||||
passing the queue handle by value so it does not matter that it is declared
|
passing the queue handle by value so it does not matter that it is declared
|
||||||
on the stack here. */
|
on the stack here. */
|
||||||
|
|
|
@ -100,6 +100,14 @@ void vCreateBlockTimeTasks( void )
|
||||||
/* Create the queue on which the two tasks block. */
|
/* Create the queue on which the two tasks block. */
|
||||||
xTestQueue = xQueueCreate( bktQUEUE_LENGTH, sizeof( portBASE_TYPE ) );
|
xTestQueue = xQueueCreate( bktQUEUE_LENGTH, sizeof( portBASE_TYPE ) );
|
||||||
|
|
||||||
|
/* vQueueAddToRegistry() adds the queue to the queue registry, if one is
|
||||||
|
in use. The queue registry is provided as a means for kernel aware
|
||||||
|
debuggers to locate queues and has no purpose if a kernel aware debugger
|
||||||
|
is not being used. The call to vQueueAddToRegistry() will be removed
|
||||||
|
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is
|
||||||
|
defined to be less than 1. */
|
||||||
|
vQueueAddToRegistry( xTestQueue, ( signed portCHAR * ) "Block_Time_Queue" );
|
||||||
|
|
||||||
/* Create the two test tasks. */
|
/* Create the two test tasks. */
|
||||||
xTaskCreate( vPrimaryBlockTimeTestTask, ( signed portCHAR * )"BTest1", configMINIMAL_STACK_SIZE, NULL, bktPRIMARY_PRIORITY, NULL );
|
xTaskCreate( vPrimaryBlockTimeTestTask, ( signed portCHAR * )"BTest1", configMINIMAL_STACK_SIZE, NULL, bktPRIMARY_PRIORITY, NULL );
|
||||||
xTaskCreate( vSecondaryBlockTimeTestTask, ( signed portCHAR * )"BTest2", configMINIMAL_STACK_SIZE, NULL, bktSECONDARY_PRIORITY, &xSecondary );
|
xTaskCreate( vSecondaryBlockTimeTestTask, ( signed portCHAR * )"BTest2", configMINIMAL_STACK_SIZE, NULL, bktSECONDARY_PRIORITY, &xSecondary );
|
||||||
|
|
|
@ -139,6 +139,16 @@ void vStartCountingSemaphoreTasks( void )
|
||||||
xParameters[ 1 ].uxExpectedStartCount = 0;
|
xParameters[ 1 ].uxExpectedStartCount = 0;
|
||||||
xParameters[ 1 ].uxLoopCounter = 0;
|
xParameters[ 1 ].uxLoopCounter = 0;
|
||||||
|
|
||||||
|
/* vQueueAddToRegistry() adds the semaphore to the registry, if one is
|
||||||
|
in use. The registry is provided as a means for kernel aware
|
||||||
|
debuggers to locate semaphores and has no purpose if a kernel aware debugger
|
||||||
|
is not being used. The call to vQueueAddToRegistry() will be removed
|
||||||
|
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is
|
||||||
|
defined to be less than 1. */
|
||||||
|
vQueueAddToRegistry( ( xQueueHandle ) xParameters[ 0 ].xSemaphore, ( signed portCHAR * ) "Counting_Sem_1" );
|
||||||
|
vQueueAddToRegistry( ( xQueueHandle ) xParameters[ 1 ].xSemaphore, ( signed portCHAR * ) "Counting_Sem_2" );
|
||||||
|
|
||||||
|
|
||||||
/* Were the semaphores created? */
|
/* Were the semaphores created? */
|
||||||
if( ( xParameters[ 0 ].xSemaphore != NULL ) || ( xParameters[ 1 ].xSemaphore != NULL ) )
|
if( ( xParameters[ 0 ].xSemaphore != NULL ) || ( xParameters[ 1 ].xSemaphore != NULL ) )
|
||||||
{
|
{
|
||||||
|
|
|
@ -163,6 +163,15 @@ xQueueHandle xSuspendedTestQueue;
|
||||||
void vStartDynamicPriorityTasks( void )
|
void vStartDynamicPriorityTasks( void )
|
||||||
{
|
{
|
||||||
xSuspendedTestQueue = xQueueCreate( priSUSPENDED_QUEUE_LENGTH, sizeof( unsigned portLONG ) );
|
xSuspendedTestQueue = xQueueCreate( priSUSPENDED_QUEUE_LENGTH, sizeof( unsigned portLONG ) );
|
||||||
|
|
||||||
|
/* vQueueAddToRegistry() adds the queue to the queue registry, if one is
|
||||||
|
in use. The queue registry is provided as a means for kernel aware
|
||||||
|
debuggers to locate queues and has no purpose if a kernel aware debugger
|
||||||
|
is not being used. The call to vQueueAddToRegistry() will be removed
|
||||||
|
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is
|
||||||
|
defined to be less than 1. */
|
||||||
|
vQueueAddToRegistry( xSuspendedTestQueue, ( signed portCHAR * ) "Suspended_Test_Queue" );
|
||||||
|
|
||||||
xTaskCreate( vContinuousIncrementTask, ( signed portCHAR * ) "CNT_INC", priSTACK_SIZE, ( void * ) &ulCounter, tskIDLE_PRIORITY, &xContinousIncrementHandle );
|
xTaskCreate( vContinuousIncrementTask, ( signed portCHAR * ) "CNT_INC", priSTACK_SIZE, ( void * ) &ulCounter, tskIDLE_PRIORITY, &xContinousIncrementHandle );
|
||||||
xTaskCreate( vLimitedIncrementTask, ( signed portCHAR * ) "LIM_INC", priSTACK_SIZE, ( void * ) &ulCounter, tskIDLE_PRIORITY + 1, &xLimitedIncrementHandle );
|
xTaskCreate( vLimitedIncrementTask, ( signed portCHAR * ) "LIM_INC", priSTACK_SIZE, ( void * ) &ulCounter, tskIDLE_PRIORITY + 1, &xLimitedIncrementHandle );
|
||||||
xTaskCreate( vCounterControlTask, ( signed portCHAR * ) "C_CTRL", priSTACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );
|
xTaskCreate( vCounterControlTask, ( signed portCHAR * ) "C_CTRL", priSTACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );
|
||||||
|
|
|
@ -128,6 +128,15 @@ void vStartRecursiveMutexTasks( void )
|
||||||
|
|
||||||
xMutex = xSemaphoreCreateRecursiveMutex();
|
xMutex = xSemaphoreCreateRecursiveMutex();
|
||||||
|
|
||||||
|
/* vQueueAddToRegistry() adds the mutex to the registry, if one is
|
||||||
|
in use. The registry is provided as a means for kernel aware
|
||||||
|
debuggers to locate mutex and has no purpose if a kernel aware debugger
|
||||||
|
is not being used. The call to vQueueAddToRegistry() will be removed
|
||||||
|
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is
|
||||||
|
defined to be less than 1. */
|
||||||
|
vQueueAddToRegistry( ( xQueueHandle ) xMutex, ( signed portCHAR * ) "Recursive_Mutex" );
|
||||||
|
|
||||||
|
|
||||||
if( xMutex != NULL )
|
if( xMutex != NULL )
|
||||||
{
|
{
|
||||||
xTaskCreate( prvRecursiveMutexControllingTask, ( signed portCHAR * ) "Rec1", configMINIMAL_STACK_SIZE, NULL, recmuCONTROLLING_TASK_PRIORITY, &xControllingTaskHandle );
|
xTaskCreate( prvRecursiveMutexControllingTask, ( signed portCHAR * ) "Rec1", configMINIMAL_STACK_SIZE, NULL, recmuCONTROLLING_TASK_PRIORITY, &xControllingTaskHandle );
|
||||||
|
|
Loading…
Reference in a new issue