Driveline screen: boot into it, add engine torque, revise shaft scaling

Boot screen: land on the Driveline data screen instead of the SquareLine
gauges Home screen. Done in display_init after ui_init while the backlight is
still off (no flash of the wrong screen); Home stays reachable by swiping off
Driveline.

Engine torque added to the screen, decoded from 0x0A8 TORQ_AVL (available/
delivered torque), bits 12-23, signed x0.5 Nm. The user identified the ID and
supplied the spreadsheet formula (D2*256+D1)/32, which is algebraically
bits12-23 x0.5; confirmed against the repo's 0x0A8 worked example (24 Nm).
Firmware masks D1's low nibble (that's the alive counter, not torque - the
repo example shows ALIV=8 there) and sign-extends so overrun reads negative.
0x0AA TORQ_DVCH is the same layout but driver demand - identical at idle,
diverges under load - so the delivered value is the right one to show.

Output-shaft scaling revised: a direct Launch reference (output speed 128 rpm
at our raw 1192) implies ~0.107, contradicting the earlier x0.125 (which would
predict 149). One eyeballed cross-tool point, so nothing is adopted - the
field stays raw counts - but 0.125 is downgraded in firmware and wiki, and the
Launch now gives a direct rpm reference so calibration is just a multi-point
sweep and a linear fit.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-17 17:45:00 +02:00
parent 0b31c6f5f7
commit e10e03eb90
11 changed files with 99 additions and 427485 deletions
+8
View File
@@ -199,6 +199,14 @@ static bool parseCANMessage(const twai_message_t& message) {
}
break;
case CAN_ID_TORQUE_1:
// 0x0A8: TORQ_AVL — available/delivered engine torque.
if (dlc > CAN_BYTE_TORQUE_H) {
g_driveline.engine_torque_x10 = can_to_torque_x10(data);
parsed = true;
}
break;
case CAN_ID_TORQUE_3:
// 0x0AA: engine RPM + accelerator pedal.
if (dlc > CAN_BYTE_RPM_H) {