This commit is contained in:
rusefi 2019-04-24 17:00:05 -04:00
parent 08b2c99c3e
commit c8859d651c
2 changed files with 10 additions and 7 deletions

View File

@ -135,7 +135,7 @@ public:
static EtbControl etb1; static EtbControl etb1;
static float valueOverride = NAN; static float directPwmValue = NAN;
/* /*
CCM_OPTIONAL static SimplePwm etbPwmDown("etbDown"); CCM_OPTIONAL static SimplePwm etbPwmDown("etbDown");
*/ */
@ -177,7 +177,7 @@ private:
} else if (engineConfiguration->debugMode == DBG_ELECTRONIC_THROTTLE_EXTRA) { } else if (engineConfiguration->debugMode == DBG_ELECTRONIC_THROTTLE_EXTRA) {
#if EFI_TUNER_STUDIO #if EFI_TUNER_STUDIO
// set debug_mode 29 // set debug_mode 29
tsOutputChannels.debugFloatField1 = valueOverride; tsOutputChannels.debugFloatField1 = directPwmValue;
#endif /* EFI_TUNER_STUDIO */ #endif /* EFI_TUNER_STUDIO */
} }
@ -186,8 +186,8 @@ private:
shouldResetPid = false; shouldResetPid = false;
} }
if (!cisnan(valueOverride)) { if (!cisnan(directPwmValue)) {
etb1.dcMotor.Set(valueOverride); etb1.dcMotor.Set(directPwmValue);
return; return;
} }
@ -258,12 +258,12 @@ static EtbController etbController;
void setThrottleDutyCycle(float level) { void setThrottleDutyCycle(float level) {
scheduleMsg(&logger, "setting ETB duty=%f%%", level); scheduleMsg(&logger, "setting ETB duty=%f%%", level);
if (cisnan(level)) { if (cisnan(level)) {
valueOverride = NAN; directPwmValue = NAN;
return; return;
} }
float dc = PERCENT_TO_DUTY(level); float dc = PERCENT_TO_DUTY(level);
valueOverride = dc; directPwmValue = dc;
etb1.dcMotor.Set(dc); etb1.dcMotor.Set(dc);
scheduleMsg(&logger, "duty ETB duty=%f", dc); scheduleMsg(&logger, "duty ETB duty=%f", dc);
} }

View File

@ -12,7 +12,10 @@
static int mockTps; static int mockTps;
#endif /* EFI_PROD_CODE */ #endif /* EFI_PROD_CODE */
// set mock_pedal_position X /**
* set mock_pedal_position X
* See also directPwmValue
*/
percent_t mockPedalPosition = MOCK_UNDEFINED; percent_t mockPedalPosition = MOCK_UNDEFINED;
/** /**