From a85d1bb064e3dd6e0db3676ca1f16bd35e551cb6 Mon Sep 17 00:00:00 2001 From: rusefillc Date: Sun, 14 Nov 2021 07:30:26 -0500 Subject: [PATCH] Epic: Remove FSIO #2928 --- firmware/config/engines/custom_engine.cpp | 11 +--- firmware/config/engines/me7pnp.cpp | 2 +- firmware/controllers/core/fsio_impl.cpp | 55 ------------------- firmware/controllers/core/fsio_impl.h | 7 --- .../tests/ignition_injection/test_fuelCut.cpp | 31 ----------- 5 files changed, 3 insertions(+), 103 deletions(-) diff --git a/firmware/config/engines/custom_engine.cpp b/firmware/config/engines/custom_engine.cpp index 32cd9f219f..0e37f484dc 100644 --- a/firmware/config/engines/custom_engine.cpp +++ b/firmware/config/engines/custom_engine.cpp @@ -347,7 +347,7 @@ void setTle8888TestConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { // SF PF11 #if defined(STM32_HAS_GPIOF) && STM32_HAS_GPIOF #if EFI_FSIO - setFsio(14, GPIOF_13, "1" PASS_CONFIG_PARAMETER_SUFFIX); + // todo lua setFsio(14, GPIOF_13, "1" PASS_CONFIG_PARAMETER_SUFFIX); #endif /* EFI_FSIO */ CONFIG(etbIo[0].directionPin1) = GPIOF_15; CONFIG(etbIo[0].directionPin2) = GPIOF_14; @@ -363,7 +363,7 @@ void setTle8888TestConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { // IN2 PE4 // SF PE3 #if EFI_FSIO - setFsio(15, GPIOE_6, "1" PASS_CONFIG_PARAMETER_SUFFIX); + // todo lua setFsio(15, GPIOE_6, "1" PASS_CONFIG_PARAMETER_SUFFIX); #endif CONFIG(etbIo[0].directionPin1) = GPIOE_2; CONFIG(etbIo[0].directionPin2) = GPIOE_4; @@ -584,13 +584,6 @@ void mreBCM(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->consumeObdSensors = true; - engineConfiguration->scriptSetting[0] = 1500; - // simple warning light as default configuration - // set_fsio_expression 1 "rpm > fsio_setting(1)" - setFsio(0, GPIO_UNASSIGNED, RPM_ABOVE_USER_SETTING_1 PASS_CONFIG_PARAMETER_SUFFIX); - - engineConfiguration->scriptSetting[2] = 1500; - setFsio(2, GPIO_UNASSIGNED, RPM_BELOW_USER_SETTING_3 PASS_CONFIG_PARAMETER_SUFFIX); #if (BOARD_TLE8888_COUNT > 0) diff --git a/firmware/config/engines/me7pnp.cpp b/firmware/config/engines/me7pnp.cpp index cad2a6ae34..8238504633 100644 --- a/firmware/config/engines/me7pnp.cpp +++ b/firmware/config/engines/me7pnp.cpp @@ -144,7 +144,7 @@ void vag_18_Turbo(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->isHip9011Enabled = false; #if EFI_FSIO - setFsio (15, GPIOE_6, "1" PASS_CONFIG_PARAMETER_SUFFIX); + // todo lua setFsio (15, GPIOE_6, "1" PASS_CONFIG_PARAMETER_SUFFIX); #endif CONFIG(etbIo[1].directionPin1) = GPIOE_2; CONFIG(etbIo[1].directionPin2) = GPIOE_4; diff --git a/firmware/controllers/core/fsio_impl.cpp b/firmware/controllers/core/fsio_impl.cpp index 9296d60335..b6b376966a 100644 --- a/firmware/controllers/core/fsio_impl.cpp +++ b/firmware/controllers/core/fsio_impl.cpp @@ -238,23 +238,6 @@ static void setFsioOutputPin(const char *indexStr, const char *pinName) { #endif -/** - * index is between zero and LE_COMMAND_LENGTH-1 - */ -void setFsioExt(int index, brain_pin_e pin, const char * formula, int pwmFrequency DECLARE_CONFIG_PARAMETER_SUFFIX) { - CONFIG(fsioOutputPins)[index] = pin; - int len = strlen(formula); - if (len >= LE_COMMAND_LENGTH) { - return; - } - strcpy(config->fsioFormulas[index], formula); - CONFIG(fsioFrequency)[index] = pwmFrequency; -} - -void setFsio(int index, brain_pin_e pin, const char * exp DECLARE_CONFIG_PARAMETER_SUFFIX) { - setFsioExt(index, pin, exp, NO_PWM PASS_CONFIG_PARAMETER_SUFFIX); -} - void applyFsioConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { userPool.reset(); for (int i = 0; i < FSIO_COMMAND_COUNT; i++) { @@ -660,44 +643,6 @@ void initFsioImpl(DECLARE_ENGINE_PARAMETER_SIGNATURE) { if (isBrainPinValid(CONFIG(starterRelayDisablePin))) starterRelayDisableLogic = sysPool.parseExpression(STARTER_RELAY_LOGIC); -#if EFI_PROD_CODE - for (int i = 0; i < FSIO_COMMAND_COUNT; i++) { - brain_pin_e brainPin = CONFIG(fsioOutputPins)[i]; - - if (isBrainPinValid(brainPin)) { - int frequency = CONFIG(fsioFrequency)[i]; - if (frequency == 0) { - enginePins.fsioOutputs[i].initPin(getGpioPinName(i), CONFIG(fsioOutputPins)[i]); - } else { - startSimplePwmExt(&fsioPwm[i], "FSIOpwm", - &engine->executor, - brainPin, &enginePins.fsioOutputs[i], frequency, 0.5f); - } - } - } - - for (int i = 0; i < FSIO_COMMAND_COUNT; i++) { - brain_pin_e inputPin = CONFIG(fsioDigitalInputs)[i]; - - if (isBrainPinValid(inputPin)) { - efiSetPadMode("FSIO input", inputPin, getInputMode(engineConfiguration->fsioInputModes[i])); - } - } - - addConsoleActionSS("set_fsio_pid_output_pin", (VoidCharPtrCharPtr) setFsioPidOutputPin); - addConsoleActionSS("set_fsio_output_pin", (VoidCharPtrCharPtr) setFsioOutputPin); - addConsoleActionII("set_fsio_output_frequency", (VoidIntInt) setFsioFrequency); - addConsoleActionSS("set_fsio_digital_input_pin", (VoidCharPtrCharPtr) setFsioDigitalInputPin); - addConsoleActionSS("set_fsio_analog_input_pin", (VoidCharPtrCharPtr) setFsioAnalogInputPin); - -#endif /* EFI_PROD_CODE */ - -#if EFI_PROD_CODE || EFI_SIMULATOR - addConsoleActionSS("set_rpn_expression", applyFsioExpression); - addConsoleActionFF("set_fsio_setting", setFsioSetting); - addConsoleAction("fsioinfo", showFsioInfo); -#endif /* EFI_PROD_CODE || EFI_SIMULATOR */ - fsioTable1.init(config->fsioTable1, config->fsioTable1LoadBins, config->fsioTable1RpmBins); fsioTable2.init(config->fsioTable2, config->fsioTable2LoadBins, diff --git a/firmware/controllers/core/fsio_impl.h b/firmware/controllers/core/fsio_impl.h index 81c934cc51..44ad0375b3 100644 --- a/firmware/controllers/core/fsio_impl.h +++ b/firmware/controllers/core/fsio_impl.h @@ -22,13 +22,6 @@ typedef Map3D fsio8_Map3D_u8t expected getEngineValue(le_action_e action DECLARE_ENGINE_PARAMETER_SUFFIX); -/** - * set_fsio_output_pin 7 PE3 - * set_rpn_expression 1 "rpm 0 fsio_setting <" - */ -void setFsio(int index, brain_pin_e pin, const char * exp DECLARE_CONFIG_PARAMETER_SUFFIX); -void setFsioExt(int index, brain_pin_e pin, const char * exp, int pwmFrequency DECLARE_CONFIG_PARAMETER_SUFFIX); - void initFsioImpl(DECLARE_ENGINE_PARAMETER_SIGNATURE); void runFsio(DECLARE_ENGINE_PARAMETER_SIGNATURE); void setFsioExpression(const char *indexStr, const char *quotedLine DECLARE_CONFIG_PARAMETER_SUFFIX); diff --git a/unit_tests/tests/ignition_injection/test_fuelCut.cpp b/unit_tests/tests/ignition_injection/test_fuelCut.cpp index a9fd42140f..62cbeffa70 100644 --- a/unit_tests/tests/ignition_injection/test_fuelCut.cpp +++ b/unit_tests/tests/ignition_injection/test_fuelCut.cpp @@ -98,34 +98,3 @@ TEST(fuelCut, coasting) { assertEqualsM("inj dur#7 cut", 0.0f, ENGINE(injectionDuration)); } - -TEST(fuelCut, criticalEngineTemperature) { - WITH_ENGINE_TEST_HELPER(TEST_ENGINE); - - setupSimpleTestEngineWithMafAndTT_ONE_trigger(ð); - - engineConfiguration->useFSIO5ForCriticalIssueEngineStop = true; - setFsio(MAGIC_OFFSET_FOR_CRITICAL_ENGINE - 1, GPIOD_7, TOO_HOT_LOGIC PASS_CONFIG_PARAMETER_SUFFIX); - applyFsioConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE); - - // we need some non-zero time as getTimeNow() which would become stopEngineRequestTimeNt - eth.moveTimeForwardUs(1000); - - engine->rpmCalculator.mockRpm = 2000; - eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); - eth.engine.periodicSlowCallback(PASS_ENGINE_PARAMETER_SIGNATURE); - ASSERT_EQ(engine->stopEngineRequestTimeNt, 0); - - ASSERT_FALSE(engine->stopEngineRequestTimeNt > 0); - - Sensor::setMockValue(SensorType::Clt, 200); - eth.engine.periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE); - eth.engine.periodicSlowCallback(PASS_ENGINE_PARAMETER_SIGNATURE); - - ASSERT_TRUE(engine->stopEngineRequestTimeNt > 0); -} - -TEST(fuel, injectorFlowCorrection) { - - -}