From 44b2c2f89eb199f2b8949df1b78c010621e49703 Mon Sep 17 00:00:00 2001 From: rusEfi Date: Fri, 27 Sep 2019 23:37:40 -0400 Subject: [PATCH] new command 'etb_freq X' --- .../controllers/actuators/electronic_throttle.cpp | 13 +++++++++++++ firmware/controllers/engine_controller.cpp | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/firmware/controllers/actuators/electronic_throttle.cpp b/firmware/controllers/actuators/electronic_throttle.cpp index 0f55a454c2..cb19f5db37 100644 --- a/firmware/controllers/actuators/electronic_throttle.cpp +++ b/firmware/controllers/actuators/electronic_throttle.cpp @@ -127,6 +127,12 @@ public: TwoPinDcMotor dcMotor; + void setFrequency(int frequency) { + m_pwmEnable.setFrequency(frequency); + m_pwmDir1.setFrequency(frequency); + m_pwmDir2.setFrequency(frequency); + } + void start(bool useTwoWires, brain_pin_e pinEnable, // since we have pointer magic here we cannot simply have value parameter @@ -376,6 +382,12 @@ void setEtbPFactor(float value) { showEthInfo(); } +static void setEtbFrequency(int frequency) { + engineConfiguration->etbFreq = frequency; + + etb1.setFrequency(frequency); +} + static void etbReset() { scheduleMsg(&logger, "etbReset"); @@ -570,6 +582,7 @@ void initElectronicThrottle(DECLARE_ENGINE_PARAMETER_SIGNATURE) { #if EFI_PROD_CODE addConsoleAction("ethinfo", showEthInfo); addConsoleAction("etbreset", etbReset); + addConsoleActionI("etb_freq", setEtbFrequency); #endif /* EFI_PROD_CODE */ etbPid.initPidClass(&engineConfiguration->etb); diff --git a/firmware/controllers/engine_controller.cpp b/firmware/controllers/engine_controller.cpp index 6f18422097..03db8ff76b 100644 --- a/firmware/controllers/engine_controller.cpp +++ b/firmware/controllers/engine_controller.cpp @@ -832,6 +832,6 @@ int getRusEfiVersion(void) { if (initBootloader() != 0) return 123; #endif /* EFI_BOOTLOADER_INCLUDE_CODE */ - return 20190922; + return 20190927; } #endif /* EFI_UNIT_TEST */