Reverse lights on DO0, Sport + Vehicle screens, per-DDE live data, ECU identification
Firmware / build (push) Successful in 10m49s

- ReverseLight: isolated output DO0 (CH422G OC0 -> PC817 -> NPN sink) drives the
  reverse-lamp relay while the lever is in R on a live bus with ignition on; 10 Hz
  decision confirmed over 200 ms, written through the panel library's expander
  object so the backlight cannot undo it; `reverse status|on|off|force` console,
  default ON (NVS `revlight_en`). Wiki page reverse-lights-output with the wiring.
- Sport screen: BMW-style power + torque gauges (lv_meter on a dial-face image,
  image needle); PNG sources in assets/, tools/png2lvgl.py converter.
- Vehicle: final drive ratio + tyre circumference -> road speed, hp from torque;
  Settings > Vehicle page; `vehicle` console.
- Bench simulation (`sim` console) overlays torque / rpm / shaft on the snapshot.
- EcuIdent: KWP 1A 86 / 1A 80 read once, stored in NVS, shown on Settings >
  Vehicle, passive ECU CHANGED? check; `ecu` console.
- Ignition fallback from the 0x1D2 lever byte on buses without 0x3B4 (Patrol 2).
- Engine data: per-DDE `2C 10` identifier profiles (Patrol 1 vs Patrol 2
  rail 00C2 / boost 003A / battery 002F); DiagProbe liveConfigure().
- Wiki: Patrol 2 captures, vehicles page, obd identifier table per DDE, logs.
This commit is contained in:
2026-10-28 16:46:42 +01:00
parent 8ded9c2a08
commit 1cba9f30bc
60 changed files with 70386 additions and 100 deletions
+15
View File
@@ -21,6 +21,7 @@ static const char* NVS_KEY_DEBUG_ENABLED = "debug_en";
static const char* NVS_KEY_CAN_ENABLED = "can_en";
static const char* NVS_KEY_DIFFLOCK_ENABLED = "difflock_en";
static const char* NVS_KEY_DIFFLOCK_INVERT = "difflock_inv";
static const char* NVS_KEY_REVLIGHT_ENABLED = "revlight_en";
// ============================================================================
// PUBLIC API IMPLEMENTATION
@@ -119,4 +120,18 @@ bool loadDiffLockInvert() {
return inverted;
}
void saveReverseLightState(bool enabled) {
preferences.begin(NVS_NAMESPACE, false); // read-write mode
preferences.putBool(NVS_KEY_REVLIGHT_ENABLED, enabled);
preferences.end();
Serial.printf("[SettingsManager] Saved ReverseLight state = %s\n", enabled ? "ON" : "OFF");
}
bool loadReverseLightState() {
preferences.begin(NVS_NAMESPACE, true); // read-only mode
bool enabled = preferences.getBool(NVS_KEY_REVLIGHT_ENABLED, true); // default: ON (an unwired DO0 is harmless)
preferences.end();
return enabled;
}
} // namespace SettingsManager