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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user