diff --git a/firmware/controllers/actuators/gppwm/gppwm_channel.cpp b/firmware/controllers/actuators/gppwm/gppwm_channel.cpp index 65f196076c..ce9b112f97 100644 --- a/firmware/controllers/actuators/gppwm/gppwm_channel.cpp +++ b/firmware/controllers/actuators/gppwm/gppwm_channel.cpp @@ -46,6 +46,11 @@ 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) { + firmwareError(CUSTOM_ERR_6122, "You can't have off below %f greater than on above %f", + m_config->offBelowDuty, + m_config->onBelowDuty); + } // Apply hysteresis with provided values if (m_state && result < m_config->offBelowDuty) { m_state = false; diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index af4c0a12d9..c35ba39eb1 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -346,8 +346,8 @@ struct gppwm_channel uint8_t dutyIfError;+If an error (with a sensor, etc) is detected, this value is used instead of reading from the table.\nThis should be a safe value for whatever hardware is connected to prevent damage.;"%", 1, 0, 0, 100, 0 uint16_t pwmFrequency;+Select a frequency to run PWM at.\nSet this to 0hz to enable on-off mode.;"hz", 1, 0, 0, 500, 0 - uint8_t onAboveDuty;+In on-off mode, turn the output on when the table value is above this duty.;"%", 1, 0, 0, 100, 0 - uint8_t offBelowDuty;+In on-off mode, turn the output off when the table value is below this duty.;"%", 1, 0, 0, 100, 0 + uint8_t onAboveDuty;+Hysteresis: in on-off mode, turn the output on when the table value is above this duty.;"%", 1, 0, 0, 100, 0 + uint8_t offBelowDuty;+Hysteresis: in on-off mode, turn the output off when the table value is below this duty.;"%", 1, 0, 0, 100, 0 gppwm_channel_e loadAxis;+Selects the load axis to use for the table.; uint8_t alignmentFill_map;;"unit", 1, 0, 0, 100, 0