From 2bcd3c48f0b8591ad37f6579ae4149d37d0a1fe8 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 5 May 2016 10:36:50 +1000 Subject: [PATCH] Replay: use baro last update time if available --- Tools/Replay/LR_MsgHandler.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Tools/Replay/LR_MsgHandler.cpp b/Tools/Replay/LR_MsgHandler.cpp index 343a42c3dd..b0e2a3b45f 100644 --- a/Tools/Replay/LR_MsgHandler.cpp +++ b/Tools/Replay/LR_MsgHandler.cpp @@ -99,11 +99,16 @@ void LR_MsgHandler_CHEK::process_message(uint8_t *msg) void LR_MsgHandler_BARO::process_message(uint8_t *msg) { wait_timestamp_from_msg(msg); + uint32_t last_update_ms; + if (!field_value(msg, "SMS", last_update_ms)) { + last_update_ms = 0; + } baro.setHIL(0, require_field_float(msg, "Press"), require_field_int16_t(msg, "Temp") * 0.01f, require_field_float(msg, "Alt"), - require_field_float(msg, "CRt")); + require_field_float(msg, "CRt"), + last_update_ms); }