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

definition of thread flags are uncoordindated between modules #20867

Open
10 tasks
Enoch247 opened this issue Sep 20, 2024 · 1 comment
Open
10 tasks

definition of thread flags are uncoordindated between modules #20867

Enoch247 opened this issue Sep 20, 2024 · 1 comment
Labels
Community: good first issue This issue is good for newcomers to RIOT to be addressed / implemented

Comments

@Enoch247
Copy link
Contributor

Enoch247 commented Sep 20, 2024

Description

There is a macro THREAD_FLAG_PREDEFINED_MASK to capture thread flags in-use by RIOT to allow applications to avoid collisions when using flags. However, many flags are in-use inside of modules and are not captured in this macro. Worse, some flags even within RIOT are defined to the same value. All flag definitions should be moved to thread_flags.h and added to the THREAD_FLAG_PREDEFINED_MASK macro.

Flags to add to THREAD_FLAG_PREDEFINED_MASK (found with git grep THREAD_FLAG | grep "#define"):

  • cpu/kinetis/periph/i2c.c:#define THREAD_FLAG_KINETIS_I2C (1u << 8)
  • drivers/kw41zrf/kw41zrf_netdev.c:#define KW41ZRF_THREAD_FLAG_ISR (1u << 8)
  • pkg/lvgl/contrib/lvgl.c:#define LVGL_THREAD_FLAG (1 << 7)
  • pkg/lwip/contrib/netdev/lwip_netdev.c:#define THREAD_FLAG_LWIP_TX_DONE (1U << 11)
  • sys/include/event.h:#define THREAD_FLAG_EVENT (0x1) - Move event thread flag #20868
  • sys/include/usb/usbus.h:#define USBUS_THREAD_FLAG_USBDEV (0x02) /**< usbdev esr needs handling */
  • sys/include/usb/usbus.h:#define USBUS_THREAD_FLAG_USBDEV_EP (0x04) /**< One or more endpoints requires
  • sys/posix/include/sys/select.h:#define POSIX_SELECT_THREAD_FLAG (1U << 3)
  • tests/drivers/cst816s/main.c:#define CST816S_THREAD_FLAG (1 << 8)
  • tests/pkg/libschc/main.c:#define THREAD_FLAG_TX_END (1U << 4)

Versions

  • 2024.10-devel-190-g20f7328df4
@Enoch247 Enoch247 added the Community: good first issue This issue is good for newcomers to RIOT to be addressed / implemented label Sep 20, 2024
@mguetschow
Copy link
Contributor

Hum, any idea how we could convey the information that a flag is used only if the respective module is actually selected? Otherwise at some point we will end up having most if not all bits already in the predefined mask and the mask won't be useful anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community: good first issue This issue is good for newcomers to RIOT to be addressed / implemented
Projects
None yet
Development

No branches or pull requests

2 participants