From c91407d66251b223ec5e1ce2891a03b72f9e52e5 Mon Sep 17 00:00:00 2001 From: Iampete1 Date: Mon, 9 Oct 2023 11:26:49 +0100 Subject: [PATCH] AP_Generator: IE 2400: only return custom msg if error is critial or low severity --- libraries/AP_Generator/AP_Generator_IE_2400.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libraries/AP_Generator/AP_Generator_IE_2400.cpp b/libraries/AP_Generator/AP_Generator_IE_2400.cpp index bfb90a4c4a..ac31ff38d5 100644 --- a/libraries/AP_Generator/AP_Generator_IE_2400.cpp +++ b/libraries/AP_Generator/AP_Generator_IE_2400.cpp @@ -394,16 +394,16 @@ bool AP_Generator_IE_2400::is_low_error(const uint32_t err_in) const // Check error codes and populate message with error code bool AP_Generator_IE_2400::check_for_err_code(char* msg_txt, uint8_t msg_len) const { - if ((_version == ProtocolVersion::V2) && (strlen(_valid_V2.info_str) > 0)) { - hal.util->snprintf(msg_txt, msg_len, "Fuel cell err %u.%u: %s", (unsigned)_err_code, (unsigned)_sub_err_code, _valid_V2.info_str); - return true; - } - // Check if we have received an error code if (!is_critical_error(_err_code) && !is_low_error(_err_code)) { return false; } + if ((_version == ProtocolVersion::V2) && (strlen(_valid_V2.info_str) > 0)) { + hal.util->snprintf(msg_txt, msg_len, "Fuel cell err %u.%u: %s", (unsigned)_err_code, (unsigned)_sub_err_code, _valid_V2.info_str); + return true; + } + hal.util->snprintf(msg_txt, msg_len, "Fuel cell err code <%u>", (unsigned)_err_code); return true; }