RIOT icon indicating copy to clipboard operation
RIOT copied to clipboard

kinetis/bme: add bit_checkXX() functions

Open elenaf9 opened this issue 3 months ago • 4 comments

Contribution description

Add bit_checkXX functions for kinetis MCUs, analogous to the existing bit_clear and bit_set functions. A general bit_checkXX implementation was added with #16522 to sys/bit.h, and probably just forgotten for the kinetis override?

cc @benpicco.

Testing procedure

Unfortunately I don't have any kinetis-based boards with me. If someone has them and it is wanted, I can add some unitests for setting/clearing/ reading bits, analogous to the existing tests-bitfield test.

Issues/PRs references

Came up in #21577, which adds a first usage of bit_check (Murdock error).

elenaf9 avatar Sep 08 '25 09:09 elenaf9

Murdock results

:heavy_check_mark: PASSED

db2077f8a6c543319b6e9db8499df7c5ad45c974 sys/bit: document return values

Success Failures Total Runtime
10515 0 10516 09m:45s

Artifacts

riot-ci avatar Sep 08 '25 10:09 riot-ci

Is this not already covered by the CPU_HAS_BITBAND code path?

benpicco avatar Sep 08 '25 11:09 benpicco

Is this not already covered by the CPU_HAS_BITBAND code path?

No, because the whole bit.h module is gated by a #if !BITBAND_FUNCTIONS_PROVIDED, so that path is never entered for the kinetis MCUs that have BITBAND_FUNCTIONS_PROVIDED enabled.

elenaf9 avatar Sep 08 '25 11:09 elenaf9

Ah the Kinetis Bit Manipulation Engine is indeed different from the ARM bit-banding extension! I would have thought they'd just use the standard functionality under a different name.

benpicco avatar Sep 08 '25 12:09 benpicco