Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




Loading

xTaskAbortDelay not updating pxPreviousWakeTime

Posted 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 pxPreviousWakeTime

Posted 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 pxPreviousWakeTime

Posted 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 pxPreviousWakeTime

Posted by rtel on December 13, 2016

Yes - the documentation can be updated to note the behaviour.


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists