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
+11 -3
View File
@@ -67,6 +67,11 @@ typedef struct {
// DRIVELINE STATE
// ============================================================================
// Where driveline_t.ignition_on came from (see the field's comment).
#define IGN_SRC_NONE 0 // no frame seen yet
#define IGN_SRC_3B4 1 // 0x3B4 byte 2 nibble, seen within the last IGN_3B4_HOLD_MS
#define IGN_SRC_LEVER 2 // 0x1D2 byte 0: lever code valid = on, 0xF0 = off
/**
* Decoded driveline speeds. Deliberately NOT part of automotive_data_t: that
* struct is the wire format for the UART link to Inst. Cluster, and widening it
@@ -90,9 +95,12 @@ typedef struct {
uint8_t converter_clutch; // 0x0BA ST_CCLT (CCLT_* constants). When CLOSED,
// turbine_rpm == engine_rpm by design — read this
// before interpreting the two as a slip ratio.
bool ignition_on; // 0x3B4 byte 2 low nibble. This bus's only
// ignition/terminal signal — CAS (0x130) is not
// present in the swap.
bool ignition_on; // Terminal 15. From 0x3B4 byte 2 low nibble when
// that frame is on the bus (Patrol 1); otherwise
// from the 0x1D2 lever byte: a recognised P/R/N/D
// code means key on, 0xF0 means key off (Patrol 2
// has no 0x3B4 at all - captures 2026-10-18).
uint8_t ignition_src; // IGN_SRC_* : which of the two decided ignition_on
uint8_t lever; // 0x1D2 byte 0 as gear_position_t: the selected
// detent (P/R/N/D). GEAR_UNKNOWN before first frame.
uint8_t engaged_gear; // 0x1D2 byte 1: gear the box is actually in, 1..6;