From 0bdf334a8a6b01755da2472b3c7308fe1fc2b23f Mon Sep 17 00:00:00 2001 From: rusefillc Date: Mon, 6 Sep 2021 07:58:17 -0400 Subject: [PATCH] hysteresis for GPPWM #3222 --- firmware/controllers/actuators/gppwm/gppwm_channel.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/firmware/controllers/actuators/gppwm/gppwm_channel.cpp b/firmware/controllers/actuators/gppwm/gppwm_channel.cpp index 9fae2faca6..e8c8e4088c 100644 --- a/firmware/controllers/actuators/gppwm/gppwm_channel.cpp +++ b/firmware/controllers/actuators/gppwm/gppwm_channel.cpp @@ -6,8 +6,6 @@ #include "table_helper.h" #include "expected.h" -#define EPS3 0.001 - expected readGppwmChannel(gppwm_channel_e channel DECLARE_ENGINE_PARAMETER_SUFFIX) { switch (channel) { case GPPWM_Tps: @@ -48,8 +46,8 @@ void GppwmChannel::setOutput(float result) { m_pwm->setSimplePwmDutyCycle(clampF(0, result / 100.0f, 1)); } else { efiAssertVoid(OBD_PCM_Processor_Fault, m_output, "m_output null"); - if (m_config->offBelowDuty - m_config->onAboveDuty > EPS3) { - firmwareError(CUSTOM_ERR_6122, "You can't have off below %f greater than on above %f", + if (m_config->offBelowDuty > m_config->onAboveDuty) { + firmwareError(CUSTOM_ERR_6122, "You can't have off below %d greater than on above %d", m_config->offBelowDuty, m_config->onAboveDuty); }