mirror of https://github.com/ArduPilot/ardupilot
AP_Generator: IE 2400: only return custom msg if error is critial or low severity
This commit is contained in:
parent
c861e15853
commit
c91407d662
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue