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] [December 2016 Threads] xTaskAbortDelay not updating pxPreviousWakeTimePosted by nelsonpina on December 13, 2016 Hi,
I was using the xTaskAbortDelay call to unblock a task that was previously set to sleep, but I realised that this call is not updating the value of the pxPreviousWakeTime, which causes problems because the next time the task calls the vTaskDelayUntil the following conditions is not using correct information and will assume the tick overflowed:
if( xConstTickCount < *pxPreviousWakeTime ) {..}
Is there anything I'm missing here, or this is the expected behaviour?
__
nelson
xTaskAbortDelay not updating pxPreviousWakeTimePosted by rtel on December 13, 2016 *pxPreviousWakeTime is set to the time at which the task would have
unblocked if the delay had not been aborted. That allows
vTaskDelayUntil() to be used to unblock the task with an otherwise (non
aborted) fixed frequency. That could have been implemented the other
way too, but if you need xPreviousWakeTime to be set to the time the
task unblocked because the delay was aborted then you have the option of
setting xPreviousWakeTime manually after the call to vTaskDelayUntil()
returns.
xTaskAbortDelay not updating pxPreviousWakeTimePosted by nelsonpina on December 13, 2016 Sure, that's the workaround I'm using, setting it manually.
But it's not explicit in the documentation that this is the expected behaviour. The statement I found regarding the pxPreviousWakeTime is:
"Pointer to a variable that holds the time at which the task was last unblocked. The variable must be initialized with the current time prior to its first use (see the example below). Following this, the variable is automatically updated within vTaskDelayUntil()."
With this statement, my understanding was that I would never need to update this variable manually. It would always be properlly managed by the FreeRTOS calls.
Maybe some clarification about this on the xTaskAbortDelay API documentation would be helpful don't you think?
cheers,
nelson
xTaskAbortDelay not updating pxPreviousWakeTimePosted by rtel on December 13, 2016 Yes - the documentation can be updated to note the behaviour.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|