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

Reset xNextTaskUnblockTime in task notify FromISR APIs #1111

Merged
merged 4 commits into from
Aug 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions tasks.c
Original file line number Diff line number Diff line change
Expand Up @@ -8080,6 +8080,22 @@ TickType_t uxTaskResetEventItemValue( void )
{
listREMOVE_ITEM( &( pxTCB->xStateListItem ) );
prvAddTaskToReadyList( pxTCB );

#if ( configUSE_TICKLESS_IDLE != 0 )
{
/* If a task is blocked waiting for a notification then
* xNextTaskUnblockTime might be set to the blocked task's time
* out time. If the task is unblocked for a reason other than
* a timeout xNextTaskUnblockTime is normally left unchanged,
* because it will automatically get reset to a new value when
* the tick count equals xNextTaskUnblockTime. However if
* tickless idling is used it might be more important to enter
* sleep mode at the earliest possible time - so reset
* xNextTaskUnblockTime here to ensure it is updated at the
* earliest possible time. */
prvResetNextTaskUnblockTime();
}
#endif
}
else
{
Expand Down Expand Up @@ -8198,6 +8214,22 @@ TickType_t uxTaskResetEventItemValue( void )
{
listREMOVE_ITEM( &( pxTCB->xStateListItem ) );
prvAddTaskToReadyList( pxTCB );

#if ( configUSE_TICKLESS_IDLE != 0 )
{
/* If a task is blocked waiting for a notification then
* xNextTaskUnblockTime might be set to the blocked task's time
* out time. If the task is unblocked for a reason other than
* a timeout xNextTaskUnblockTime is normally left unchanged,
* because it will automatically get reset to a new value when
* the tick count equals xNextTaskUnblockTime. However if
* tickless idling is used it might be more important to enter
* sleep mode at the earliest possible time - so reset
* xNextTaskUnblockTime here to ensure it is updated at the
* earliest possible time. */
prvResetNextTaskUnblockTime();
}
#endif
}
else
{
Expand Down
Loading