From 74b101cd47cb9751b574cb2d89697d69c0f10526 Mon Sep 17 00:00:00 2001 From: Henry Wurzburg Date: Sat, 20 Apr 2024 13:50:28 -0500 Subject: [PATCH] AP_ESC_Telem:make logged ESC id match the output to which its attached --- libraries/AP_ESC_Telem/AP_ESC_Telem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/AP_ESC_Telem/AP_ESC_Telem.cpp b/libraries/AP_ESC_Telem/AP_ESC_Telem.cpp index a82a014dedd64..b1044d0753481 100644 --- a/libraries/AP_ESC_Telem/AP_ESC_Telem.cpp +++ b/libraries/AP_ESC_Telem/AP_ESC_Telem.cpp @@ -514,7 +514,7 @@ void AP_ESC_Telem::update() get_rpm(i, rpm); float raw_rpm = AP::logger().quiet_nanf(); get_raw_rpm(i, raw_rpm); - + uint8_t _i = i + 1; // Write ESC status messages // id starts from 0 // rpm, raw_rpm is eRPM (in RPM units) @@ -527,7 +527,7 @@ void AP_ESC_Telem::update() const struct log_Esc pkt{ LOG_PACKET_HEADER_INIT(uint8_t(LOG_ESC_MSG)), time_us : now_us64, - instance : i, + instance : _i, //makes logged instance agree to output that ESC is attached rpm : rpm, raw_rpm : raw_rpm, voltage : telemdata.voltage,