From a3f73296e9c40d5f699d2bf632b5ff3a19958423 Mon Sep 17 00:00:00 2001 From: rusefi Date: Fri, 14 Jul 2017 22:11:04 -0400 Subject: [PATCH] better RPM examples --- firmware/config/engines/ford_festiva.cpp | 2 +- firmware/config/engines/lada_kalina.cpp | 2 +- firmware/config/engines/mitsubishi.cpp | 3 ++- firmware/controllers/system_fsio.h | 20 +++++++++++++++++++- firmware/controllers/system_fsio.txt | 12 ++++++++++++ 5 files changed, 35 insertions(+), 4 deletions(-) diff --git a/firmware/config/engines/ford_festiva.cpp b/firmware/config/engines/ford_festiva.cpp index 14d6acec7e..9817e18a18 100644 --- a/firmware/config/engines/ford_festiva.cpp +++ b/firmware/config/engines/ford_festiva.cpp @@ -232,7 +232,7 @@ void setFordEscortGt(DECLARE_ENGINE_PARAMETER_SIGNATURE) { */ boardConfiguration->fsio_setting[0] = 5000; // set_fsio_expression 1 "rpm > fsio_setting(1)" - setFsioExt(0, GPIOE_3, "rpm 1 fsio_setting >", 150 PASS_ENGINE_PARAMETER_SUFFIX); + setFsioExt(0, GPIOE_3, RPM_ABOVE_USER_SETTING_1, 150 PASS_ENGINE_PARAMETER_SUFFIX); // warning light diff --git a/firmware/config/engines/lada_kalina.cpp b/firmware/config/engines/lada_kalina.cpp index dcd1d1e8bd..1f1bdf2668 100644 --- a/firmware/config/engines/lada_kalina.cpp +++ b/firmware/config/engines/lada_kalina.cpp @@ -56,6 +56,6 @@ void setLadaKalina(DECLARE_ENGINE_PARAMETER_SIGNATURE) { */ engineConfiguration->bc.fsio_setting[0] = 500; // set_rpn_expression 1 "rpm 0 fsio_setting <" - setFsioExt(0, GPIOE_3, "rpm 1 fsio_setting <", 0 PASS_ENGINE_PARAMETER_SUFFIX); + setFsioExt(0, GPIOE_3, RPM_BELOW_USER_SETTING_1, 0 PASS_ENGINE_PARAMETER_SUFFIX); } diff --git a/firmware/config/engines/mitsubishi.cpp b/firmware/config/engines/mitsubishi.cpp index 26f82ced18..7003114bbc 100644 --- a/firmware/config/engines/mitsubishi.cpp +++ b/firmware/config/engines/mitsubishi.cpp @@ -87,7 +87,8 @@ void setMitsubishiConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { setEgoSensor(ES_Innovate_MTX_L PASS_ENGINE_PARAMETER_SUFFIX); #if EFI_FSIO || defined(__DOXYGEN__) - setFsio(0, GPIOD_11, "rpm 5500 >" PASS_ENGINE_PARAMETER_SUFFIX); + setFsioExt(0, GPIOC_9, RPM_ABOVE_6000_SOLENOID_80_DUTY, 200 PASS_ENGINE_PARAMETER_SUFFIX); + setFsioExt(1, GPIOC_7, RPM_ABOVE_2000_SOLENOID_50_DUTY, 200 PASS_ENGINE_PARAMETER_SUFFIX); #endif } diff --git a/firmware/controllers/system_fsio.h b/firmware/controllers/system_fsio.h index 84366f6400..8703d5cda4 100644 --- a/firmware/controllers/system_fsio.h +++ b/firmware/controllers/system_fsio.h @@ -1,6 +1,6 @@ // this https://en.wikipedia.org/wiki/Reverse_Polish_notation is generated automatically // from controllers/system_fsio.txt -// on 2017-06-25_01_22_09 +// on 2017-07-14_22_00_24 // // // in this file we define system FSIO expressions @@ -38,9 +38,27 @@ #define RPM_ABOVE_USER_SETTING_1 "rpm 1 fsio_setting >" // could be used for simple variable intake geometry setups or warning light or starter block +// Human-readable: rpm > fsio_setting(1) +#define RPM_ABOVE_USER_SETTING_1 "rpm 1 fsio_setting >" + // Human-readable: rpm > fsio_setting(2) #define RPM_ABOVE_USER_SETTING_2 "rpm 2 fsio_setting >" +// Human-readable: rpm > 5500 +#define RPM_ABOVE_5500_ON_OFF "rpm 5500 >" + +// Human-readable: rpm > 6000 +#define RPM_ABOVE_6000_ON_OFF "rpm 6000 >" + +// Human-readable: (rpm > 1000) * 0.7 +#define RPM_ABOVE_1000_SOLENOID_70_DUTY "rpm 1000 > 0.7 *" + +// Human-readable: (rpm > 2000) * 0.5 +#define RPM_ABOVE_2000_SOLENOID_50_DUTY "rpm 2000 > 0.5 *" + +// Human-readable: (rpm > 6000) * 0.8 +#define RPM_ABOVE_6000_SOLENOID_80_DUTY "rpm 6000 > 0.8 *" + // Human-readable: rpm < fsio_setting(1) #define RPM_BELOW_USER_SETTING_1 "rpm 1 fsio_setting <" // starter block using configurable parameter diff --git a/firmware/controllers/system_fsio.txt b/firmware/controllers/system_fsio.txt index ad516c2f67..47d599fa0a 100644 --- a/firmware/controllers/system_fsio.txt +++ b/firmware/controllers/system_fsio.txt @@ -27,8 +27,20 @@ MAIN_RELAY_LOGIC=(time_since_boot < 2) | (vbatt > 5) | in_shutdown RPM_ABOVE_USER_SETTING_1=rpm > fsio_setting(1) # could be used for simple variable intake geometry setups or warning light or starter block +RPM_ABOVE_USER_SETTING_1=rpm > fsio_setting(1) + RPM_ABOVE_USER_SETTING_2=rpm > fsio_setting(2) +RPM_ABOVE_5500_ON_OFF=rpm > 5500 + +RPM_ABOVE_6000_ON_OFF=rpm > 6000 + +RPM_ABOVE_1000_SOLENOID_70_DUTY=(rpm > 1000) * 0.7 + +RPM_ABOVE_2000_SOLENOID_50_DUTY=(rpm > 2000) * 0.5 + +RPM_ABOVE_6000_SOLENOID_80_DUTY=(rpm > 6000) * 0.8 + RPM_BELOW_USER_SETTING_1=rpm < fsio_setting(1) # starter block using configurable parameter