hysteresis for GPPWM #3222
This commit is contained in:
parent
1bcd9ca6a9
commit
43bdabeb0c
|
@ -6,6 +6,8 @@
|
||||||
#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:
|
||||||
|
@ -46,7 +48,7 @@ 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) {
|
if (m_config->offBelowDuty - m_config->onAboveDuty > EPS3) {
|
||||||
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 %f greater than on above %f",
|
||||||
m_config->offBelowDuty,
|
m_config->offBelowDuty,
|
||||||
m_config->onAboveDuty);
|
m_config->onAboveDuty);
|
||||||
|
|
Loading…
Reference in New Issue