diff --git a/firmware/CHANGELOG.md b/firmware/CHANGELOG.md index 8473394987..4717d8f960 100644 --- a/firmware/CHANGELOG.md +++ b/firmware/CHANGELOG.md @@ -28,4 +28,7 @@ Release template (copy/paste this for new release): ## Unreleased +### Fixed + - Sensor checker wasn't checking sensors + ### For older changelog entries prior to fork from rusEFI, see CHANGELOG.rusefi.md diff --git a/firmware/controllers/sensors/sensor_checker.cpp b/firmware/controllers/sensors/sensor_checker.cpp index 88acbf8326..e21bc8daae 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 324ea9c3a1..5ebfde68b3 100644 --- a/unit_tests/tests/actuators/test_etb_integrated.cpp +++ b/unit_tests/tests/actuators/test_etb_integrated.cpp @@ -48,6 +48,7 @@ TEST(etb, integrated) { } extern int timeNowUs; +extern WarningCodeState unitTestWarningCodeState; TEST(etb, intermittentTps) { EngineTestHelper eth(TEST_ENGINE); // we have a destructor so cannot move EngineTestHelper into utility method @@ -91,6 +92,7 @@ TEST(etb, intermittentTps) { etb->update(); EXPECT_NE(0, etb->etbErrorCode); + EXPECT_EQ(3, unitTestWarningCodeState.recentWarnings.getCount()) << "intermittentTps"; } TEST(etb, intermittentPps) {