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] [January 2012 Threads] Changing the xTicksToWait in xQueueReceivePosted by Thomas Johansen on January 19, 2012 Hi
I just wonder (I couldn't find the info elsewhere), what happens if the xTicksToWait in the xQueueReceive is changed while the function call is blocked?
If the xQueueReceive is called with portMAX_DELAY and that is changed to something else. Would the xQueueReceive return if that new timeout has elapsed or do I have to call xQueueReceive again to use this new timeout?
Thomas
RE: Changing the xTicksToWait in xQueueReceivePosted by Richard on January 19, 2012 You are looking at the implementation of an API function - which is fine if you are doing that out of curiosity or want to know how FreeRTOS works. If on the other hand you are just wanting to use FreeRTOS, then you only need to know the behaviour of the API function, and not how it implements that behavior.
If a task calls xQueueReceive() with a block time, then the time at which the task should unblock if there is no data to receive is calculated at the time xQueueReceive() is called - and that value cannot be changed after the function has been called. The manipulation of xTicksToWait in the function implementation ensures that behaviour is correct - it does not effect the time at which the task unblocks.
Regards.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|