feat(util): opt-in MMWHAL_CRITICAL_SECTION_NOOP for critical-section IRQ masking #125

Merged
hoogv merged 1 commit from feat/124-critical-section-noop into dev 2026-07-23 23:06:06 +00:00
Owner

Closes #124.

Adds an opt-in MMWHAL_CRITICAL_SECTION_NOOP define (via hal_config_mss.h, same customization path as ENABLE_<X>_MODULE) that turns MMWHAL_DISABLE_IRQ()/MMWHAL_ENABLE_IRQ() into no-ops. Default (unset) behavior is unchanged for every existing consumer -- see issue #124 for the real-hardware failure this addresses for projects that never enable an interrupt source.

Also reformats hal/util/mmwhal_types.h (pre-existing clang-format debt, unrelated to this change -- brought in line with extern "C" indentation already used by every other module header in this repo, e.g. hal_gpio.h/hal_pinmux.h).

Local verification:

  • ctest: 403/403 passing (clean full rebuild)
  • MISRA (tools/misra/run_misra.sh): 0 findings
  • clang-format --dry-run --Werror: clean

PR_Size/S

Closes #124. Adds an opt-in `MMWHAL_CRITICAL_SECTION_NOOP` define (via `hal_config_mss.h`, same customization path as `ENABLE_<X>_MODULE`) that turns `MMWHAL_DISABLE_IRQ()`/`MMWHAL_ENABLE_IRQ()` into no-ops. Default (unset) behavior is unchanged for every existing consumer -- see issue #124 for the real-hardware failure this addresses for projects that never enable an interrupt source. Also reformats `hal/util/mmwhal_types.h` (pre-existing clang-format debt, unrelated to this change -- brought in line with `extern "C"` indentation already used by every other module header in this repo, e.g. `hal_gpio.h`/`hal_pinmux.h`). Local verification: - `ctest`: 403/403 passing (clean full rebuild) - MISRA (`tools/misra/run_misra.sh`): 0 findings - `clang-format --dry-run --Werror`: clean PR_Size/S
feat(util): opt-in MMWHAL_CRITICAL_SECTION_NOOP for critical-section IRQ masking
All checks were successful
lint / clang-format (pull_request) Successful in 10s
tests / host-tests (pull_request) Successful in 46s
lint / clang-format (push) Successful in 11s
lint / misra (pull_request) Successful in 1m14s
tests / host-tests (push) Successful in 46s
lint / misra (push) Successful in 1m14s
2a874e2234
mmwhal_enter_critical()/mmwhal_exit_critical() unconditionally
re-enable IRQ once nesting unwinds to 0, regardless of the caller's
actual prior IRQ state. hal_gpio_pin_init() takes one such section.
For a project that never enables an interrupt source and installs no
real interrupt handling, the moment IRQ gets unmasked and anything
triggers one, the CPU can silently trap forever in that project's own
unhandled-IRQ vector -- confirmed on real AWR6843AOP hardware bringing
up a downstream consumer project.

Not a default-behavior change: adds an opt-in define, same
customization path as ENABLE_<X>_MODULE, for projects that can state
up front they never enable an interrupt source anywhere. Every
existing consumer's behavior is unchanged.

Fixes #124
hoogv deleted branch feat/124-critical-section-noop 2026-07-23 23:06:06 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
opendutchsolutions.public/hal_awr6843!125
No description provided.