Skip to content

event-groups: Fix multiple definitions #1307

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

Conversation

AhmedIsmail02
Copy link
Member

Description

This PR does the following:

  • Remove xEventGroupClearBitsFromISR and xEventGroupSetBitsFromISR functions direct mapping to xTimerPendFunctionCallFromISR in case the trace facility is feature not set. This should match the current implementation in which the application calling xEventGroupClearBitsFromISR without defining the trace macros (i.e. traceENTER_xEventGroupClearBitsFromISR is a blank function in this case) will end up calling xTimerPendFunctionCallFromISR function directly. This enhances the readability of the code by not guarding the xEventGroup<Set/Clear>BitsFromISR functions' declaration and definition based on the trace facility macro (i.e. configUSE_TRACE_FACILITY).

  • Refactor the guarding macros for MPU_xEventGroupClearBitsFromISR and MPU_xEventGroupSetBitsFromISR functions to match the change above.

The current implementation leads to redefinition warnings as event_groups.h redefines xEventGroupClearBitsFromISR and xEventGroupSetBitsFromISR based on configUSE_TRACE_FACILITY after they have been defined based on configUSE_MPU_WRAPPERS_V1 in mpu_wrappers.h. The implemented changes should resolve these warnings.

Test Steps

Checklist:

  • I have tested my changes. No regression in existing tests.
  • I have modified and/or added unit-tests to cover the code changes in this Pull Request.

Related Issue

This PR should address the FreeRTOS-Kernel-Bug!1296.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

This commit does the following:
* Remove xEventGroupClearBitsFromISR and
xEventGroupSetBitsFromISR functions direct mapping
to xTimerPendFunctionCallFromISR in case the trace
facility is feature not set. This should match the
current implementation in which the application calling
xEventGroupClearBitsFromISR
without defining the trace macros
(i.e. traceENTER_xEventGroupClearBitsFromISR is
a blank function in this case) will end up calling
xTimerPendFunctionCallFromISR function directly.
This enhances the readability of the code by not
guarding the xEventGroup<Set/Clear>BitsFromISR
functions' declaration and definition based on
the trace facility macro (i.e. configUSE_TRACE_FACILITY).

* Refactor the guarding macros for MPU_xEventGroupClearBitsFromISR
and MPU_xEventGroupSetBitsFromISR functions to match the
change above.

The current implementation leads to redefinition warnings
as `event_groups.h`redefines xEventGroupClearBitsFromISR
and xEventGroupSetBitsFromISR based on
`configUSE_TRACE_FACILITY' after they have been defined based
on configUSE_MPU_WRAPPERS_V1 in `mpu_wrappers.h`. The
implemented changes should resolve these warnings.

Signed-off-by: Ahmed Ismail <[email protected]>
@AhmedIsmail02 AhmedIsmail02 force-pushed the fix-multiple-definitions-of-xEventGroupSet/ClearBitsFromISR branch from c722e74 to 8cdf4e9 Compare August 14, 2025 10:40
Copy link

@kstribrnAmzn kstribrnAmzn merged commit 4394741 into FreeRTOS:main Aug 14, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants