FreeRTOS Support ArchiveThe FreeRTOS support forum is used to obtain support directly from Real Time Engineers Ltd.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] [May 2007 Threads] vTaskDelayUntilPosted 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: vTaskDelayUntilPosted 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: vTaskDelayUntilPosted 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.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|