]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/Common/Minimal/blocktim.c
Notes:
[freertos] / FreeRTOS / Demo / Common / Minimal / blocktim.c
index 92a28c8ebab6cac95752ff1f2af9f6ba23eb5555..20d0783eb32f6582a431998b2a79a7ce58d84ff1 100644 (file)
@@ -134,19 +134,22 @@ static volatile UBaseType_t xRunIndicator;
 void vCreateBlockTimeTasks( void )\r
 {\r
        /* Create the queue on which the two tasks block. */\r
-    xTestQueue = xQueueCreate( bktQUEUE_LENGTH, sizeof( BaseType_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( xTestQueue, "Block_Time_Queue" );\r
-\r
-       /* Create the two test tasks. */\r
-       xTaskCreate( vPrimaryBlockTimeTestTask, "BTest1", configMINIMAL_STACK_SIZE, NULL, bktPRIMARY_PRIORITY, NULL );\r
-       xTaskCreate( vSecondaryBlockTimeTestTask, "BTest2", configMINIMAL_STACK_SIZE, NULL, bktSECONDARY_PRIORITY, &xSecondary );\r
+       xTestQueue = xQueueCreate( bktQUEUE_LENGTH, sizeof( BaseType_t ) );\r
+\r
+       if( xTestQueue != NULL )\r
+       {\r
+               /* vQueueAddToRegistry() adds the queue to the queue registry, if one\r
+               is 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\r
+               debugger is not being used.  The call to vQueueAddToRegistry() will be\r
+               removed by the pre-processor if configQUEUE_REGISTRY_SIZE is not\r
+               defined or is defined to be less than 1. */\r
+               vQueueAddToRegistry( xTestQueue, "Block_Time_Queue" );\r
+\r
+               /* Create the two test tasks. */\r
+               xTaskCreate( vPrimaryBlockTimeTestTask, "BTest1", configMINIMAL_STACK_SIZE, NULL, bktPRIMARY_PRIORITY, NULL );\r
+               xTaskCreate( vSecondaryBlockTimeTestTask, "BTest2", configMINIMAL_STACK_SIZE, NULL, bktSECONDARY_PRIORITY, &xSecondary );\r
+       }\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r