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

Move event thread flag #20868

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
15 changes: 14 additions & 1 deletion core/include/thread_flags.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,21 @@
* }
*/
#define THREAD_FLAG_MSG_WAITING (1u << 15)

/**
* @brief Set by @ref xtimer_set_timeout_flag() when the timer expires
*
* @see xtimer_set_timeout_flag
*/
#define THREAD_FLAG_TIMEOUT (1u << 14)

/**
* @brief Thread flag use to notify available events in an event queue
*
* This flag is used by the `event` module.
*/
#define THREAD_FLAG_EVENT (1u << 13)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing the value from 0x1 to 1 << 13 might break applications that relied on the fact that the latter was unused before.


/**
* @brief Comprehensive set of all predefined flags
*
Expand All @@ -113,9 +121,14 @@
* When using custom flags, asserting that they are not in this set can help
* avoid conflict with future additions to the predefined flags.
*/
#define THREAD_FLAG_PREDEFINED_MASK (THREAD_FLAG_MSG_WAITING | THREAD_FLAG_TIMEOUT)
#define THREAD_FLAG_PREDEFINED_MASK (\
THREAD_FLAG_EVENT |\
THREAD_FLAG_MSG_WAITING |\
THREAD_FLAG_TIMEOUT\
)

/** @} */

Check warning on line 131 in core/include/thread_flags.h

View workflow job for this annotation

GitHub Actions / static-tests

Uncrustify proposes the following patch: --- a/core/include/thread_flags.h +++ b/core/include/thread_flags.h @@ -121,11 +121,11 @@ extern "C" { * When using custom flags, asserting that they are not in this set can help * avoid conflict with future additions to the predefined flags. */ -#define THREAD_FLAG_PREDEFINED_MASK (\ - THREAD_FLAG_EVENT |\ - THREAD_FLAG_MSG_WAITING |\ - THREAD_FLAG_TIMEOUT\ - ) +#define THREAD_FLAG_PREDEFINED_MASK ( \ + THREAD_FLAG_EVENT | \ + THREAD_FLAG_MSG_WAITING | \ + THREAD_FLAG_TIMEOUT \ + ) /** @} */
/**
* @brief Type definition of thread_flags_t
*/
Expand Down
7 changes: 0 additions & 7 deletions sys/include/event.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,6 @@
extern "C" {
#endif

#ifndef THREAD_FLAG_EVENT
/**
* @brief Thread flag use to notify available events in an event queue
*/
#define THREAD_FLAG_EVENT (0x1)
#endif

/**
* @brief event_queue_t static initializer
*/
Expand Down
Loading