Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Inquiry] Suggestions to improve vTaskDelayUntil #76

Closed
robamu opened this issue Jun 22, 2020 · 1 comment · Fixed by #77
Closed

[Inquiry] Suggestions to improve vTaskDelayUntil #76

robamu opened this issue Jun 22, 2020 · 1 comment · Fixed by #77
Labels
question Further information is requested

Comments

@robamu
Copy link
Contributor

robamu commented Jun 22, 2020

Hello,

I would like to suggest some possible improvements for vTaskDelayUntil.

For our application, we would like to check whether a deadline for a periodic task was missed.
For us, this is generally the case if vTaskDelayUntil() does not delay the task. Unfortunately, vTaskDelayUntil does not have a returnvalue, which tells me whether the task was delayed or not ( could also be implemented by passing a pointer to a boolean), so we needed to perform the check before calling vTaskDelayUntil (and we also had to implement the overflow checking again) because the last wake time will be updated internally by it. What do you think about this?

Basically, the interface for vTaskDelayUntil would change from

void vTaskDelayUntil( TickType_t * const pxPreviousWakeTime, const TickType_t xTimeIncrement)

to

void vTaskDelayUntil( TickType_t * const pxPreviousWakeTime, const TickType_t xTimeIncrement, BaseType_t* xWasDelayed)

And the local variable xShouldDelay is assigned too *xWasDelayed at the function end.
Unfortunately, this is an API change but I think it would be a nice feature to implement the checking of missed deadlines.

@robamu robamu added the question Further information is requested label Jun 22, 2020
@RichardBarry
Copy link
Contributor

In this case probably best to introduce xTaskDelayUnitl() that proves the additional information - then make vTaskDelayUntil() a macro that calls xTaskDelayUnitl() for backward compatibility.

@n9wxu n9wxu closed this as completed in #77 Oct 9, 2020
laroche pushed a commit to laroche/FreeRTOS-Kernel that referenced this issue Apr 18, 2024
readme.md to get users jump started.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants