FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [April 2014 Threads] Tick roundingPosted by znatok on April 30, 2014 Hi,
If I need guaranteed at least 2 ticks delay should I use
vTaskDelay( 2 ) or
vTaskDelay( 3 ) ?
Tick roundingPosted by davedoors on April 30, 2014 vTaskDelay(3) means 3 tick interrupts from the time the function is called. The function will be called part way through a time slice so the first tick interrupt will come after a fraction of a time slice, the second one complete time slice later, and the third another complete time slice after that. So 3 is your answer because it means two complete time slices plus whatever fraction of a time slice is left between when the function is called and the next tick interrupt.
Tick roundingPosted by znatok on April 30, 2014 Thanks.
That's exactly what I was asking for.
Now another question.
My task blocks on
rc = xQueueReceive( xQueue, data, xTicksToWait );
Queue is updated from UART IRQ for example.
If xTicksToWait expires but due to low priority task is not executed for
some time. And during this time IRQ executed and Queue updated.
What would xQueueReceive return in this case?
In other words who has a higher precedence expiration, Queue update of
first occurred between two?
Tick roundingPosted by rtel on April 30, 2014 If:
1) A task is blocked on a queue.
2) The task unblocked because there is a time out, but because of its priority it does not run.
3) An interrupt writes to the queue
4) The task does get some CPU time after the interrupt has written to the queue
then...
The xQueueReceive() function will return pdPASS and the item that was written to the queue between the task unblocking and the task actually running.
Regards.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|