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

xTaskNotifyWait(): incorrect documentation of the ulBitsToClearOnEntry parameter (IDFGH-5468) #7207

Closed
alyf80 opened this issue Jun 29, 2021 · 2 comments
Assignees
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally

Comments

@alyf80
Copy link

alyf80 commented Jun 29, 2021

Environment

  • IDF version: current release/v4.1 HEAD, but 4.2 and 4.3 are also affected

Problem Description

The documentation of the ulBitsToClearOnEntry parameter of xTaskNotifyWait() says:

Bits that are set in ulBitsToClearOnEntry value will be cleared in the calling task’s notification value before the task checks to see if any notifications are pending, and optionally blocks if no notifications are pending.

The underlying code, however, first checks whether there is a pending notification, and then only clears the bits if there are no pending notifications.

I know that the above snippet comes straight from FreeRTOS (so it's really their problem), but this caused me quite a lot of hair pulling, so it would be probably a good idea to update the documentation to reflect reality.

On the FreeRTOS side, things appear to have been fixed in release 10.4.0 (in conjunction with a major overhaul of the task notification API), as the documentation now reads:

Any bits set in ulBitsToClearOnEntry will be cleared in the calling RTOS task's notification value on entry to the xTaskNotifyWait() function (before the task waits for a new notification) provided a notification is not already pending when xTaskNotifyWait() is called.
@espressif-bot espressif-bot added the Status: Opened Issue is new label Jun 29, 2021
@github-actions github-actions bot changed the title xTaskNotifyWait(): incorrect documentation of the ulBitsToClearOnEntry parameter xTaskNotifyWait(): incorrect documentation of the ulBitsToClearOnEntry parameter (IDFGH-5468) Jun 29, 2021
@projectgus
Copy link
Contributor

Hi @alyf80,

Thanks for pointing this out. We can certainly update the docs from the newer version to match the behaviour (although we won't update FreeRTOS to v10.4 yet, if you're interested then there's some discussion in #7137).

@Dazza0 Dazza0 self-assigned this Jul 7, 2022
@espressif-bot espressif-bot assigned zikalino and unassigned Dazza0 Jul 11, 2022
@zikalino zikalino assigned zikalino and unassigned zikalino Jul 18, 2022
@SoucheSouche
Copy link
Collaborator

SoucheSouche commented Jul 28, 2022

Hi @alyf80,
The documentation will be updated to match the implementation of xTaskNotifyWait().

@espressif-bot espressif-bot added Status: In Progress Work is in progress Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Resolution: Done Issue is done internally and removed Status: Opened Issue is new Status: In Progress Work is in progress Resolution: NA Issue resolution is unavailable labels Jul 28, 2022
espressif-bot pushed a commit that referenced this issue Aug 21, 2022
…eter in xTaskGenericNotifyWait() function.

Closes #7207

The description of how the xTaskGenericNotifyWait parameter is handled in the
xTaskGenericNotifyWait() function was inaccurate.

In this commit, the description was updated to match the implementation of xTaskGenericNotifyWait().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally
Projects
None yet
Development

No branches or pull requests

6 participants