From 4090323d0bcdcbf3359dac6dc5df3f28544daa8c Mon Sep 17 00:00:00 2001 From: rusefillc Date: Fri, 8 Nov 2024 18:04:12 -0500 Subject: [PATCH] directPwmValue is dead only:uaefi --- .../actuators/electronic_throttle.cpp | 32 ------------------- .../actuators/electronic_throttle.h | 2 +- firmware/controllers/limp_manager.h | 2 +- firmware/tunerstudio/tunerstudio.template.ini | 2 +- 4 files changed, 3 insertions(+), 35 deletions(-) diff --git a/firmware/controllers/actuators/electronic_throttle.cpp b/firmware/controllers/actuators/electronic_throttle.cpp index 6765ea164d..43db252097 100644 --- a/firmware/controllers/actuators/electronic_throttle.cpp +++ b/firmware/controllers/actuators/electronic_throttle.cpp @@ -141,8 +141,6 @@ static TsCalMode functionToCalModeSecMax(dc_function_e func) { } #endif // EFI_TUNER_STUDIO -static percent_t directPwmValue = NAN; - #define ETB_DUTY_LIMIT 0.9 // this macro clamps both positive and negative percentages from about -100% to 100% #define ETB_PERCENT_TO_DUTY(x) (clampF(-ETB_DUTY_LIMIT, 0.01f * (x), ETB_DUTY_LIMIT)) @@ -614,12 +612,6 @@ void EtbController::update() { } #endif // EFI_UNIT_TEST - if (!std::isnan(directPwmValue)) { - m_motor->set(directPwmValue); - etbErrorCode = (int8_t)TpsState::Manual; - return; - } - bool isOk = checkStatus(); if (!isOk) { @@ -802,30 +794,6 @@ void etbPidReset() { } } -#if !EFI_UNIT_TEST - -/** - * At the moment there are TWO ways to use this - * set_etb_duty X - * set etb X - * manual duty cycle control without PID. Percent value from 0 to 100 - */ -void setThrottleDutyCycle(percent_t level) { - efiPrintf("setting ETB duty=%f%%", level); - if (std::isnan(level)) { - directPwmValue = NAN; - return; - } - - float dc = ETB_PERCENT_TO_DUTY(level); - directPwmValue = dc; - for (int i = 0 ; i < ETB_COUNT; i++) { - setDcMotorDuty(i, dc); - } - efiPrintf("duty ETB duty=%f", dc); -} -#endif /* EFI_PROD_CODE */ - void etbAutocal(size_t throttleIndex) { if (throttleIndex >= ETB_COUNT) { return; diff --git a/firmware/controllers/actuators/electronic_throttle.h b/firmware/controllers/actuators/electronic_throttle.h index 0d583f2566..813d96b0dc 100644 --- a/firmware/controllers/actuators/electronic_throttle.h +++ b/firmware/controllers/actuators/electronic_throttle.h @@ -29,7 +29,7 @@ void setBoschVAGETB(); void setDefaultEtbBiasCurve(); void setDefaultEtbParameters(); void setBoschVNH2SP30Curve(); -void setThrottleDutyCycle(percent_t level); + void onConfigurationChangeElectronicThrottleCallback(engine_configuration_s *previousConfiguration); void unregisterEtbPins(); void setProteusHitachiEtbDefaults(); diff --git a/firmware/controllers/limp_manager.h b/firmware/controllers/limp_manager.h index 1b24f87ecb..d7f5eee80a 100644 --- a/firmware/controllers/limp_manager.h +++ b/firmware/controllers/limp_manager.h @@ -40,7 +40,7 @@ enum class TpsState : uint8_t { IntermittentTps, // 4 AutoTune, // 5 Lua, // 6 - Manual, // 7 + Unused7, // 7 NotConfigured, // 8 Redundancy, // 9 IntermittentPps, // 10 diff --git a/firmware/tunerstudio/tunerstudio.template.ini b/firmware/tunerstudio/tunerstudio.template.ini index 14766f2b8f..5ba3e53161 100644 --- a/firmware/tunerstudio/tunerstudio.template.ini +++ b/firmware/tunerstudio/tunerstudio.template.ini @@ -259,7 +259,7 @@ enable2ndByteCanID = false fuelIgnCutCodeList = bits, U08, [0:7], "None", "fatal error", "setting disabled", "RPM limit", "fault RPM limit", "boost cut", "oil pressure", "stop requested", "ETB problem", "launch control", "max injector duty", "flood clear", "engine sync", "kickstart", "ign off", "Lua", "ACR", "Lambda Prot", "GDI Comms", "Brake" ; TpsState - etbCutCodeList = bits, U08, [0:7], "None", "engine stopped", "TPS error", "PPS error", "TPS noise", "Autotune", "Lua", "Manual", "N/A", "Redundancy", "PPS noise", "Jam" + etbCutCodeList = bits, U08, [0:7], "None", "engine stopped", "TPS error", "PPS error", "TPS noise", "Autotune", "Lua", "INVALID", "N/A", "Redundancy", "PPS noise", "Jam" outputDiagErrorList = bits, U08, [0:3], "Not used", "No error", "Open Load", "Short to Gnd", "Short to Battery", "Overload", "Driver Overtemp", "Driver disabled", "Unknown" @@BOARD_PC_VARIABLES_FROM_FILE@@