From 4471242da94daabd8e2f711bc5ecc92568317916 Mon Sep 17 00:00:00 2001 From: Mariano Rodriguez Date: Thu, 18 Sep 2025 20:00:23 -0500 Subject: [PATCH] ensure no implicit casts are done for packet.kf_vx packing --- MIDAS/src/telemetry.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MIDAS/src/telemetry.cpp b/MIDAS/src/telemetry.cpp index 60aa6735..2118dc76 100644 --- a/MIDAS/src/telemetry.cpp +++ b/MIDAS/src/telemetry.cpp @@ -119,7 +119,8 @@ TelemetryPacket Telemetry::makePacket(RocketData& data) { uint8_t sat_count = gps.fix_type; packet.fsm_callsign_satcount = ((uint8_t)fsm) | (sat_count << 4); float kf_vx_clamped = std::clamp(kalman.velocity.vx, -2000.f, 2000.f); - packet.kf_vx = (uint16_t) ((kf_vx_clamped + 2000) / 4000. * ((1 << 16) - 1)); + // freaky + packet.kf_vx = (uint16_t) ((kf_vx_clamped + 2000.f) / 4000.f * ((1 << 16) - 1)); #ifdef IS_SUSTAINER packet.fsm_callsign_satcount |= (1 << 7);