Gear decode VERIFIED: real 0x1D2 map in firmware + wiki

The gear lever is fully decoded and confirmed on the actual swap bus
(raw/gear_box_can_revealings.csv): 0x1D2 byte0 = P 0xE1 / R 0xD2 / N 0xB4 /
D 0x78, matching the documented BMW codes exactly. Byte4 splits D vs S/M
(0xF0 auto) and carries manual +/- shifts.

Firmware:
- automotive_data.h: replace placeholder gear map (0x1001) with CAN_ID_GEAR_LEVER
  0x1D2, verified byte-0 codes, byte-4 mode define, and can_to_gear_lever().
- can_driver.cpp: decode 0x1D2 byte0 into gear_position via the enum; reject
  unrecognized codes instead of copying the raw byte.
- Scope: P/R/N/D only (verified). S/M shows as D for now (no enum slot; engaged
  gear number needs a drive capture) — TODO'd, not faked. Coolant/oil/battery
  left as flagged placeholders pending a cold-start capture.

Wiki:
- New source page gear-box-can-revealings + raw CSV filed.
- can-id-candidates: 0x1D2 gear row -> VERIFIED; encoding "dispute" section
  rewritten with the full lever+mode decode table.
- Updated index + log.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-16 14:54:06 +02:00
parent 87801c593c
commit 0a58afca9a
7 changed files with 119 additions and 20 deletions
+11
View File
@@ -0,0 +1,11 @@
ADDR,LEN,D0,D1,D2,D3,D4,D5,D6,D7,Position
0BA,8,3,255,15,0,0,,,239,P
0BA,8,2,132,1,0,0,,,207,R
0BA,8,1,255,15,0,0,,,223,N
0BA,8,5,220,1,0,0,,,207,D
0BA,8,5,220,1,0,0,,,207,M/S
1D2,6,225,15,255,,240,255,,,P
1D2,6,210,15,255,,240,255,,,R
1D2,6,180,15,255,,240,255,,,N
1D2,6,120,95,255,,240,255,,,D
1D2,6,120,95,255,,241,255,,,M/S
1 ADDR LEN D0 D1 D2 D3 D4 D5 D6 D7 Position
2 0BA 8 3 255 15 0 0 239 P
3 0BA 8 2 132 1 0 0 207 R
4 0BA 8 1 255 15 0 0 223 N
5 0BA 8 5 220 1 0 0 207 D
6 0BA 8 5 220 1 0 0 207 M/S
7 1D2 6 225 15 255 240 255 P
8 1D2 6 210 15 255 240 255 R
9 1D2 6 180 15 255 240 255 N
10 1D2 6 120 95 255 240 255 D
11 1D2 6 120 95 255 241 255 M/S