Skip to content

E4-1: name the five anonymous structs and remove the write-only touchDetected #260

Closed

Description

@Strycher

Epic: #212

Declaration-only. No call site changes. Behaviour-neutral by construction, proven by symbol-set comparison (nm --print-size --defined-only before and after: identical set, sizes and types apart from the one deliberate removal).

Name the five anonymous single-instance structs so they can be declared extern from other translation units. extern cannot name a variable of anonymous struct type, and four of the five are in the cut set (inventory, section 5):

src/src.ino:463  } gpsData;       -> struct GpsData
src/src.ino:490  } imuData;       -> struct ImuData
src/src.ino:573  } shtData;       -> struct ShtData
src/src.ino:585  } envData;       -> struct EnvData
src/src.ino:607  } weatherTrend;  -> struct WeatherTrend

The file already names six other structs (FRAMHeader, GeocacheEntry, TZPreset, WeatherReading and others), so this is house style, not a new convention.

Remove touchDetected (src.ino:269, written at :1039 in touchISR(), never read). The one dead variable in the file, confirmed by relocation analysis after correcting the ISR-section attribution.

Acceptance

  • pio run -e feather_s3 succeeds; arduino-cli compile still succeeds while B7: Epic B integration test — PlatformIO build on hardware #161 is open
  • nm symbol set identical before and after except touchDetected gone; sizes and types identical
  • python scripts/symbol-inventory.py reports 96 external-linkage variables (was 97)
  • Hardware verification per FC rules, or the owner accepts the nm proof as sufficient for a declaration-only change. That is the owner's call and is recorded on this issue either way

Evidence: docs/god-object-inventory.md. Regenerate the figures with python scripts/reference-graph.py --appendix.

Activity

  1. added and removed
    board:readyBoard sync: Ready column
    on Sep 7, 2026
  2. Strycher commented on Sep 7, 2026

    @Strycher
    OwnerAuthor

    PR #266 is green (c087b06): discover, tests, build (feather_s3), compile-gate all SUCCESS; MERGEABLE/CLEAN.

    Acceptance, item by item

    criterion evidence
    pio run -e feather_s3 succeeds local SUCCESS 41.85 s; CI SUCCESS
    arduino-cli compile still succeeds while #161 is open SUCCESS, 1,787,706 program / 106,372 RAM
    nm set identical except touchDetected; sizes and types identical 573 → 572; removed: touchDetected only; added: none. touchISR T 16 → T 5 (the store went with the flag). Five structs: sizes unchanged, linkage b/d → B/D — see below
    symbol-inventory.py reports 96 external-linkage 96 (was 97)
    hardware verification, or owner accepts the nm proof open — the owner's call, below

    Size, reconciled across three toolchains

    environment before after delta
    PlatformIO, local, same day 1,855,974 1,855,962 −12
    PlatformIO, CI, vs #221 baseline 1,856,502 1,856,538 +36
    arduino-cli, vs manifest baseline 1,787,670 1,787,706 +36

    The two +36 figures are against pre-migration baselines. The migration replaced six credential literals with longer placeholders — "tsunami" → "REDACTED_SSID_1" and so on — which is +48 bytes of .rodata. +48 from the migration, −12 from this change, +36 net. All three environments agree, and the same-day like-for-like measurement is the −12.

    The linkage flip is the mechanism, measured

    The five named variables went from local (b/d) to global (B/D) in nm. A variable of unnamed type has internal linkage in C++; the linker had them TU-private all along despite plain names. That is why extern could not name them, and the letter flipping is the proof that naming fixed it. Recorded in §5 of the inventory document in this PR, as a correction to the document's own classification.

    Decision needed

    This change moves no logic — the only code that changed is one store in an ISR whose result was never read. Per the acceptance criterion as written: do you accept the nm proof as sufficient for a declaration-only change, or do you want a flash-and-observe before merge? If the latter, note main cannot join WiFi until #99, so it means a flash with a local credential edit and a check that the device boots, reads sensors, and touch still responds (the ISR is empty; the interrupt is still attached; LVGL polls the controller regardless). Either answer is recorded here.

  3. Strycher commented on Sep 7, 2026

    @Strycher
    OwnerAuthor

    Owner decision, 2026-09-07: the nm proof is accepted as sufficient hardware verification for this declaration-only change. No flash-and-observe before merge. Recorded here per the acceptance criterion.

  4. added a commit that references this issue on Sep 7, 2026
  5. added
    board:doneBoard sync: Done column
    and removed on Sep 7, 2026
  6. added a commit that references this issue on Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions