X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=FreeRTOS%2FDemo%2FCommon%2FMinimal%2FQPeek.c;fp=FreeRTOS%2FDemo%2FCommon%2FMinimal%2FQPeek.c;h=a60d8f0d86239c9a51234e3f12ec41bd40f71856;hb=83a941cc6541b83e72fd4c5c31902fdd911dc87a;hp=1749203fa6e69be0501d454d835067c54fa9a799;hpb=6b91a49cdaada37b6dc930bb0abd56ff28a2756e;p=freertos diff --git a/FreeRTOS/Demo/Common/Minimal/QPeek.c b/FreeRTOS/Demo/Common/Minimal/QPeek.c index 1749203fa..a60d8f0d8 100644 --- a/FreeRTOS/Demo/Common/Minimal/QPeek.c +++ b/FreeRTOS/Demo/Common/Minimal/QPeek.c @@ -127,21 +127,24 @@ QueueHandle_t xQueue; /* Create the queue that we are going to use for the test/demo. */ xQueue = xQueueCreate( qpeekQUEUE_LENGTH, sizeof( uint32_t ) ); - /* 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, "QPeek_Test_Queue" ); - - /* 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 - on the stack here. */ - xTaskCreate( prvLowPriorityPeekTask, "PeekL", configMINIMAL_STACK_SIZE, ( void * ) xQueue, qpeekLOW_PRIORITY, NULL ); - xTaskCreate( prvMediumPriorityPeekTask, "PeekM", configMINIMAL_STACK_SIZE, ( void * ) xQueue, qpeekMEDIUM_PRIORITY, &xMediumPriorityTask ); - xTaskCreate( prvHighPriorityPeekTask, "PeekH1", configMINIMAL_STACK_SIZE, ( void * ) xQueue, qpeekHIGH_PRIORITY, &xHighPriorityTask ); - xTaskCreate( prvHighestPriorityPeekTask, "PeekH2", configMINIMAL_STACK_SIZE, ( void * ) xQueue, qpeekHIGHEST_PRIORITY, &xHighestPriorityTask ); + if( xQueue != NULL ) + { + /* 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, "QPeek_Test_Queue" ); + + /* 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 + on the stack here. */ + xTaskCreate( prvLowPriorityPeekTask, "PeekL", configMINIMAL_STACK_SIZE, ( void * ) xQueue, qpeekLOW_PRIORITY, NULL ); + xTaskCreate( prvMediumPriorityPeekTask, "PeekM", configMINIMAL_STACK_SIZE, ( void * ) xQueue, qpeekMEDIUM_PRIORITY, &xMediumPriorityTask ); + xTaskCreate( prvHighPriorityPeekTask, "PeekH1", configMINIMAL_STACK_SIZE, ( void * ) xQueue, qpeekHIGH_PRIORITY, &xHighPriorityTask ); + xTaskCreate( prvHighestPriorityPeekTask, "PeekH2", configMINIMAL_STACK_SIZE, ( void * ) xQueue, qpeekHIGHEST_PRIORITY, &xHighestPriorityTask ); + } } /*-----------------------------------------------------------*/