Skip to content

refactor(#273): E4 band 3d -- oled, display, ui_state and touch leave src.ino - #278

Merged
Strycher merged 1 commit into
mainfrom
fc/212-e4-display
Sep 7, 2026
Merged

Strycher merged 1 commit into
mainfrom
fc/212-e4-display

Conversation

@Strycher

@Strycher Strycher commented Sep 7, 2026

Copy link
Copy Markdown
Owner

E4 band 3d, task #273 under #264 and Epic #212. Opened autonomously under the owner's standing grant of 2026-09-07.

What moved

oled (3 functions), display (6), touch (2) and a state-only ui_state; seven cut-set variables leave src.ino (5,805 → 5,581 lines). After this, every cut-set variable of #264 except webServer and wifiConnected is defined in a unit; those two go with the web unit in #274. Full composition in docs/god-object-inventory.md §13.

Calls made under the grant — please review

  1. ui_state carries state and no functions. Reading the code answered E4-5d (band 3): oled, display and ui_state units #273's open question: navigateScreen indexes a static table of the LVGL screen objects (compassScr, geocacheScr, …) that the screen builders own, and navigateToSettings loads settingsScr. Moving the navigate functions now would mean declaring those screen objects in a header while they stay in src.ino — the reach-back the ruling forbids. The state moves now; the functions join the unit in band 4 when the screens do.
  2. ui_state also takes selectedCacheIndex and listScrollOffset (left by 3c): the web handlers read both, so they have to be published before E4-5e (band 3): the web unit, last #274.
  3. A touch unit that E4-5d (band 3): oled, display and ui_state units #273 did not list: handleWebDiags reads touchAvailable, which had no unit. Two functions, two variables; lvglTouchReadCb, the LVGL input driver, stays for band 4.
  4. The RGB565 COLOR_* palette went to display.h: initTFT and the boot screen in setup() use it.

Proof

scripts/verify_extraction.py PASS; full output in §13:

symbols   589 -> 592: three static initialisers (oled 50, tft 35, ctp 14; src.ino's shrank 80)
          29 relocated; 3 linkage changes declared; removed none
deltas    12 symbols, net -88, all attributed; unexplained none
moved     11 functions checked by reference set: every reference kept, 4 now cross-TU
sections  .flash.text +24 (inputs +16), .flash.rodata +20, RAM unchanged
Flash     1,856,590 -> 1,856,634   Both toolchains build. 58 tests pass. Not flashed.

… src.ino

Four units:

  src/oled.{h,cpp}      oled, oledAvailable, oledSleeping; DEBUG_SLEEP;
                        initOLED, sleepOLED, wakeOLED
  src/display.{h,cpp}   tft, tftSleeping, lastActivityTime, lastTFTReinit,
                        tftUpdateCount, lastTFTUpdate; TFT_REINIT_INTERVAL,
                        DEBUG_TFT, the sleep-timeout defaults, TFT_BL_PWM, the
                        RGB565 COLOR_* palette; initTFT, checkTFTHealth,
                        sleepTFT, wakeTFT, wakeAllDisplays, checkDisplaySleep
  src/ui_state.{h,cpp}  currentScreen, previousScreen, settingsSubScreen,
                        geocacheSubScreen, selectedCacheIndex, listScrollOffset;
                        NUM_SCREENS and the SCREEN_* defines. State only: the
                        navigate functions index the LVGL screen objects the
                        screen builders own, so they follow in band 4
  src/touch.{h,cpp}     ctp, touchAvailable; initTouch, touchISR
  src/fc_config.h       + CTP_INT

Seven cut-set variables leave src.ino (5,805 -> 5,581 lines). Every cut-set
variable of #264 except webServer and wifiConnected is now defined in a unit.

Harness: declarator lists and initialisers are parsed with one bracket- and
string-aware walker (a constructor call with commas, and a string initialiser
with commas, each broke the 3b version -- the second latently); the first
declarator on a line is named too.

Verified by scripts/verify_extraction.py, PASS: 589 -> 592 symbols (three
static initialisers, 99 bytes; src.ino's shrank 80), 29 relocated, 3 linkage
changes declared, 12 size deltas net -88 all attributed, 11 moved functions
checked by reference set, unexplained none. .flash.text +24 (inputs +16),
.flash.rodata +20, RAM unchanged. Flash 1,856,590 -> 1,856,634. Both
toolchains build. 58 tests pass. Record: section 13 of
docs/god-object-inventory.md.
@Strycher

Strycher commented Sep 7, 2026

Copy link
Copy Markdown
Owner Author

Merged autonomously under the owner's standing grant of 2026-09-07.

Gate: compile-gate green. Proof: scripts/verify_extraction.py PASS — 589 -> 592 symbols (three static initialisers, named), 29 relocated, 3 linkage changes declared, 12 size deltas attributed, all 11 moved functions checked by reference set, unexplained none. Both toolchains build; 58 tests pass. Not flashed.

Set aside for the owner's review, in the PR body: ui_state as a state-only unit until band 4 moves the screens, the extra touch unit, and the palette's new home.

@Strycher
Strycher merged commit 7bfefa7 into main Sep 7, 2026
4 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.

1 participant