Link protocol v2, ESP-NOW leg, gauge tunables + tuning screen; remove Home screen

Protocol v2 (shared header, byte-identical with the 1.3 repo):
- typed DATA/CONFIG frames: 0xAA | ver | type | len | payload | XOR | 0x55
- gear split into lever (P/R/N/D/S/M) + target/engaged nibbles, engine rpm,
  alert bitmap decided here from tunable thresholds, link_config_t tunables
- docs/UART_PROTOCOL.md rewritten for v2

Controller A modules:
- tunables: gauge calibration + alert thresholds in NVS, 'cfg' serial console,
  bench override (never persisted)
- espnow_link: every frame also broadcast on ESP-NOW ch 1; radio stays in STA
  (WiFiManager no longer powers it off)
- uart_manager: DATA at 5 Hz + CONFIG on change/5 s on both transports
- can_driver: publishes gear pieces and rpm, evaluates alerts
- tuning_screen: hand-coded Gauge Tuning page (swipe right from Driveline),
  -/+ rows, enable switches, override sliders, Driveline/Defaults buttons

UI: SquareLine Home screen (3 meters + battery) and meters_manager removed;
Driveline is the boot screen; Settings back-gesture calls app_show_driveline().

tools/fix_penv_deps.ps1: repairs the shared PlatformIO penv after a 1.3 build.
Bench-verified with Controller B: both transports alive, dedupe, override
rpm 2000 -> 133.3 Hz tach output.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-09-21 19:12:31 +02:00
parent a8f68ebc27
commit f60bdac268
33 changed files with 1743 additions and 2266 deletions
+6 -11
View File
@@ -9,9 +9,12 @@
* SquareLine Studio owns include/ui/ and overwrites it on every export. Editing
* generated files loses the edit — that is exactly how the CAN toggle's event
* handler went missing. This screen lives entirely in src/, which SquareLine
* never touches, so it cannot be clobbered. It is reached by a right-swipe
* gesture attached to the Home screen AT RUNTIME (see attachHomeGesture) rather
* than by editing ui_Home_Screen.c, for the same reason.
* never touches, so it cannot be clobbered. Since 2026-09-21 it IS the boot
* screen: the SquareLine Home screen was removed, and the generated Settings
* screen's back gesture calls app_show_driveline() (defined at the bottom of
* driveline_screen.cpp) to return here.
*
* Navigation: swipe LEFT -> Settings (SquareLine), swipe RIGHT -> Gauge Tuning.
*
* Signals deliberately NOT shown: engine oil temp (no sensor on this M57N —
* 0x1D0 byte 1 is permanently 0xFF) and battery voltage (0x3B4 publishes the
@@ -38,12 +41,4 @@ void show();
*/
void tick();
/**
* @brief Attach a right-swipe handler to the Home screen so this screen is
* reachable, without touching the SquareLine-generated Home screen code.
* Safe to call every loop — re-attaches only when the Home screen
* instance changes. Takes its own LVGL lock.
*/
void attachHomeGesture();
} // namespace DrivelineScreen