From 4b33e3e5721893397024b4d218af32b662e0f09f Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 11 Nov 2026 16:34:02 +0000 Subject: [PATCH] fix: fail the build if the SDK renumbers a probed display controller The panel probe record in NVS keeps DisplayController as raw values. An SDK renumber would load a stale record into the wrong driver until the recovery chord. A static_assert pins the values the probe can store, so a renumber breaks the build and the fix is a RECORD_VERSION bump. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01QrEdpxLkuVrifx7ahhZV13 --- src/platform/PanelProbe.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/platform/PanelProbe.cpp b/src/platform/PanelProbe.cpp index b62d6a9a3..e8f1105e1 100644 --- a/src/platform/PanelProbe.cpp +++ b/src/platform/PanelProbe.cpp @@ -19,6 +19,14 @@ constexpr char NVS_NAMESPACE[] = "panel"; constexpr char NVS_KEY[] = "probe"; constexpr uint8_t RECORD_VERSION = 1; +// The record keeps controllers as raw enum values, so an SDK renumber would boot a +// stale record into the wrong driver. Pin the values the probe can store; if one +// fails, bump RECORD_VERSION (forces one re-probe) and update the pin. +using Controller = BoardConfig::DisplayController; +static_assert(static_cast(Controller::SSD1677) == 0 && static_cast(Controller::UC8253) == 2 && + static_cast(Controller::UC8279) == 6 && static_cast(Controller::UC8179) == 7, + "DisplayController renumbered: bump RECORD_VERSION"); + struct Record { uint8_t version; uint8_t board;