From 8647dda8a99bfa7e48987cceaf677624d8612919 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 19 Nov 2020 09:52:48 +1100 Subject: [PATCH] AP_Airspeed: add and use instance number to ARSP message --- libraries/AP_Airspeed/AP_Airspeed.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libraries/AP_Airspeed/AP_Airspeed.cpp b/libraries/AP_Airspeed/AP_Airspeed.cpp index c437313676..cf9b4a8cb6 100644 --- a/libraries/AP_Airspeed/AP_Airspeed.cpp +++ b/libraries/AP_Airspeed/AP_Airspeed.cpp @@ -574,9 +574,10 @@ void AP_Airspeed::Log_Airspeed() if (!get_temperature(i, temperature)) { temperature = 0; } - struct log_AIRSPEED pkt = { - LOG_PACKET_HEADER_INIT(i==0?LOG_ARSP_MSG:LOG_ASP2_MSG), + const struct log_ARSP pkt{ + LOG_PACKET_HEADER_INIT(LOG_ARSP_MSG), time_us : now, + instance : i, airspeed : get_raw_airspeed(i), diffpressure : get_differential_pressure(i), temperature : (int16_t)(temperature * 100.0f),