diff --git a/firmware/config/engines/custom_engine.cpp b/firmware/config/engines/custom_engine.cpp index c55a9b6797..32cd9f219f 100644 --- a/firmware/config/engines/custom_engine.cpp +++ b/firmware/config/engines/custom_engine.cpp @@ -584,12 +584,12 @@ void mreBCM(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->consumeObdSensors = true; - engineConfiguration->fsio_setting[0] = 1500; + 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->fsio_setting[2] = 1500; + engineConfiguration->scriptSetting[2] = 1500; setFsio(2, GPIO_UNASSIGNED, RPM_BELOW_USER_SETTING_3 PASS_CONFIG_PARAMETER_SUFFIX); diff --git a/firmware/config/engines/ford_festiva.cpp b/firmware/config/engines/ford_festiva.cpp index 72e29fa0df..88a798d085 100644 --- a/firmware/config/engines/ford_festiva.cpp +++ b/firmware/config/engines/ford_festiva.cpp @@ -216,7 +216,7 @@ void setFordEscortGt(DECLARE_CONFIG_PARAMETER_SIGNATURE) { * to test * set_fsio_setting 1 5000 */ - engineConfiguration->fsio_setting[0] = 5000; + engineConfiguration->scriptSetting[0] = 5000; // set_fsio_expression 1 "rpm > fsio_setting(1)" setFsioExt(0, GPIOE_3, RPM_ABOVE_USER_SETTING_1, 150 PASS_CONFIG_PARAMETER_SUFFIX); @@ -231,9 +231,9 @@ void setFordEscortGt(DECLARE_CONFIG_PARAMETER_SIGNATURE) { * set_rpn_expression 1 "rpm 0 fsio_setting > coolant 1 fsio_setting > | vbatt 2 fsio_setting < |" * eval "rpm 0 fsio_setting > coolant 1 fsio_setting > | vbatt 2 fsio_setting < |" */ - engineConfiguration->fsio_setting[1] = 6200; // RPM threshold - engineConfiguration->fsio_setting[2] = 90; // CLT threshold - engineConfiguration->fsio_setting[3] = 13.5; // voltage threshold + engineConfiguration->scriptSetting[1] = 6200; // RPM threshold + engineConfiguration->scriptSetting[2] = 90; // CLT threshold + engineConfiguration->scriptSetting[3] = 13.5; // voltage threshold // setFsio(1, GPIOC_13, "rpm 2 fsio_setting > coolant 3 fsio_setting > | vbatt 4 fsio_setting < |" PASS_CONFIG_PARAMETER_SUFFIX); setFsio(1, GPIOD_7, RPM_ABOVE_USER_SETTING_2 PASS_CONFIG_PARAMETER_SUFFIX); diff --git a/firmware/config/engines/mazda_miata_1_6.cpp b/firmware/config/engines/mazda_miata_1_6.cpp index cb6be640b3..854713aa98 100644 --- a/firmware/config/engines/mazda_miata_1_6.cpp +++ b/firmware/config/engines/mazda_miata_1_6.cpp @@ -300,12 +300,12 @@ void setMiataNA6_MAP_Frankenso(DECLARE_CONFIG_PARAMETER_SIGNATURE) { //WARNING: these indeces are off engineConfiguration->fsio_setting[0] = 6400; // RPM threshold engineConfiguration->fsio_setting[1] = 100; // CLT threshold, fsio_setting #2 - engineConfiguration->fsio_setting[2] = 13.0; // voltage threshold, fsio_setting #3 + engineConfiguration->scriptSetting[2] = 13.0; // voltage threshold, fsio_setting #3 // set_fsio_setting 4 3000 - engineConfiguration->fsio_setting[3] = 3000; // oil pressure RPM, fsio_setting #4 + engineConfiguration->scriptSetting[3] = 3000; // oil pressure RPM, fsio_setting #4 // set_fsio_setting 5 0.52 - engineConfiguration->fsio_setting[4] = 0.52; // oil pressure threshold, fsio_setting #5 + engineConfiguration->scriptSetting[4] = 0.52; // oil pressure threshold, fsio_setting #5 */ // * set_rpn_expression 1 "rpm 3 fsio_setting >" diff --git a/firmware/config/engines/mazda_miata_vvt.cpp b/firmware/config/engines/mazda_miata_vvt.cpp index e615fc49e8..4e8fcdf960 100644 --- a/firmware/config/engines/mazda_miata_vvt.cpp +++ b/firmware/config/engines/mazda_miata_vvt.cpp @@ -459,9 +459,9 @@ void setMazdaMiata2003EngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { * set_fsio_setting 3 65 * set_fsio_setting 4 15 */ - engineConfiguration->fsio_setting[1] = 6500; // #2 RPM threshold - engineConfiguration->fsio_setting[2] = 105; // #3 CLT threshold - engineConfiguration->fsio_setting[3] = 12.0; // #4 voltage threshold + engineConfiguration->scriptSetting[1] = 6500; // #2 RPM threshold + engineConfiguration->scriptSetting[2] = 105; // #3 CLT threshold + engineConfiguration->scriptSetting[3] = 12.0; // #4 voltage threshold // setFsio(1, GPIOE_6, COMBINED_WARNING_LIGHT PASS_CONFIG_PARAMETER_SUFFIX); diff --git a/firmware/config/engines/me7pnp.cpp b/firmware/config/engines/me7pnp.cpp index 10d985550f..ee577fae9b 100644 --- a/firmware/config/engines/me7pnp.cpp +++ b/firmware/config/engines/me7pnp.cpp @@ -162,7 +162,7 @@ void vag_18_Turbo(DECLARE_CONFIG_PARAMETER_SIGNATURE) { // VVT Settings engineConfiguration->vvtOutputFrequency[0] = 300; - engineConfiguration->fsio_setting[0] = 0.0; + engineConfiguration->auxPid[0].pFactor = 2; engineConfiguration->auxPid[0].iFactor = 0.005; engineConfiguration->auxPid[0].dFactor = 0; @@ -170,7 +170,7 @@ void vag_18_Turbo(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->auxPid[0].minValue = 24; engineConfiguration->auxPid[0].maxValue = 44; engineConfiguration->vvtOutputFrequency[0] = 300; - engineConfiguration->fsio_setting[0] = 0.0; + //AC Settings diff --git a/firmware/config/engines/toyota_jzs147.cpp b/firmware/config/engines/toyota_jzs147.cpp index 85a47df75a..e9d786bb0e 100644 --- a/firmware/config/engines/toyota_jzs147.cpp +++ b/firmware/config/engines/toyota_jzs147.cpp @@ -127,8 +127,8 @@ void setToyota_2jz_vics(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->debugMode = DBG_VVT; // todo: these magic values would be hardcoded once we find out proper magic values - engineConfiguration->fsio_setting[14] = 175 - 45; - engineConfiguration->fsio_setting[15] = 175 + 45; +// engineConfiguration->fsio_setting[14] = 175 - 45; +// engineConfiguration->fsio_setting[15] = 175 + 45; engineConfiguration->vvtPins[0] = GPIOE_3; // VVT solenoid control diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index 8cb76e8f93..40503a5ea5 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -732,7 +732,7 @@ static void setDefaultEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { * * fsioinfo */ - engineConfiguration->fsio_setting[0] = 5000; + engineConfiguration->scriptSetting[0] = 5000; // 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); diff --git a/firmware/controllers/trigger/trigger_central.cpp b/firmware/controllers/trigger/trigger_central.cpp index fbe1ce4cbd..469fd80e58 100644 --- a/firmware/controllers/trigger/trigger_central.cpp +++ b/firmware/controllers/trigger/trigger_central.cpp @@ -309,8 +309,8 @@ void hwHandleVvtCamSignal(trigger_value_e front, efitick_t nowNt, int index DECL switch(engineConfiguration->vvtMode[camIndex]) { case VVT_2JZ: // we do not know if we are in sync or out of sync, so we have to be looking for both possibilities - if ((currentPosition < engineConfiguration->fsio_setting[4] || currentPosition > engineConfiguration->fsio_setting[5]) && - (currentPosition < engineConfiguration->fsio_setting[4] + 360 || currentPosition > engineConfiguration->fsio_setting[5] + 360)) { + if ((currentPosition < engineConfiguration->scriptSetting[4] || currentPosition > engineConfiguration->scriptSetting[5]) && + (currentPosition < engineConfiguration->scriptSetting[4] + 360 || currentPosition > engineConfiguration->scriptSetting[5] + 360)) { // outside of the expected range return; } diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 541a43f6af..b27c5830e8 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -165,6 +165,7 @@ struct_no_prefix engine_configuration_s #define TRIGGER_INPUT_PIN_COUNT 3 #define LOGIC_ANALYZER_CHANNEL_COUNT 4 #define FSIO_COMMAND_COUNT 6 +#define SCRIPT_SETTING_COUNT 8 #define VEHICLE_INFO_SIZE 32 @@ -821,8 +822,8 @@ custom fsio_pwm_freq_t 2 scalar, U16, @OFFSET@, "Hz", 1, 0, 0, 3000, 0 custom fsio_setting_t 4 scalar, F32, @OFFSET@, "Val", 1, 0, 0, 18000, 2 - fsio_setting_t[FSIO_COMMAND_COUNT iterate] fsio_setting; - int[10] unusedSettings;;"", 1, 0, 0, 255, 0 + fsio_setting_t[SCRIPT_SETTING_COUNT iterate] scriptSetting; + int[8] unusedSettings;;"", 1, 0, 0, 255, 0 ! todo: migrate to spi_pins & combine with spi pin modes brain_pin_e spi1mosiPin; diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index c63e067e51..1306300d86 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -3437,20 +3437,20 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@\x00\x31\x00\x00" field = "" field = "" - dialog = fsioSetting, "Setting" + dialog = scriptSetting, "Setting" field = "Set number is not associated with the output number." field = "Set number, only the cell number with some numbers." - field = "set #1", fsio_setting1 - field = "set #2", fsio_setting2 - field = "set #3", fsio_setting3 - field = "set #4", fsio_setting4 - field = "set #5", fsio_setting5 - field = "set #6", fsio_setting6 + field = "set #1", scriptSetting1 + field = "set #2", scriptSetting2 + field = "set #3", scriptSetting3 + field = "set #4", scriptSetting4 + field = "set #5", scriptSetting5 + field = "set #6", scriptSetting6 dialog = fsioOutputsDialog, "FSIO outputs", border panel = fsioIO, West panel = fsioFrequency, Center - panel = fsioSetting, East + panel = scriptSetting, East dialog = fsioFormulas, "FSIO Formulas" field = "!FSIO uses Reverse Polish Notation. Please read http://rusefi.com/s/fsio"