From 1fafac308291df6be4f6f9c580598ce52ab84fd3 Mon Sep 17 00:00:00 2001 From: Bob Long Date: Mon, 21 Oct 2024 09:44:51 +1100 Subject: [PATCH] AP_ESC_Telem: log error count --- libraries/AP_ESC_Telem/AP_ESC_Telem.cpp | 3 ++- libraries/AP_ESC_Telem/LogStructure.h | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libraries/AP_ESC_Telem/AP_ESC_Telem.cpp b/libraries/AP_ESC_Telem/AP_ESC_Telem.cpp index 44ca3b1a4f..03894314c7 100644 --- a/libraries/AP_ESC_Telem/AP_ESC_Telem.cpp +++ b/libraries/AP_ESC_Telem/AP_ESC_Telem.cpp @@ -681,7 +681,8 @@ void AP_ESC_Telem::update() esc_temp : telemdata.temperature_cdeg, current_tot : telemdata.consumption_mah, motor_temp : telemdata.motor_temp_cdeg, - error_rate : rpmdata.error_rate + error_rate : rpmdata.error_rate, + error_count : telemdata.error_count, }; AP::logger().WriteBlock(&pkt, sizeof(pkt)); diff --git a/libraries/AP_ESC_Telem/LogStructure.h b/libraries/AP_ESC_Telem/LogStructure.h index a3c0dc791c..e7a49d2469 100644 --- a/libraries/AP_ESC_Telem/LogStructure.h +++ b/libraries/AP_ESC_Telem/LogStructure.h @@ -17,6 +17,7 @@ // @Field: CTot: current consumed total mAh // @Field: MotTemp: measured motor temperature in centi-degrees C // @Field: Err: error rate +// @Field: Errc: error count struct PACKED log_Esc { LOG_PACKET_HEADER; uint64_t time_us; @@ -29,8 +30,9 @@ struct PACKED log_Esc { float current_tot; int16_t motor_temp; float error_rate; + uint32_t error_count; }; #define LOG_STRUCTURE_FROM_ESC_TELEM \ { LOG_ESC_MSG, sizeof(log_Esc), \ - "ESC", "QBffffcfcf", "TimeUS,Instance,RPM,RawRPM,Volt,Curr,Temp,CTot,MotTemp,Err", "s#qqvAOaO%", "F-00--BCB-" , true }, + "ESC", "QBffffcfcfI", "TimeUS,Instance,RPM,RawRPM,Volt,Curr,Temp,CTot,MotTemp,Err,ErrC", "s#qqvAOaO%-", "F-00--BCB-0" , true },