Quality RTOS & Embedded Software

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




Loading

Changing the xTicksToWait in xQueueReceive

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

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


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




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

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

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

OpenRTOS and SafeRTOS