Skip to content

Fix mini-epaper-s3 build: resolve SensorLib isBitSet macro conflict with SparkFun MMC5983MA#10584

Merged
thebentern merged 2 commits into
developfrom
copilot/fix-build-esp32s3-job
May 30, 2026
Merged

Fix mini-epaper-s3 build: resolve SensorLib isBitSet macro conflict with SparkFun MMC5983MA#10584
thebentern merged 2 commits into
developfrom
copilot/fix-build-esp32s3-job

Conversation

Copilot AI commented May 30, 2026

Copy link
Copy Markdown
Contributor

The build (mini-epaper-s3, esp32s3) CI job was failing because SensorLib v0.3.4 defines isBitSet as a C preprocessor macro in SensorLib.h, which collides with a class method of the same name in SparkFun_MMC5983MA_IO.h. When both libraries appear in lib_deps, the macro expands inside the SparkFun class declaration, producing error: expected unqualified-id before 'const'.

Root Cause

The include chain configuration.hSensorRtcHelper.hpp → … → SensorLib.h puts the macro into scope before SparkFun_MMC5983MA_IO.h is processed:

// SensorLib.h (v0.3.4)
#ifndef isBitSet
#define isBitSet(value, bit)  (((value) & (1UL << (bit))) == (1UL << (bit)))
#endif

// SparkFun_MMC5983MA_IO.h — class method, broken by macro expansion above
bool isBitSet(const uint8_t registerAddress, const uint8_t bitMask);

Fix

Added #undef isBitSet inside the SensorRtcHelper.hpp conditional block in configuration.h, immediately after the include:

#if __has_include("SensorRtcHelper.hpp")
#include "SensorRtcHelper.hpp"
// SensorLib defines isBitSet as a macro; undefine it here to avoid conflicts
// with the SparkFun MMC5983MA library, which has a class method of the same name.
#ifdef isBitSet
#undef isBitSet
#endif
#endif

isBitSet is not used directly anywhere in the firmware source, so this is safe across all targets.

🤝 Attestations

  • I have tested that my proposed changes behave as described.
  • I have tested that my proposed changes do not cause any obvious regressions on the following devices:
    • Heltec (Lora32) V3
    • LilyGo T-Deck
    • LilyGo T-Beam
    • RAK WisBlock 4631
    • Seeed Studio T-1000E tracker card
    • Other (please specify below)

SensorLib 0.3.4 defines isBitSet as a C preprocessor macro in SensorLib.h,
which conflicts with SparkFun_MMC5983MA_IO.h's class method of the same name.
When both libraries are included in the same translation unit (e.g., via
configuration.h → SensorRtcHelper.hpp → SensorLib chain, alongside the
SparkFun MMC5983MA library in lib_deps), the macro expansion causes compile
errors like 'expected unqualified-id before const'.

Fix: undefine the isBitSet macro right after including SensorRtcHelper.hpp
in configuration.h, so it doesn't interfere with SparkFun's class method.
Copilot AI changed the title [WIP] Fix failing GitHub Actions job build-esp32s3 Fix mini-epaper-s3 build: resolve SensorLib isBitSet macro conflict with SparkFun MMC5983MA May 30, 2026
Copilot AI requested a review from thebentern May 30, 2026 13:15
@thebentern thebentern marked this pull request as ready for review May 30, 2026 13:24
@thebentern thebentern added the bugfix Pull request that fixes bugs label May 30, 2026
@thebentern thebentern merged commit cc9d433 into develop May 30, 2026
81 of 84 checks passed
@thebentern thebentern deleted the copilot/fix-build-esp32s3-job branch May 30, 2026 13:59
thebentern pushed a commit that referenced this pull request May 30, 2026
… with SparkFun MMC5983MA (#10584)

* Initial plan

* Fix SensorLib isBitSet macro conflict with SparkFun MMC5983MA library

SensorLib 0.3.4 defines isBitSet as a C preprocessor macro in SensorLib.h,
which conflicts with SparkFun_MMC5983MA_IO.h's class method of the same name.
When both libraries are included in the same translation unit (e.g., via
configuration.h → SensorRtcHelper.hpp → SensorLib chain, alongside the
SparkFun MMC5983MA library in lib_deps), the macro expansion causes compile
errors like 'expected unqualified-id before const'.

Fix: undefine the isBitSet macro right after including SensorRtcHelper.hpp
in configuration.h, so it doesn't interfere with SparkFun's class method.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Evil8it pushed a commit to Evil8it/ME4TACTNK that referenced this pull request Jun 10, 2026
… with SparkFun MMC5983MA (meshtastic#10584)

* Initial plan

* Fix SensorLib isBitSet macro conflict with SparkFun MMC5983MA library

SensorLib 0.3.4 defines isBitSet as a C preprocessor macro in SensorLib.h,
which conflicts with SparkFun_MMC5983MA_IO.h's class method of the same name.
When both libraries are included in the same translation unit (e.g., via
configuration.h → SensorRtcHelper.hpp → SensorLib chain, alongside the
SparkFun MMC5983MA library in lib_deps), the macro expansion causes compile
errors like 'expected unqualified-id before const'.

Fix: undefine the isBitSet macro right after including SensorRtcHelper.hpp
in configuration.h, so it doesn't interfere with SparkFun's class method.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
raghumad pushed a commit to raghumad/mezulla-firmware that referenced this pull request Jun 25, 2026
… with SparkFun MMC5983MA (meshtastic#10584)

* Initial plan

* Fix SensorLib isBitSet macro conflict with SparkFun MMC5983MA library

SensorLib 0.3.4 defines isBitSet as a C preprocessor macro in SensorLib.h,
which conflicts with SparkFun_MMC5983MA_IO.h's class method of the same name.
When both libraries are included in the same translation unit (e.g., via
configuration.h → SensorRtcHelper.hpp → SensorLib chain, alongside the
SparkFun MMC5983MA library in lib_deps), the macro expansion causes compile
errors like 'expected unqualified-id before const'.

Fix: undefine the isBitSet macro right after including SensorRtcHelper.hpp
in configuration.h, so it doesn't interfere with SparkFun's class method.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Pull request that fixes bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants