From 954da551f7530843f82089fa330ce1b3dc9de057 Mon Sep 17 00:00:00 2001 From: Andrey Date: Tue, 11 Apr 2023 16:06:38 -0400 Subject: [PATCH] sensor checker is not checking sensors fix #5232 --- firmware/CHANGELOG.md | 1 + firmware/controllers/sensors/sensor_checker.cpp | 2 +- unit_tests/tests/actuators/test_etb_integrated.cpp | 3 +-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/firmware/CHANGELOG.md b/firmware/CHANGELOG.md index 69b7263748..8015671aa1 100644 --- a/firmware/CHANGELOG.md +++ b/firmware/CHANGELOG.md @@ -49,6 +49,7 @@ Release template (copy/paste this for new release): - ETB control improvements hellen boards #5196 - Require either analog AFR or CAN AFR input not both #5226 - Ignition Knock response logging progress + - sensor checker is not checking sensors #5232 ## February 2023 Release - "Day 346" diff --git a/firmware/controllers/sensors/sensor_checker.cpp b/firmware/controllers/sensors/sensor_checker.cpp index 3eab1883b3..eb24f3edfe 100644 --- a/firmware/controllers/sensors/sensor_checker.cpp +++ b/firmware/controllers/sensors/sensor_checker.cpp @@ -148,7 +148,7 @@ void SensorChecker::onSlowCallback() { // TODO: also inhibit checking if we just did a flash burn, since that blocks the ECU for a few seconds. bool shouldCheck = m_ignitionIsOn && m_timeSinceIgnOff.hasElapsedSec(5); m_analogSensorsShouldWork = shouldCheck; - if (shouldCheck) { + if (!shouldCheck) { return; } diff --git a/unit_tests/tests/actuators/test_etb_integrated.cpp b/unit_tests/tests/actuators/test_etb_integrated.cpp index a1c1499392..7943dc8906 100644 --- a/unit_tests/tests/actuators/test_etb_integrated.cpp +++ b/unit_tests/tests/actuators/test_etb_integrated.cpp @@ -92,8 +92,7 @@ TEST(etb, intermittentTps) { etb->update(); EXPECT_NE(0, etb->etbErrorCode); - // todo: warnings would have been nice! - EXPECT_EQ( 0, unitTestWarningCodeState.recentWarnings.getCount()) << "intermittentTps"; + EXPECT_EQ( 3, unitTestWarningCodeState.recentWarnings.getCount()) << "intermittentTps"; } TEST(etb, intermittentPps) {