From de2fceca7ced95307110aa3ca458496a18105d30 Mon Sep 17 00:00:00 2001 From: Jakub <106778416+MarekZegare4@users.noreply.github.com> Date: Tue, 8 Sep 2026 23:48:27 +0200 Subject: [PATCH] fix(companion): stop the FIRMWARE_VERSION fallback claiming a fixed version Same staleness bug as the build-date fallback: bypassing build.sh (a direct `pio run`, an IDE Build button, the sim) fell back to a hardcoded "v1.27-dev" literal that would silently keep claiming to BE v1.27 forever, even once development has moved well past it. build.sh/CI's real git-tag-derived FIRMWARE_VERSION is untouched -- only the bypass fallback changes, to a version-agnostic "dev-". Co-Authored-By: Claude Sonnet 5 --- examples/companion_radio/MyMesh.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/examples/companion_radio/MyMesh.h b/examples/companion_radio/MyMesh.h index 86f3f302..662fb688 100644 --- a/examples/companion_radio/MyMesh.h +++ b/examples/companion_radio/MyMesh.h @@ -11,16 +11,25 @@ class UITask; /*------------ Frame Protocol --------------*/ #define FIRMWARE_VER_CODE 13 +// Fallback only -- every real build (local or CI) goes through build.sh, which +// always injects its own FIRMWARE_BUILD_DATE (today's date at build time). +// __DATE__ is the compiler's own "Mmm dd yyyy" build-date macro, so a +// `pio run` invoked directly (bypassing build.sh -- e.g. an IDE's Build +// button) still shows the date it was actually compiled, instead of a +// hardcoded string that would otherwise go stale and never change again. #ifndef FIRMWARE_BUILD_DATE -#define FIRMWARE_BUILD_DATE "19 Aug 2026" +#define FIRMWARE_BUILD_DATE __DATE__ #endif // Fallback only -- every real build (local or CI) goes through build.sh, which // always injects FIRMWARE_VERSION itself (the pushed tag name for a release, // "dev-" otherwise; see build-solo-firmwares.yml). This default only -// shows up for a `pio run` invoked directly, bypassing build.sh entirely. +// shows up for a `pio run` invoked directly, bypassing build.sh entirely -- +// a plain "dev build" stamped with its compile date instead of a specific +// version number that would otherwise be hardcoded here and go stale (and +// misleadingly claim to BE that version) the moment development moves on. #ifndef FIRMWARE_VERSION -#define FIRMWARE_VERSION "v1.27-dev" +#define FIRMWARE_VERSION "dev-" __DATE__ #endif #if defined(NRF52_PLATFORM) || defined(STM32_PLATFORM)