X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=FreeRTOS%2FDemo%2FCommon%2FMinimal%2FPollQ.c;h=67ed1f3a5d16f51a613b405e2106b597b4c8d7b2;hb=70c851fb1e2d149adf99e36aa989d2e455f3d35a;hp=699b37fd45183fa13c30eb32bdacb6bd32eaaa85;hpb=b4cc54a59d87fa3077a81090e5d25a5c30ae87e4;p=freertos diff --git a/FreeRTOS/Demo/Common/Minimal/PollQ.c b/FreeRTOS/Demo/Common/Minimal/PollQ.c index 699b37fd4..67ed1f3a5 100644 --- a/FreeRTOS/Demo/Common/Minimal/PollQ.c +++ b/FreeRTOS/Demo/Common/Minimal/PollQ.c @@ -109,7 +109,7 @@ Changes from V2.0.0 #define pollqSTACK_SIZE configMINIMAL_STACK_SIZE #define pollqQUEUE_SIZE ( 10 ) -#define pollqPRODUCER_DELAY ( ( TickType_t ) 200 / portTICK_PERIOD_MS ) +#define pollqPRODUCER_DELAY ( pdMS_TO_TICKS( ( TickType_t ) 200 ) ) #define pollqCONSUMER_DELAY ( pollqPRODUCER_DELAY - ( TickType_t ) ( 20 / portTICK_PERIOD_MS ) ) #define pollqNO_DELAY ( ( TickType_t ) 0 ) #define pollqVALUES_TO_PRODUCE ( ( BaseType_t ) 3 ) @@ -135,10 +135,10 @@ static QueueHandle_t xPolledQueue; xPolledQueue = xQueueCreate( pollqQUEUE_SIZE, ( UBaseType_t ) sizeof( uint16_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 + 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 + by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is defined to be less than 1. */ vQueueAddToRegistry( xPolledQueue, "Poll_Test_Queue" ); @@ -154,7 +154,7 @@ uint16_t usValue = ( uint16_t ) 0; BaseType_t xError = pdFALSE, xLoop; for( ;; ) - { + { for( xLoop = 0; xLoop < pollqVALUES_TO_PRODUCE; xLoop++ ) { /* Send an incrementing number on the queue without blocking. */ @@ -193,7 +193,7 @@ uint16_t usData, usExpectedValue = ( uint16_t ) 0; BaseType_t xError = pdFALSE; for( ;; ) - { + { /* Loop until the queue is empty. */ while( uxQueueMessagesWaiting( *( ( QueueHandle_t * ) pvParameters ) ) ) {