From eee53678bdfffb73970e47a950321d47c5670cbc Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Mon, 20 Feb 2023 00:42:40 -0800 Subject: [PATCH] fire a warning in case of wideband fault (#5109) * fire a warning in case of wideband fault * s --- firmware/controllers/algo/obd_error_codes.h | 2 ++ firmware/controllers/sensors/AemXSeriesLambda.cpp | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/firmware/controllers/algo/obd_error_codes.h b/firmware/controllers/algo/obd_error_codes.h index 54cba00e3f..07a94a614b 100644 --- a/firmware/controllers/algo/obd_error_codes.h +++ b/firmware/controllers/algo/obd_error_codes.h @@ -1612,6 +1612,8 @@ typedef enum { //P2793 Gear Shift Direction Circ //P2794 Gear Shift Direction Circ Low //P2795 Gear Shift Direction Circ High + Wideband_1_Fault = 2900, + Wideband_2_Fault = 2901, //P2A00 O2 Sensor Circ Range/Perf Bank1 Sensor 1 //P2A01 O2 Sensor Circ Range/Perf Bank1 Sensor 2 //P2A02 O2 Sensor Circ Range/Perf Bank1 Sensor 3 diff --git a/firmware/controllers/sensors/AemXSeriesLambda.cpp b/firmware/controllers/sensors/AemXSeriesLambda.cpp index 1873940efe..783d6470c2 100644 --- a/firmware/controllers/sensors/AemXSeriesLambda.cpp +++ b/firmware/controllers/sensors/AemXSeriesLambda.cpp @@ -111,6 +111,11 @@ void AemXSeriesWideband::decodeRusefiDiag(const CANRxFrame& frame) { esr = data->Esr; faultCode = static_cast(data->Status); + + if (data->Status != wbo::Fault::None) { + auto code = m_sensorIndex == 0 ? Wideband_1_Fault : Wideband_2_Fault; + warning(code, "Wideband #%d fault: %s", (m_sensorIndex + 1), wbo::describeFault(data->Status)); + } } #endif