feat: broadcast worst-case OBC temperature on 0x211 byte 7
Build Firmware / Build stm32-teslacharger (pull_request) Successful in 59s
Build Firmware / Build stm32-teslacharger (pull_request) Successful in 59s
The Tesla OBC hardware already publishes 9 temperature probes (3
modules × {tmp1, tmp2, tmpin}) on CAN 0x237/0x239/0x23B which the
teslacharger receives as c[123]tmp[12,in]. Until now none of these
were forwarded downstream — the Polarity VCU's STATUS_SCREEN OBC-temp
and DCDC-temp fields rendered 0 °C on OI-OBC cars.
This commit:
- Adds Param::tmpobcmax — derived value computed each Ms100Task tick
as the max across the 9 probes, skipping any that read -40 °C
(sensor absent / module not present).
- Maps it to 0x211 byte 7 (previously reserved, the last unused byte
of the 7-byte frame). Wire encoding uses the Tesla OBC convention
of offset 40 (wire = °C + 40), matching c[123]tmp* upstream so
receivers can decode with the same formula.
- Bumps VERSTR to -S5 so the right firmware is visually confirmable
in the OpenInverter web UI.
The new byte is purely additive — existing 0x211 consumers that read
only bytes 0-6 continue to work unchanged.
The Polarity VCU's 0x211 RX handler grows a corresponding decode +
display path in a paired stm32-hal-vcu commit.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
+14
-11
@@ -108,16 +108,19 @@ void ChargerCAN::MapMessages(CanMap* can)
|
||||
can->AddRecv(Param::vcuchglim, 0x212, 0, 8, 1);
|
||||
|
||||
/***** SKUDAK VCU telemetry (0x211) — SKUDAK-448 expanded charger telemetry *****/
|
||||
// Byte 0: state (0=Off, 1=WaitStart, 2=Enable, 3=Activate, 4=Run, 5=Stop)
|
||||
// Bytes 1-2: udc (V, gain=1)
|
||||
// Bytes 3-4: idc (0.1A, gain=10)
|
||||
// Byte 5: uaux (decivolts, gain=10) — 12V aux battery rail
|
||||
// Byte 6: soc (%, gain=1)
|
||||
// Byte 7: reserved
|
||||
// Byte 0: state (0=Off, 1=WaitStart, 2=Enable, 3=Activate, 4=Run, 5=Stop)
|
||||
// Bytes 1-2: udc (V, gain=1)
|
||||
// Bytes 3-4: idc (0.1A, gain=10)
|
||||
// Byte 5: uaux (decivolts, gain=10) — 12V aux battery rail
|
||||
// Byte 6: soc (%, gain=1)
|
||||
// Byte 7: tmpobcmax (°C, gain=1, offset=-40) — worst-case across all
|
||||
// 9 OBC probes; matches Tesla OBC's own CAN offset
|
||||
// so receivers can decode with the same formula.
|
||||
// Consumed by stm32-hal-vcu Core/Src/main.c CHARGER_CAN_ID_OI_OBC_AUX handler.
|
||||
can->AddSend(Param::state, 0x211, 0, 8, 1);
|
||||
can->AddSend(Param::udc, 0x211, 8, 16, 1);
|
||||
can->AddSend(Param::idc, 0x211, 24, 16, 10);
|
||||
can->AddSend(Param::uaux, 0x211, 40, 8, 10);
|
||||
can->AddSend(Param::soc, 0x211, 48, 8, 1);
|
||||
can->AddSend(Param::state, 0x211, 0, 8, 1);
|
||||
can->AddSend(Param::udc, 0x211, 8, 16, 1);
|
||||
can->AddSend(Param::idc, 0x211, 24, 16, 10);
|
||||
can->AddSend(Param::uaux, 0x211, 40, 8, 10);
|
||||
can->AddSend(Param::soc, 0x211, 48, 8, 1);
|
||||
can->AddSend(Param::tmpobcmax, 0x211, 56, 8, 1, 40); // offset 40 → wire byte = temp + 40
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user