Skip to content

refactor(variants): cut E2a, GPS globals of 36 variants defined once - #59

Merged
marcelverdult merged 3 commits into
integrationfrom
claude/build-cut-e2a-aa37bf
Nov 10, 2026
Merged

marcelverdult merged 3 commits into
integrationfrom
claude/build-cut-e2a-aa37bf

Conversation

@marcelverdult

Copy link
Copy Markdown
Owner

Cut E2a of step 11, as planned in docs/refactoring/0011-variant-target.md (section on cut E2 after upstream meshcore-dev#3753).

The GPS driver, the location provider and the sensor manager of 36 variants (shapes A and A') are now defined once in src/helpers/VariantTarget.cpp. Each of these variants drops the block from its target.cpp and gets one line #define SENSORS_TARGET_GLOBALS in its target.h. The type of sensors comes from target.h via decltype(sensors).

Diff: 36 target.cpp and 36 target.h, VariantTarget.cpp, plus 0011, README and the size table. 308 lines leave the target.cpp files (249 GPS block, 35 includes no longer needed, 24 blank lines).

Checks

  • Builds before (3dd444a) and after, 128 environments of the 36 variants: 127 link in both trees. ThinkNode_M5_companion_radio_serial fails to compile in both trees (D6/D7 undeclared, set in variants/thinknode_m5/platformio.ini, which this PR does not touch). Station_G2_companion_radio_ble and Station_G3_ESP32_companion_radio_ble are 1.9 % over the flash partition in both trees alike.
  • Sizes in docs/refactoring/cut-e2a-sizes-20261110.tsv: flash delta from -944 to +168 bytes, RAM delta 0 or 8 bytes.
  • The cause of the flash delta was measured on Heltec_t114_repeater only (nm -S, -800 bytes): no symbol is added or removed, the linker keeps another copy of some inline functions. The +156 to +168 bytes on heltec_v4_tft_* were not measured separately.
  • Init order: disassembly of Heltec_t114_repeater, Heltec_v3_repeater and one LilyGo_T-Echo_Card environment. The GPS driver's pin calls keep their order among themselves. The display and button constructors now run before them; according to the disassembly they write no pin.
  • Host tests: 28 native environments, 2446 cases passed, 0 failed.

Not verified

@marcelverdult
marcelverdult merged commit c1bb8bc into integration Nov 10, 2026
1 check passed
@marcelverdult
marcelverdult deleted the claude/build-cut-e2a-aa37bf branch November 10, 2026 22:54
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.

1 participant