From 2025712505ee2f9e27a49648f00b24e7dc90622a Mon Sep 17 00:00:00 2001 From: MattKear Date: Fri, 14 Jun 2024 17:56:14 +0100 Subject: [PATCH] AP_RPM: Improve rpm logging --- libraries/AP_RPM/AP_RPM.cpp | 31 +++++++++++++++++-------------- libraries/AP_RPM/LogStructure.h | 14 +++++++++----- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/libraries/AP_RPM/AP_RPM.cpp b/libraries/AP_RPM/AP_RPM.cpp index 79a2646030..087dcabe29 100644 --- a/libraries/AP_RPM/AP_RPM.cpp +++ b/libraries/AP_RPM/AP_RPM.cpp @@ -214,9 +214,7 @@ void AP_RPM::update(void) } #if HAL_LOGGING_ENABLED - if (enabled(0) || enabled(1)) { - Log_RPM(); - } + Log_RPM(); #endif } @@ -295,18 +293,23 @@ bool AP_RPM::arming_checks(size_t buflen, char *buffer) const #if HAL_LOGGING_ENABLED void AP_RPM::Log_RPM() const { - float rpm1 = -1, rpm2 = -1; + // update logging for each instance + for (uint8_t i=0; i