From 1c868cac371b968da6a5e7b721625f6859f7c2a1 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 24 Oct 2022 10:43:35 +1100 Subject: [PATCH] AP_Airspeed: add instance to hygrometer logging --- libraries/AP_Airspeed/AP_Airspeed.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/libraries/AP_Airspeed/AP_Airspeed.cpp b/libraries/AP_Airspeed/AP_Airspeed.cpp index 80baefc4a0..9cb65e305c 100644 --- a/libraries/AP_Airspeed/AP_Airspeed.cpp +++ b/libraries/AP_Airspeed/AP_Airspeed.cpp @@ -724,6 +724,13 @@ void AP_Airspeed::handle_msp(const MSP::msp_airspeed_data_message_t &pkt) } #endif +// @LoggerMessage: HYGR +// @Description: Hygrometer data +// @Field: TimeUS: Time since system startup +// @Field: Id: sensor ID +// @Field: Humidity: percentage humidity +// @Field: Temp: temperature in degrees C + void AP_Airspeed::Log_Airspeed() { const uint64_t now = AP_HAL::micros64(); @@ -761,11 +768,12 @@ void AP_Airspeed::Log_Airspeed() if (sensor[i]->get_hygrometer(hygrometer.sample_ms, hygrometer.temperature, hygrometer.humidity) && hygrometer.sample_ms != state[i].last_hygrometer_log_ms) { AP::logger().WriteStreaming("HYGR", - "TimeUS,Humidity,Temp", - "s%O", - "F--", - "Qff", + "TimeUS,Id,Humidity,Temp", + "s#%O", + "F---", + "QBff", AP_HAL::micros64(), + i, hygrometer.humidity, hygrometer.temperature); state[i].last_hygrometer_log_ms = hygrometer.sample_ms;