diff --git a/include/param_prj.h b/include/param_prj.h index d35551a..646a4ff 100644 --- a/include/param_prj.h +++ b/include/param_prj.h @@ -129,7 +129,7 @@ // SKUDAK customization suffix: bump on every Skudak-side change so the OpenInverter // web UI shows a distinct version (e.g. "4=1.20.R-S4") and we can visually confirm // the right firmware is flashed. Match the stm32-sine -S convention. -#define VERSTR STRINGIFY(4=VER-S5) +#define VERSTR STRINGIFY(4=VER-S6) /***** enums ******/ diff --git a/src/main.cpp b/src/main.cpp index 790efe8..7d490d6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -114,10 +114,22 @@ static void MapChargerMessages() float dummyGain; bool dummyrx; - //check sample value, if it is mapped assume valid CAN map - if (canMap->FindMap(Param::hwaclim, dummyId, dummyOfs, dummyLen, dummyGain, dummyAdd, dummyrx)) return; + // SKUDAK: tmpobcmax is the canary for the -S5+ CAN-map schema. If it's + // already mapped, the persistent flash map was built by a firmware that + // included the full current set of mappings (including the OBC temp + // aggregate and all c1*/c2*/c3* receives) — return early so user + // customizations are preserved. + // + // If tmpobcmax is NOT mapped, the saved map is from an older firmware + // that didn't know about it. We must wipe and rebuild from current + // chargercan.cpp — without this the OpenInverter single-shot MapMessages() + // pattern silently leaves newer params un-mapped on every subsequent + // boot, even after flashing fresh firmware (the original guard keyed off + // hwaclim, which has existed since the very first version — so it always + // short-circuited on upgrade and the new entries were dead code). + if (canMap->FindMap(Param::tmpobcmax, dummyId, dummyOfs, dummyLen, dummyGain, dummyAdd, dummyrx)) return; - //canMap->Clear(); + canMap->Clear(); ChargerCAN::MapMessages(canMap);