Quality RTOS & Embedded Software

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


Loading

vTaskDelayUntil

Posted by Nobody/Anonymous on May 11, 2007
Hey,

Ive searched the forums for a long time now and i cant find any threads that cover this topic.. so here is my question?

I have a task that sends a message every 30 seconds. I currently use vTaskDelayUntil() and not vTaskDelay() to ensure that the task overhead does not change the time period.

My problem is that i also wish to be able to stop the task without waiting for the delay to elapse. I currently do this by setting a exit flag, but my problem is that if i set the exit flag at the start of the 30second delay, it wont break from the task until the vTaskDelayUntil() is finished.

So.. Is their a way that i can force the task to be removed from the vTaskDelayUntil() list?

Actually I think i just solved my own problem... a idea just came to me:

If i call vTaskSuspend() on my delayUntil task, then call vTaskResume() right after it should remove the task from the delay list, put it in the suspend list, then vTaskResume will move it to the ready list.... I think i remember reading that vTaskSuspend() overrides vTaskDelayUntil().

I will still post this message, i will test now and post my results if anyone else is interested.

muZZkat

RE: vTaskDelayUntil

Posted by Nobody/Anonymous on May 12, 2007
>If i call vTaskSuspend() on my delayUntil task, then
>call vTaskResume() right after it should remove the
>task from the delay list, put it in the suspend list,
>then vTaskResume will move it to the ready list.... I
>think i remember reading that vTaskSuspend() overrides
>vTaskDelayUntil().

I think that behavior might have been changed in version 4.1.0. Can you comment Richard?

Dave.

RE: vTaskDelayUntil

Posted by Richard on May 12, 2007
The change you are probably thinking of relates to queues and semaphores.

If a task is blocked on a queue or semaphore (with a timeout) and the task is then suspended and subsequently resumed, the task will continue to be blocked on the same queue/semaphore if there is any block time remaining following its resumption.

If a task is blocked on a temporal event only (vTaskDelay() or vTaskDelayUntil()), and the task is then suspended and subsequently resumed, it will indeed go into the ready state. This is the case even if there is some block time remaining.

Therefore in this case it seems like a solution to suspend then resume the task to remove it from its blocked state.

Regards.


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


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

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

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

Xilinx Microblaze and Zynq partner