]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/Common/Minimal/PollQ.c
Notes:
[freertos] / FreeRTOS / Demo / Common / Minimal / PollQ.c
index 802b1023c762c113407cd98d155ae051fda96383..a8bf5d6401301970b03c3621c619402fe9ac4bca 100644 (file)
@@ -134,17 +134,20 @@ static QueueHandle_t xPolledQueue;
        /* Create the queue used by the producer and consumer. */\r
        xPolledQueue = xQueueCreate( pollqQUEUE_SIZE, ( UBaseType_t ) sizeof( uint16_t ) );\r
 \r
-       /* vQueueAddToRegistry() adds the queue to the queue registry, if one is\r
-       in use.  The queue registry is provided as a means for kernel aware\r
-       debuggers to locate queues and has no purpose if a kernel aware debugger\r
-       is not being used.  The call to vQueueAddToRegistry() will be removed\r
-       by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is\r
-       defined to be less than 1. */\r
-       vQueueAddToRegistry( xPolledQueue, "Poll_Test_Queue" );\r
-\r
-       /* Spawn the producer and consumer. */\r
-       xTaskCreate( vPolledQueueConsumer, "QConsNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( TaskHandle_t * ) NULL );\r
-       xTaskCreate( vPolledQueueProducer, "QProdNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( TaskHandle_t * ) NULL );\r
+       if( xPolledQueue != NULL )\r
+       {\r
+               /* vQueueAddToRegistry() adds the queue to the queue registry, if one is\r
+               in use.  The queue registry is provided as a means for kernel aware\r
+               debuggers to locate queues and has no purpose if a kernel aware debugger\r
+               is not being used.  The call to vQueueAddToRegistry() will be removed\r
+               by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is\r
+               defined to be less than 1. */\r
+               vQueueAddToRegistry( xPolledQueue, "Poll_Test_Queue" );\r
+\r
+               /* Spawn the producer and consumer. */\r
+               xTaskCreate( vPolledQueueConsumer, "QConsNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( TaskHandle_t * ) NULL );\r
+               xTaskCreate( vPolledQueueProducer, "QProdNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( TaskHandle_t * ) NULL );\r
+       }\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r