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
+6
View File
@@ -5,6 +5,7 @@
#include "display_init.h"
#include "display/lvgl_v8_port.h"
#include "ui/ui.h"
#include "driveline_screen.h"
namespace DisplayInit {
@@ -71,6 +72,11 @@ DisplayObjects init() {
lvgl_port_lock(-1);
ui_init(); // Initialize the SquareLine Studio generated UI
// Note: onSelectSSID event handler is registered in ui_Settings_Screen.c
// Override the boot screen: land on the Driveline data screen, not the
// gauges Home screen. ui_init() loaded Home; swap to Driveline while the
// backlight is still off so there's no visible flash of the wrong screen.
// Home stays reachable by swiping off the Driveline screen.
DrivelineScreen::show();
lvgl_port_unlock();
Serial.println("[DisplayInit] Step 13: SquareLine UI loaded successfully!");