From 0de6cd44cfdc9461142e96ac79700db49bc7a93e Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Wed, 13 Sep 2023 12:19:18 -0700 Subject: [PATCH] debug modes cleanup --- firmware/config/engines/custom_engine.cpp | 3 --- firmware/controllers/algo/engine_types.h | 8 +++---- firmware/controllers/algo/wall_fuel.cpp | 21 ------------------- .../sensors/impl/software_knock.cpp | 4 ---- 4 files changed, 3 insertions(+), 33 deletions(-) diff --git a/firmware/config/engines/custom_engine.cpp b/firmware/config/engines/custom_engine.cpp index dc378e2f99..5637cccd18 100644 --- a/firmware/config/engines/custom_engine.cpp +++ b/firmware/config/engines/custom_engine.cpp @@ -313,7 +313,6 @@ void setTle8888TestConfiguration() { engineConfiguration->spi1misoPin = Gpio::B4; engineConfiguration->spi1sckPin = Gpio::B3; // please note that this pin is also SWO/SWD - Single Wire debug Output engineConfiguration->is_enabled_spi_1 = true; - engineConfiguration->debugMode = DBG_TLE8888; engineConfiguration->fuelPumpPin = Gpio::TLE8888_PIN_20; #endif /* BOARD_TLE8888_COUNT */ @@ -374,8 +373,6 @@ void setTle8888TestConfiguration() { */ static void mreBoardOldTest() { #if (BOARD_TLE8888_COUNT > 0) - engineConfiguration->debugMode = DBG_TLE8888; - engineConfiguration->triggerSimulatorRpm = 202; // set cranking_rpm 500 engineConfiguration->cranking.rpm = 100; diff --git a/firmware/controllers/algo/engine_types.h b/firmware/controllers/algo/engine_types.h index 1be2f49f1b..af99e4c4aa 100644 --- a/firmware/controllers/algo/engine_types.h +++ b/firmware/controllers/algo/engine_types.h @@ -238,17 +238,15 @@ typedef enum __attribute__ ((__packed__)) { DBG_UNUSED12 = 12, DBG_SD_CARD = 13, DBG_SR5_PROTOCOL = 14, - DBG_KNOCK = 15, + DBG_15 = 15, DBG_16 = 16, /** * See also DBG_ELECTRONIC_THROTTLE_EXTRA */ DBG_ELECTRONIC_THROTTLE_PID = 17, DBG_EXECUTOR = 18, - /** - * See tunerstudio.cpp - */ - DBG_BENCH_TEST = 19, + + DBG_19 = 19, DBG_20 = 20, /** * ADC diff --git a/firmware/controllers/algo/wall_fuel.cpp b/firmware/controllers/algo/wall_fuel.cpp index 9e83d73947..ba6867cf0d 100644 --- a/firmware/controllers/algo/wall_fuel.cpp +++ b/firmware/controllers/algo/wall_fuel.cpp @@ -54,13 +54,6 @@ float WallFuel::adjust(float desiredMassGrams) { float fuelFilmMass = wallFuel; float M_cmd = (desiredMassGrams - (1 - alpha) * fuelFilmMass) / (1 - beta); -#if EFI_TUNER_STUDIO - if (engineConfiguration->debugMode == DBG_KNOCK) { - engine->outputChannels.debugFloatField3 = fuelFilmMass; - engine->outputChannels.debugFloatField4 = M_cmd; - } -#endif // EFI_TUNER_STUDIO - // We can't inject a negative amount of fuel // If this goes below zero we will be over-fueling slightly, // but that's ok. @@ -71,12 +64,6 @@ float WallFuel::adjust(float desiredMassGrams) { // remainder on walls from last time + new from this time float fuelFilmMassNext = alpha * fuelFilmMass + beta * M_cmd; -#if EFI_TUNER_STUDIO - if (engineConfiguration->debugMode == DBG_KNOCK) { - engine->outputChannels.debugFloatField5 = fuelFilmMassNext; - } -#endif // EFI_TUNER_STUDIO - wallFuel = fuelFilmMassNext; wallFuelCorrection = M_cmd - desiredMassGrams; return M_cmd; @@ -185,12 +172,4 @@ void WallFuelController::onFastCallback() { m_alpha = alpha; m_beta = beta; m_enable = true; - -#if EFI_TUNER_STUDIO - // TODO: why DBG_KNOCK? That seems wrong. - if (engineConfiguration->debugMode == DBG_KNOCK) { - engine->outputChannels.debugFloatField1 = alpha; - engine->outputChannels.debugFloatField2 = beta; - } -#endif // EFI_TUNER_STUDIO } diff --git a/firmware/controllers/sensors/impl/software_knock.cpp b/firmware/controllers/sensors/impl/software_knock.cpp index 666211e4e2..4a7c26e853 100644 --- a/firmware/controllers/sensors/impl/software_knock.cpp +++ b/firmware/controllers/sensors/impl/software_knock.cpp @@ -177,10 +177,6 @@ void processLastKnockEvent() { float volts = ratio * sampleBuffer[i]; float filtered = knockFilter.filter(volts); - if (i == localCount - 1 && engineConfiguration->debugMode == DBG_KNOCK) { - engine->outputChannels.debugFloatField1 = volts; - engine->outputChannels.debugFloatField2 = filtered; - } sumSq += filtered * filtered; }