From a0efcc7bdc5195a757535883b5ab1d8125efb6c5 Mon Sep 17 00:00:00 2001 From: Michael du Breuil Date: Wed, 16 Aug 2023 11:29:32 -0700 Subject: [PATCH] AP_ESC_Telem: Correct a regression with calclulating active_esc_mask Credit to @casrya on github for spotting this (#24665), and investigating. The intent here was to bail out only if no data was within the timeout, which I had messed up in a bad refactor. --- libraries/AP_ESC_Telem/AP_ESC_Telem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_ESC_Telem/AP_ESC_Telem.cpp b/libraries/AP_ESC_Telem/AP_ESC_Telem.cpp index f5bafac336..9945d16ce4 100644 --- a/libraries/AP_ESC_Telem/AP_ESC_Telem.cpp +++ b/libraries/AP_ESC_Telem/AP_ESC_Telem.cpp @@ -108,7 +108,7 @@ uint32_t AP_ESC_Telem::get_active_esc_mask() const { continue; } if (now - _telem_data[i].last_update_ms >= ESC_TELEM_DATA_TIMEOUT_MS - && rpm_data_within_timeout(_rpm_data[i], now_us, ESC_RPM_DATA_TIMEOUT_US)) { + && !rpm_data_within_timeout(_rpm_data[i], now_us, ESC_RPM_DATA_TIMEOUT_US)) { continue; } ret |= (1U << i);