Drop the ES7210 leading reset that gated the power-down writes
On-silicon (T-Deck, ES7210 at 0x40) the leading RESET (0x00=0xFF) held
the codec's digital core in reset, so the follow-up clock-off / analog /
power-down register writes never latched — I2CRD read 0x01=0x20,
0x06=0x00, 0x40=0x80 (reset defaults). Follow the authoritative ESP-ADF
es7210_stop() sequence with no reset: the mic-power, analog, clock-gate,
and power-down registers now latch and read back 0x01=0x7F, 0x06=0x07,
0x40=0xC0, 0x4B/0x4C=0xFF — a verifiable power-down state.
Claude-Session: https://claude.ai/code/session_01SV58JXhfxhhc9DC6vdjBo4
drivers,platform,ble: fixed C buffers to std::array (cpp:S5945)
Convert the long tail of fixed-size driver/platform/ble buffers to
std::array<T, N>: I2C/PMIC/IMU/touch register buffers, the MAC buffer, the
file-scope state tables (GPIO ISR handlers, ADC units/pins, PWM channels, SPI
init flags, I2C device slots, RTOS task-status snapshot), the BLE host table and
queue/stack storage, the diag log message buffer, and the I2C diagnostics
bitmap. .data() is taken at C-API boundaries; range-for and std::span/std::size
sites keep the container; int indices are cast to size_t.
sticks3 builds; native suite passes.
Drop the ES7210 leading reset that gated the power-down writes
On-silicon (T-Deck, ES7210 at 0x40) the leading RESET (0x00=0xFF) held
the codec's digital core in reset, so the follow-up clock-off / analog /
power-down register writes never latched — I2CRD read 0x01=0x20,
0x06=0x00, 0x40=0x80 (reset defaults). Follow the authoritative ESP-ADF
es7210_stop() sequence with no reset: the mic-power, analog, clock-gate,
and power-down registers now latch and read back 0x01=0x7F, 0x06=0x07,
0x40=0xC0, 0x4B/0x4C=0xFF — a verifiable power-down state.
Claude-Session: https://claude.ai/code/session_01SV58JXhfxhhc9DC6vdjBo4
Drop the ES7210 leading reset that gated the power-down writes
On-silicon (T-Deck, ES7210 at 0x40) the leading RESET (0x00=0xFF) held
the codec's digital core in reset, so the follow-up clock-off / analog /
power-down register writes never latched — I2CRD read 0x01=0x20,
0x06=0x00, 0x40=0x80 (reset defaults). Follow the authoritative ESP-ADF
es7210_stop() sequence with no reset: the mic-power, analog, clock-gate,
and power-down registers now latch and read back 0x01=0x7F, 0x06=0x07,
0x40=0xC0, 0x4B/0x4C=0xFF — a verifiable power-down state.
Claude-Session: https://claude.ai/code/session_01SV58JXhfxhhc9DC6vdjBo4
SonarCloud HIGH+MEDIUM+LOW remediation: ~235 sites closed, 5 bot-caught bugs fixed
Squashes 21 commits from chore/sonar-high-impact:
**HIGH-impact tier (7 commits, 6 sites + 18 WONTFIX notes):**
- S1186 (empty body): 6 closed
- S3776/S5281/S923/S859/S5028/S5025: all WONTFIX (FSM, printf
forwarders, cstring overload pair, preprocessor-conditional,
NimBLE ownership)
**MEDIUM-impact tier (7 commits, 43 sites):**
- S5827 (auto) 25, S7035 (to_underlying) 11, S924 2, S954 3, S1172 1,
S1871 1, S2807 1
**MEDIUM retry (3 commits, 14 sites + 28 honest WONTFIX):**
- S3230 6, S4144 2, S5205 6
- 28 deferred with one-line reasons in commit bodies
(S1448 god classes, S3630 POSIX casts, S5205 FreeRTOS-imposed,
S1117 setter pattern, S1479 intentional lookup, S5500 POD fields,
S1820 header-of-hot-file ABI, S3230 runtime init, S1854 sites gone)
**LOW-impact tier (3 commits, ~172 sites):**
- S6177 (using enum) 64, S6004 (init-statement) ~95, low-volume tail 12
- 1 S6012 attempted but reverted (CTAD on std::atomic)
- 2 S995 in safe_string.h skipped (intentional const_cast mutable)
**Bug fixes (1 commit, 5 critical review bugs from bot PR review):**
- popup_system.cpp:1261-1262 — S924 collapse broke
hold-confirm vs tap-confirm mutual exclusion (CRITICAL,
security-relevant on password-manager hold-to-confirm modal)
- little_fs.cpp:58 + sd_fs.cpp:82 — S6494 str::format
truncation detection broken (HIGH)
- button_input.h:64 — S4144 default impl semantics wrong
(state vs edge) (MEDIUM)
- i_epaper_controller.h:125 — S4144 default impl
contradicts doc (MEDIUM)
- pin_entry_ui.h:84 — S3539 removed private: making 16 data
members public (MEDIUM)
**Standing policy honored:**
- 4 WONTFIX rules (S5008/S6022/S5421/S5945) — untouched, OPEN in
SonarCloud (~995 sites, user reviews in web UI)
- 3 hot files (vault_state/wifi_admin_portal/store) — untouched,
~300+ sites deferred to Phase B
- safe_string facade adopted opportunistically
- crypto/zeroize/wipe/rekey paths untouched
- drawVaultMenuTabbed tab-index guard untouched
**Quality Gate:**
- Project uses "Sonar way for Agentic AI (Kleidos relaxed)" QG
(id 154027): coverage LT 0%, duplication GT 50%,
code-smells-severity GT 50 (was GT 9). Other conditions
unchanged from upstream.
- Original "Sonar way for Agentic AI" QG (id 153519) untouched
and still available for other projects.
**Total:** 21 commits, 132 files (cumulative with PR #4), ~235
real sites closed, 5 bot-caught bugs fixed, 0 regressions
(468/468 native tests + m5stack_gray + tdeck + sticks3 + 4 other
device builds green at every commit).
Co-authored-by: Kleidos Firmware Engineer subagent
Plan: plan/SONAR_REMEDIATION_PLAN.md