From d2d0ffa1eebf9fef891698a9996a3d9a4a0d4a88 Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Wed, 9 Sep 2020 13:52:23 -0700 Subject: [PATCH] remove tach output pin (#1779) * remove from cfg * cfg * rip out impl * efi gpio --- firmware/config/boards/me7_pnp/board_configuration.cpp | 1 - .../config/boards/nucleo_f767/board_configuration.cpp | 1 - .../config/boards/prometheus/board_configuration.cpp | 1 - firmware/config/engines/citroenBerlingoTU3JP.cpp | 3 --- firmware/config/engines/ford_festiva.cpp | 2 -- firmware/config/engines/mazda_miata_vvt.cpp | 4 ++-- firmware/console/status_loop.cpp | 1 - firmware/controllers/bench_test.cpp | 6 ------ firmware/controllers/engine_cycle/spark_logic.cpp | 10 ---------- firmware/controllers/gauges/tachometer.cpp | 2 -- firmware/controllers/system/efi_gpio.cpp | 7 ------- firmware/controllers/system/efi_gpio.h | 2 -- firmware/integration/rusefi_config.txt | 6 ++---- firmware/tunerstudio/rusefi.input | 7 ------- 14 files changed, 4 insertions(+), 49 deletions(-) diff --git a/firmware/config/boards/me7_pnp/board_configuration.cpp b/firmware/config/boards/me7_pnp/board_configuration.cpp index 7c553d0efe..4b9b738417 100644 --- a/firmware/config/boards/me7_pnp/board_configuration.cpp +++ b/firmware/config/boards/me7_pnp/board_configuration.cpp @@ -43,7 +43,6 @@ void setPinConfigurationOverrides(void) { void setBoardConfigurationOverrides(void) { // NOT USED - engineConfiguration->dizzySparkOutputPin = GPIO_UNASSIGNED; engineConfiguration->externalKnockSenseAdc = EFI_ADC_NONE; engineConfiguration->displayMode = DM_NONE; engineConfiguration->HD44780_rs = GPIO_UNASSIGNED; diff --git a/firmware/config/boards/nucleo_f767/board_configuration.cpp b/firmware/config/boards/nucleo_f767/board_configuration.cpp index 3e70b1536a..73984a4b8f 100644 --- a/firmware/config/boards/nucleo_f767/board_configuration.cpp +++ b/firmware/config/boards/nucleo_f767/board_configuration.cpp @@ -53,7 +53,6 @@ void setBoardConfigurationOverrides(void) { engineConfiguration->throttlePedalPositionAdcChannel = EFI_ADC_NONE; // not used - engineConfiguration->dizzySparkOutputPin = GPIO_UNASSIGNED; engineConfiguration->externalKnockSenseAdc = EFI_ADC_NONE; engineConfiguration->displayMode = DM_NONE; engineConfiguration->HD44780_rs = GPIO_UNASSIGNED; diff --git a/firmware/config/boards/prometheus/board_configuration.cpp b/firmware/config/boards/prometheus/board_configuration.cpp index daf91ba6e0..f8d3f2cf5e 100644 --- a/firmware/config/boards/prometheus/board_configuration.cpp +++ b/firmware/config/boards/prometheus/board_configuration.cpp @@ -200,7 +200,6 @@ void setBoardConfigurationOverrides(void) { engineConfiguration->triggerSimulatorPinModes[0] = OM_DEFAULT; // not used - engineConfiguration->dizzySparkOutputPin = GPIO_UNASSIGNED; engineConfiguration->externalKnockSenseAdc = EFI_ADC_NONE; engineConfiguration->displayMode = DM_NONE; engineConfiguration->HD44780_rs = GPIO_UNASSIGNED; diff --git a/firmware/config/engines/citroenBerlingoTU3JP.cpp b/firmware/config/engines/citroenBerlingoTU3JP.cpp index a95e25e619..f15387517f 100644 --- a/firmware/config/engines/citroenBerlingoTU3JP.cpp +++ b/firmware/config/engines/citroenBerlingoTU3JP.cpp @@ -187,7 +187,4 @@ void setCitroenBerlingoTU3JPConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { #if IGN_LOAD_COUNT == DEFAULT_IGN_LOAD_COUNT MEMCPY(config->ignitionTable, default_tps_advance_table); #endif - - engineConfiguration->dizzySparkOutputPin = GPIOE_3; - engineConfiguration->dizzySparkOutputPinMode = OM_INVERTED; } diff --git a/firmware/config/engines/ford_festiva.cpp b/firmware/config/engines/ford_festiva.cpp index 6429b3354e..fb674ccf6d 100644 --- a/firmware/config/engines/ford_festiva.cpp +++ b/firmware/config/engines/ford_festiva.cpp @@ -174,8 +174,6 @@ void setFordEscortGt(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS; - engineConfiguration->dizzySparkOutputPin = GPIOE_14; // Frankenso high side - pin 1G; - /** * Outputs */ diff --git a/firmware/config/engines/mazda_miata_vvt.cpp b/firmware/config/engines/mazda_miata_vvt.cpp index 75293c8d21..cb2bcd4977 100644 --- a/firmware/config/engines/mazda_miata_vvt.cpp +++ b/firmware/config/engines/mazda_miata_vvt.cpp @@ -407,7 +407,7 @@ void setMazdaMiata2003EngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { // high-side driver with +12v VP jumper - engineConfiguration->dizzySparkOutputPin = GPIOE_8; // tachometer + engineConfiguration->tachOutputPin = GPIOE_8; // tachometer // set global_trigger_offset_angle 0 engineConfiguration->globalTriggerAngleOffset = 0; @@ -594,7 +594,7 @@ static void setMiataNB2_MRE_common(DECLARE_CONFIG_PARAMETER_SIGNATURE) { // GPIOD_6: "13 - GP Out 6" - selected to +12v engineConfiguration->alternatorControlPin = GPIOD_6; // GPIOD_7: "14 - GP Out 5" - selected to +12v - engineConfiguration->dizzySparkOutputPin = GPIOD_7; // tachometer + engineConfiguration->tachOutputPin = GPIOD_7; // tachometer // set cranking_fuel 9 engineConfiguration->cranking.baseFuel = 9; // higher value for return system NA conversion since lower fuel pressure diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index 56a27399f9..7e9652e702 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -202,7 +202,6 @@ void printOverallStatus(systime_t nowSeconds) { printOutPin(PROTOCOL_VVT_NAME, engineConfiguration->camInputs[0]); printOutPin(PROTOCOL_HIP_NAME, CONFIG(hip9011IntHoldPin)); printOutPin(PROTOCOL_TACH_NAME, CONFIG(tachOutputPin)); - printOutPin(PROTOCOL_DIZZY_NAME, engineConfiguration->dizzySparkOutputPin); #if EFI_LOGIC_ANALYZER printOutPin(PROTOCOL_WA_CHANNEL_1, CONFIG(logicAnalyzerPins)[0]); printOutPin(PROTOCOL_WA_CHANNEL_2, CONFIG(logicAnalyzerPins)[1]); diff --git a/firmware/controllers/bench_test.cpp b/firmware/controllers/bench_test.cpp index 60abe33cc6..fff7997742 100644 --- a/firmware/controllers/bench_test.cpp +++ b/firmware/controllers/bench_test.cpp @@ -225,11 +225,6 @@ static void sparkbench(const char * onTimeStr, const char *offTimeStr, const cha sparkbench2("0", "1", onTimeStr, offTimeStr, countStr); } - -void dizzyBench(void) { - pinbench("300", "5", "400", "3", &enginePins.dizzyOutput, engineConfiguration->dizzySparkOutputPin); -} - class BenchController : public PeriodicController { public: BenchController() : PeriodicController("BenchThread") { } @@ -383,7 +378,6 @@ void initBenchTest(Logging *sharedLogger) { addConsoleActionS("fuelpumpbench2", fuelPumpBenchExt); addConsoleAction("fanbench", fanBench); addConsoleActionS("fanbench2", fanBenchExt); - addConsoleAction("dizzybench", dizzyBench); // this is useful for tach output testing addConsoleAction(CMD_STARTER_BENCH, starterRelayBench); addConsoleAction(CMD_MIL_BENCH, milBench); diff --git a/firmware/controllers/engine_cycle/spark_logic.cpp b/firmware/controllers/engine_cycle/spark_logic.cpp index a4998e0267..5abe4704be 100644 --- a/firmware/controllers/engine_cycle/spark_logic.cpp +++ b/firmware/controllers/engine_cycle/spark_logic.cpp @@ -69,11 +69,6 @@ static void fireSparkBySettingPinLow(IgnitionEvent *event, IgnitionOutputPin *ou } output->setLow(); -#if EFI_PROD_CODE - if (CONFIG(dizzySparkOutputPin) != GPIO_UNASSIGNED) { - enginePins.dizzyOutput.setLow(); - } -#endif /* EFI_PROD_CODE */ } // todo: make this a class method? @@ -246,11 +241,6 @@ static void startDwellByTurningSparkPinHigh(IgnitionEvent *event, IgnitionOutput } output->setHigh(); -#if EFI_PROD_CODE - if (CONFIG(dizzySparkOutputPin) != GPIO_UNASSIGNED) { - enginePins.dizzyOutput.setHigh(); - } -#endif /* EFI_PROD_CODE */ } void turnSparkPinHigh(IgnitionEvent *event) { diff --git a/firmware/controllers/gauges/tachometer.cpp b/firmware/controllers/gauges/tachometer.cpp index 44ec6ba6bf..2f4c5f9270 100644 --- a/firmware/controllers/gauges/tachometer.cpp +++ b/firmware/controllers/gauges/tachometer.cpp @@ -4,8 +4,6 @@ * * This implementation produces one pulse per engine cycle * - * todo: these is a bit of duplication with dizzySparkOutputPin - * * @date Aug 18, 2015 * @author Andrey Belomutskiy, (c) 2012-2020 */ diff --git a/firmware/controllers/system/efi_gpio.cpp b/firmware/controllers/system/efi_gpio.cpp index 4a24fce5c6..6ee83536df 100644 --- a/firmware/controllers/system/efi_gpio.cpp +++ b/firmware/controllers/system/efi_gpio.cpp @@ -50,7 +50,6 @@ static const char *injectorShortNames[] = { PROTOCOL_INJ1_SHORT_NAME, "i2", "i3" static const char *auxValveShortNames[] = { "a1", "a2"}; EnginePins::EnginePins() { - dizzyOutput.name = PROTOCOL_DIZZY_NAME; tachOut.name = PROTOCOL_TACH_NAME; static_assert(efi::size(sparkNames) >= IGNITION_PIN_COUNT, "Too many ignition pins"); @@ -132,7 +131,6 @@ void EnginePins::unregisterPins() { unregisterOutputIfPinOrModeChanged(hipCs, hip9011CsPin, hip9011CsPinMode); unregisterOutputIfPinOrModeChanged(triggerDecoderErrorPin, triggerErrorPin, triggerErrorPinMode); unregisterOutputIfPinOrModeChanged(checkEnginePin, malfunctionIndicatorPin, malfunctionIndicatorPinMode); - unregisterOutputIfPinOrModeChanged(dizzyOutput, dizzySparkOutputPin, dizzySparkOutputPinMode); unregisterOutputIfPinOrModeChanged(tachOut, tachOutputPin, tachOutputPinMode); unregisterOutputIfPinOrModeChanged(idleSolenoidPin, idle.solenoidPin, idle.solenoidPinMode); unregisterOutputIfPinOrModeChanged(secondIdleSolenoidPin, secondSolenoidPin, idle.solenoidPinMode); @@ -201,11 +199,6 @@ void EnginePins::startIgnitionPins(void) { output->initPin(output->name, CONFIG(ignitionPins)[i], &CONFIG(ignitionPinMode)); } } - if (isPinOrModeChanged(dizzySparkOutputPin, dizzySparkOutputPinMode)) { - enginePins.dizzyOutput.initPin("Distributor", engineConfiguration->dizzySparkOutputPin, - &engineConfiguration->dizzySparkOutputPinMode); - - } #endif /* EFI_PROD_CODE */ } diff --git a/firmware/controllers/system/efi_gpio.h b/firmware/controllers/system/efi_gpio.h index 83072844d1..891f9a69dc 100644 --- a/firmware/controllers/system/efi_gpio.h +++ b/firmware/controllers/system/efi_gpio.h @@ -171,8 +171,6 @@ public: OutputPin checkEnginePin; NamedOutputPin tachOut; - // todo: remove this feature https://github.com/rusefi/rusefi/issues/1775 - NamedOutputPin dizzyOutput; OutputPin fsioOutputs[FSIO_COMMAND_COUNT]; OutputPin triggerDecoderErrorPin; diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 83bb42cc12..8a5d821a91 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -710,7 +710,7 @@ custom adc_channel_mode_e 4 bits, U32, @OFFSET@, [0:1], "Off", "Slow", "Fas brain_input_pin_e[TRIGGER_INPUT_PIN_COUNT iterate] triggerInputPins; pin_output_mode_e hip9011CsPinMode; - output_pin_e tachOutputPin;+This implementation produces one pulse per engine cycle. See also dizzySparkOutputPin. + output_pin_e tachOutputPin; pin_output_mode_e tachOutputPinMode; output_pin_e mainRelayPin; @@ -1201,8 +1201,7 @@ float[MAP_ACCEL_TAPER] mapAccelTaperMult;;"mult", 1, 0, 0.0, 300, spi_device_e cj125SpiDevice; pin_output_mode_e cj125CsPinMode; - output_pin_e dizzySparkOutputPin;+This implementation makes a pulse every time one of the coils is charged, using coil dwell for pulse width. See also tachOutputPin - pin_output_mode_e dizzySparkOutputPinMode; + uint8_t unusedDizzy;;"units",1,0,-20,100,0 int crankingIACposition;+This is the IAC position during cranking, some engines start better if given more air during cranking to improve cylinder filling.;"percent", 1, 0, -100.0, 100, 0 float tChargeMinRpmMinTps;;"mult", 1, 0, 0, 3, 4 @@ -1685,7 +1684,6 @@ end_struct #define PROTOCOL_VVT_NAME "VVT" #define PROTOCOL_HIP_NAME "HIP" #define PROTOCOL_TACH_NAME "tach" -#define PROTOCOL_DIZZY_NAME "dizzy" #define PROTOCOL_WA_CHANNEL_1 "input1" #define PROTOCOL_WA_CHANNEL_2 "input2" diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index d51a6d18d6..7678c95510 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -1600,10 +1600,6 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@\x00\x31\x00\x00" ; see rusefi_config.txt comment next to 'ignitionPin2logic' which says ; this section is auto-generated by FiringOrderTSLogic.java @@FIRINGORDER@@ - field = "This is useful to have tachometer working" - field = " while converting from distributor" - field = "Dizzy out Pin", dizzySparkOutputPin, {isIgnitionEnabled == 1} - field = "Dizzy out Pin Mode", dizzySparkOutputPinMode, {isIgnitionEnabled == 1} dialog = ignitionBasic, "" field = "Enabled", isIgnitionEnabled @@ -1949,7 +1945,6 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@\x00\x31\x00\x00" dialog = allPins1_2 field = "Tachometer output Pin", tachOutputPin - field = "Dizzy out Pin", dizzySparkOutputPin field = "O2 heater pin", o2heaterPin field = "Idle Solenoid Pin", idle_solenoidPin field = "Second Idle Solenoid Pin", secondSolenoidPin @@ -2599,13 +2594,11 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@\x00\x31\x00\x00" field = "Smoothing factor", slowAdcAlpha dialog = tachSettings, "Tachometer output" - field = "!See also dizzySparkOutputPin" field = "Pin", tachOutputPin field = "Pin mode", tachOutputPinMode field = "Rise at trigger index", tachPulseTriggerIndex field = "Pulse duration is duty cycle", tachPulseDurationAsDutyCycle field = "Pulse duration", tachPulseDuractionMs -; todo: finish implementation under #907 field = "Pulse per Rev", tachPulsePerRev