diff --git a/firmware/config/engines/ford_aspire.cpp b/firmware/config/engines/ford_aspire.cpp index ccfe67e620..812a42c3a1 100644 --- a/firmware/config/engines/ford_aspire.cpp +++ b/firmware/config/engines/ford_aspire.cpp @@ -75,8 +75,6 @@ void setFordAspireEngineConfiguration() { engineConfiguration->ignitionMode = IM_ONE_COIL; engineConfiguration->trigger.type = trigger_type_e::TT_FORD_ASPIRE; - engineConfiguration->triggerInputDebugPins[0] = Gpio::C15; - engineConfiguration->injectionPins[4] = Gpio::Unassigned; engineConfiguration->injectionPins[5] = Gpio::Unassigned; diff --git a/firmware/controllers/trigger/trigger_central.cpp b/firmware/controllers/trigger/trigger_central.cpp index 941d4a034a..6a104d0137 100644 --- a/firmware/controllers/trigger/trigger_central.cpp +++ b/firmware/controllers/trigger/trigger_central.cpp @@ -31,9 +31,6 @@ WaveChart waveChart; #endif /* EFI_ENGINE_SNIFFER */ -static scheduling_s debugToggleScheduling; -#define DEBUG_PIN_DELAY US2NT(60) - #define TRIGGER_WAVEFORM(x) getTriggerCentral()->triggerShape.x #if EFI_SHAFT_POSITION_INPUT @@ -130,22 +127,6 @@ angle_t TriggerCentral::syncAndReport(int divider, int remainder) { return totalShift; } -static void turnOffAllDebugFields(void *arg) { - (void)arg; -#if EFI_PROD_CODE - for (int index = 0; index < TRIGGER_INPUT_PIN_COUNT; index++) { - if (isBrainPinValid(engineConfiguration->triggerInputDebugPins[index])) { - writePad("trigger debug", engineConfiguration->triggerInputDebugPins[index], 0); - } - } - for (int index = 0; index < CAM_INPUTS_COUNT; index++) { - if (isBrainPinValid(engineConfiguration->camInputsDebug[index])) { - writePad("cam debug", engineConfiguration->camInputsDebug[index], 0); - } - } -#endif /* EFI_PROD_CODE */ -} - static angle_t adjustCrankPhase(int camIndex) { float maxSyncThreshold = engineConfiguration->maxCamPhaseResolveRpm; if (maxSyncThreshold != 0 && Sensor::getOrZero(SensorType::Rpm) > maxSyncThreshold) { @@ -209,13 +190,6 @@ static angle_t wrapVvt(angle_t vvtPosition, int period) { } static void logVvtFront(bool isImportantFront, bool isRising, efitick_t nowNt, int index) { - if (isImportantFront && isBrainPinValid(engineConfiguration->camInputsDebug[index])) { -#if EFI_PROD_CODE - writePad("cam debug", engineConfiguration->camInputsDebug[index], 1); -#endif /* EFI_PROD_CODE */ - getScheduler()->schedule("dbg_on", &debugToggleScheduling, nowNt + DEBUG_PIN_DELAY, &turnOffAllDebugFields); - } - // If we care about both edges OR displayLogicLevel is set, log every front exactly as it is addEngineSnifferVvtEvent(index, isRising); @@ -429,13 +403,6 @@ void handleShaftSignal(int signalIndex, bool isRising, efitick_t timestamp) { return; } - if (engineConfiguration->triggerInputDebugPins[signalIndex] != Gpio::Unassigned) { -#if EFI_PROD_CODE - writePad("trigger debug", engineConfiguration->triggerInputDebugPins[signalIndex], 1); -#endif /* EFI_PROD_CODE */ - getScheduler()->schedule("dbg_off", &debugToggleScheduling, timestamp + DEBUG_PIN_DELAY, &turnOffAllDebugFields); - } - uint32_t triggerHandlerEntryTime = getTimeNowLowerNt(); if (triggerReentrant > maxTriggerReentrant) maxTriggerReentrant = triggerReentrant; diff --git a/firmware/hw_layer/digital_input/trigger/trigger_input.cpp b/firmware/hw_layer/digital_input/trigger/trigger_input.cpp index 20e9ab6cfb..1bc6c01c87 100644 --- a/firmware/hw_layer/digital_input/trigger/trigger_input.cpp +++ b/firmware/hw_layer/digital_input/trigger/trigger_input.cpp @@ -115,25 +115,6 @@ void turnOnTriggerInputPins() { #endif /* (HAL_TRIGGER_USE_PAL == TRUE) */ - -void stopTriggerDebugPins() { - for (int i = 0; i < TRIGGER_INPUT_PIN_COUNT; i++) { - efiSetPadUnusedIfConfigurationChanged(triggerInputDebugPins[i]); - } - for (int i = 0; i < CAM_INPUTS_COUNT; i++) { - efiSetPadUnusedIfConfigurationChanged(camInputsDebug[i]); - } -} - -void startTriggerDebugPins() { - for (int i = 0; i < TRIGGER_INPUT_PIN_COUNT; i++) { - efiSetPadModeIfConfigurationChanged("trigger debug", triggerInputDebugPins[i], PAL_MODE_OUTPUT_PUSHPULL); - } - for (int i = 0; i < CAM_INPUTS_COUNT; i++) { - efiSetPadModeIfConfigurationChanged("cam debug", camInputsDebug[i], PAL_MODE_OUTPUT_PUSHPULL); - } -} - void applyNewTriggerInputPins() { if (hasFirmwareError()) { return; diff --git a/firmware/hw_layer/digital_input/trigger/trigger_input.h b/firmware/hw_layer/digital_input/trigger/trigger_input.h index 501dcc4213..74617d8071 100644 --- a/firmware/hw_layer/digital_input/trigger/trigger_input.h +++ b/firmware/hw_layer/digital_input/trigger/trigger_input.h @@ -16,7 +16,4 @@ void applyNewTriggerInputPins(); void startTriggerInputPins(); void stopTriggerInputPins(); -void stopTriggerDebugPins(); -void startTriggerDebugPins(); - void onTriggerChanged(efitick_t stamp, bool isPrimary, bool isRising); diff --git a/firmware/hw_layer/hardware.cpp b/firmware/hw_layer/hardware.cpp index ee157a3c20..8966cd9873 100644 --- a/firmware/hw_layer/hardware.cpp +++ b/firmware/hw_layer/hardware.cpp @@ -250,10 +250,6 @@ void applyNewHardwareSettings() { efiSetPadUnused(activeConfiguration.clutchUpPin); } -#if EFI_SHAFT_POSITION_INPUT - stopTriggerDebugPins(); -#endif // EFI_SHAFT_POSITION_INPUT - enginePins.unregisterPins(); #if EFI_PROD_CODE @@ -391,9 +387,6 @@ void stopHardware() { void startHardware() { #if EFI_SHAFT_POSITION_INPUT validateTriggerInputs(); - - startTriggerDebugPins(); - #endif // EFI_SHAFT_POSITION_INPUT startPedalPins(); diff --git a/firmware/hw_layer/io_pins.cpp b/firmware/hw_layer/io_pins.cpp index b9ffb573c3..658fc7b47d 100644 --- a/firmware/hw_layer/io_pins.cpp +++ b/firmware/hw_layer/io_pins.cpp @@ -112,10 +112,6 @@ iomode_t getInputMode(pin_input_mode_e mode) { } } -void writePad(const char *msg, brain_pin_e pin, int bit) { - palWritePad(getHwPort(msg, pin), getHwPin(msg, pin), bit); -} - #else /* EFI_PROD_CODE */ // This has been made global so we don't need to worry about efiReadPin having access the object diff --git a/firmware/hw_layer/io_pins.h b/firmware/hw_layer/io_pins.h index 7174b70e00..5af1c74353 100644 --- a/firmware/hw_layer/io_pins.h +++ b/firmware/hw_layer/io_pins.h @@ -39,8 +39,6 @@ EXTERNC iomode_t getInputMode(pin_input_mode_e mode); #endif /* EFI_GPIO_HARDWARE */ -void writePad(const char *msg, brain_pin_e pin, int bit); - #if ! EFI_PROD_CODE #define BRAIN_PIN_COUNT (1 << 8 * sizeof(brain_pin_e)) extern bool mockPinStates[BRAIN_PIN_COUNT]; diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 2d4fced383..277009c6b3 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -1001,7 +1001,6 @@ bit ALSActivateInverted float turboSpeedSensorMultiplier;;"mult", 1, 0, 0, 7000, 3 - Gpio[CAM_INPUTS_COUNT iterate] camInputsDebug; int16_t acIdleRpmBump;Extra idle target speed when A/C is enabled. Some cars need the extra speed to keep the AC efficient while idling.;"RPM", 1, 0, 0, 1000, 0 int16_t warningPeriod;;"seconds", 1, 0, 0, 60, 0 @@ -1026,7 +1025,6 @@ custom pin_mode_e 1 bits, U08, @OFFSET@, [0:6], @@pin_mode_e_enum@@ float wwaeTau;Length of time the deposited wall fuel takes to dissipate after the start of acceleration. ;"Seconds", 1, 0, 0, 3, 2 pid_s alternatorControl; pid_s etb; - Gpio[TRIGGER_INPUT_PIN_COUNT iterate] triggerInputDebugPins; int16_t airTaperRpmRange;RPM range above upper limit for extra air taper;"RPM", 1, 0, 0, 1500, 0 brain_input_pin_e turboSpeedSensorInputPin; int16_t tps2Min;;"ADC", 1, 0, 0, 1023, 0 diff --git a/firmware/tunerstudio/tunerstudio.template.ini b/firmware/tunerstudio/tunerstudio.template.ini index 8d8979b385..61750938c5 100644 --- a/firmware/tunerstudio/tunerstudio.template.ini +++ b/firmware/tunerstudio/tunerstudio.template.ini @@ -2889,14 +2889,6 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_ field = "Aux Temperature #2", auxTempSensor2_adcChannel field = "Aux Fast Analog", auxFastSensor1_adcChannel - dialog = allTriggerDebug, "Trigger Debug" - field = "trigger 1 debug", triggerInputDebugPins1 - field = "trigger 2 debug", triggerInputDebugPins2 - field = "cam 1 debug", camInputsDebug1 - field = "cam 2 debug", camInputsDebug2 - field = "cam 3 debug", camInputsDebug3 - field = "cam 4 debug", camInputsDebug4 - dialog = allPinsMC33, "MC33816" field = "Chip Select", mc33816_cs field = rstb, mc33816_rstb @@ -2968,7 +2960,6 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_ dialog = allPins2_3 field = "Debug Trigger Sync", debugTriggerSync - panel = allTriggerDebug panel = allPinsMC33 dialog = allPins1_3 @@ -4512,7 +4503,6 @@ dialog = tcuControls, "Transmission Settings" field = auxFrequencyFilter, auxFrequencyFilter field = useBiQuadOnAuxSpeedSensors, useBiQuadOnAuxSpeedSensors field = "TODO KS mode 4569", kickStartCranking - panel = allTriggerDebug panel = harleyAcr help = helpGeneral, "FOME General Help" diff --git a/unit_tests/tests/test_change_engine_type.cpp b/unit_tests/tests/test_change_engine_type.cpp deleted file mode 100644 index 5f4f1f6ff8..0000000000 --- a/unit_tests/tests/test_change_engine_type.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/* - * @file test_change_engine_type.cpp - * - * @date Jul 14, 2021 - * @author Andrey Belomutskiy, (c) 2012-2021 - */ - -#include "pch.h" - -TEST(misc, changeEngineType) { - /** - * this configuration has triggerInputDebugPins defined - */ - EngineTestHelper eth(engine_type_e::FORD_ASPIRE_1996); - - brain_pin_e brainPin = engineConfiguration->triggerInputDebugPins[0]; - ASSERT_TRUE(brainPin != Gpio::Unassigned); - ASSERT_TRUE(activeConfiguration.triggerInputDebugPins[0] != Gpio::Unassigned); - - int pinIndex = brainPin_to_index(brainPin); - ASSERT_TRUE(nullptr != getBrainUsedPin(pinIndex)); - - // above we have asserted that triggerInputDebugPins is in fact used - // now let's change into engine type without triggerInputDebugPins and assert shut down - - setEngineType(engine_type_e::CITROEN_TU3JP); - ASSERT_TRUE(activeConfiguration.triggerInputDebugPins[0] == Gpio::Unassigned); - - ASSERT_TRUE(engineConfiguration->triggerInputDebugPins[0] == Gpio::Unassigned); - ASSERT_TRUE(engineConfiguration->triggerInputDebugPins[0] == Gpio::Unassigned); - - ASSERT_TRUE(nullptr == getBrainUsedPin(pinIndex)); -} - diff --git a/unit_tests/tests/tests.mk b/unit_tests/tests/tests.mk index b36cc82ad3..5faf8d2580 100644 --- a/unit_tests/tests/tests.mk +++ b/unit_tests/tests/tests.mk @@ -48,7 +48,6 @@ TESTS_SRC_CPP = \ tests/lua/test_lua_Leiderman_Khlystov.cpp \ tests/lua/test_can_filter.cpp \ tests/lua/test_lua_vin.cpp \ - tests/test_change_engine_type.cpp \ tests/util/test_scaled_channel.cpp \ tests/util/test_timer.cpp \ tests/system/test_periodic_thread_controller.cpp \