feat: dashboard-style telemetry output

Replace line-by-line telemetry dump with in-place dashboard showing:
- Status indicator (LIVE/STALE/NO SIGNAL)
- LINK: RSSI1, RSSI2, LQ, SNR, power, mode with color coding
- BATT: voltage, current, capacity, percentage
- IMU: pitch, roll, yaw in degrees
- MODE: flight mode name
- Frame counts footer

Add ATTITUDE (0x1E) and FLIGHT_MODE (0x21) telemetry parsing.
Dashboard redraws every 100ms with ANSI cursor control.
This commit is contained in:
2026-06-14 23:04:45 +02:00
parent d2331229eb
commit 1db5fdb374
3 changed files with 304 additions and 61 deletions
+23
View File
@@ -55,6 +55,29 @@ int cel_crsf_telemetry_parse(cel_crsf_frame const* frame,
return 0;
}
case CEL_CRSF_TYPE_ATTITUDE: {
if (len < 6) return -1;
out->type = CEL_TELEM_ATTITUDE;
/* Each value is int16 big-endian / 10000.0 = radians */
int16_t pitch = (int16_t)((p[0] << 8) | p[1]);
int16_t roll = (int16_t)((p[2] << 8) | p[3]);
int16_t yaw = (int16_t)((p[4] << 8) | p[5]);
out->data.attitude.pitch_rad = pitch / 10000.0f;
out->data.attitude.roll_rad = roll / 10000.0f;
out->data.attitude.yaw_rad = yaw / 10000.0f;
return 0;
}
case CEL_CRSF_TYPE_FLIGHT_MODE: {
if (len == 0) return -1;
out->type = CEL_TELEM_FLIGHT_MODE;
size_t copy_len = len < sizeof(out->data.flight_mode.name) ? len
: sizeof(out->data.flight_mode.name);
memcpy(out->data.flight_mode.name, p, copy_len);
out->data.flight_mode.name[copy_len] = 0;
return 0;
}
default:
return -1;
}