mirror of https://github.com/rusefi/rusefi-1.git
hysteresis for GPPWM #3222
This commit is contained in:
parent
43bdabeb0c
commit
0bdf334a8a
|
@ -6,8 +6,6 @@
|
||||||
#include "table_helper.h"
|
#include "table_helper.h"
|
||||||
#include "expected.h"
|
#include "expected.h"
|
||||||
|
|
||||||
#define EPS3 0.001
|
|
||||||
|
|
||||||
expected<float> readGppwmChannel(gppwm_channel_e channel DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
expected<float> readGppwmChannel(gppwm_channel_e channel DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||||
switch (channel) {
|
switch (channel) {
|
||||||
case GPPWM_Tps:
|
case GPPWM_Tps:
|
||||||
|
@ -48,8 +46,8 @@ void GppwmChannel::setOutput(float result) {
|
||||||
m_pwm->setSimplePwmDutyCycle(clampF(0, result / 100.0f, 1));
|
m_pwm->setSimplePwmDutyCycle(clampF(0, result / 100.0f, 1));
|
||||||
} else {
|
} else {
|
||||||
efiAssertVoid(OBD_PCM_Processor_Fault, m_output, "m_output null");
|
efiAssertVoid(OBD_PCM_Processor_Fault, m_output, "m_output null");
|
||||||
if (m_config->offBelowDuty - m_config->onAboveDuty > EPS3) {
|
if (m_config->offBelowDuty > m_config->onAboveDuty) {
|
||||||
firmwareError(CUSTOM_ERR_6122, "You can't have off below %f greater than on above %f",
|
firmwareError(CUSTOM_ERR_6122, "You can't have off below %d greater than on above %d",
|
||||||
m_config->offBelowDuty,
|
m_config->offBelowDuty,
|
||||||
m_config->onAboveDuty);
|
m_config->onAboveDuty);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue