From 67f305f48abffa666b0f2ada693bdcf63f49a598 Mon Sep 17 00:00:00 2001 From: rusefi Date: Mon, 7 Sep 2020 17:59:59 -0400 Subject: [PATCH] microRusEFI used as Body Control Module BCM BCU --- firmware/config/engines/custom_engine.cpp | 9 +++++++++ firmware/controllers/bench_test.cpp | 8 ++++++-- firmware/controllers/system_fsio.h | 4 ++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/firmware/config/engines/custom_engine.cpp b/firmware/config/engines/custom_engine.cpp index 724877287f..984e848cee 100644 --- a/firmware/config/engines/custom_engine.cpp +++ b/firmware/config/engines/custom_engine.cpp @@ -520,6 +520,15 @@ void mreBCM(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->consumeObdSensors = true; + engineConfiguration->fsio_setting[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; + setFsio(2, GPIO_UNASSIGNED, RPM_BELOW_USER_SETTING_3 PASS_CONFIG_PARAMETER_SUFFIX); + + #if (BOARD_TLE8888_COUNT > 0) engineConfiguration->fsioOutputPins[0] = GPIOE_14;// "37 - Injector 1" engineConfiguration->fsioOutputPins[1] = GPIOE_13;// "38 - Injector 2" diff --git a/firmware/controllers/bench_test.cpp b/firmware/controllers/bench_test.cpp index b40fa91f8d..f27c3c2c7d 100644 --- a/firmware/controllers/bench_test.cpp +++ b/firmware/controllers/bench_test.cpp @@ -139,8 +139,8 @@ static void doBenchTestFsio(int humanIndex, const char *delayStr, const char * o } /** - * delay 100, cylinder #2, 5ms ON, 1000ms OFF, repeat 2 times - * fuelbench2 100 2 5 1000 2 + * delay 100, cylinder #2, 5ms ON, 1000ms OFF, repeat 3 times + * fuelbench2 100 2 5 1000 3 */ static void fuelbench2(const char *delayStr, const char *indexStr, const char * onTimeStr, const char *offTimeStr, const char *countStr) { @@ -148,6 +148,10 @@ static void fuelbench2(const char *delayStr, const char *indexStr, const char * doRunFuel(index, delayStr, onTimeStr, offTimeStr, countStr); } +/** + * delay 100, channel #1, 5ms ON, 1000ms OFF, repeat 3 times + * fsiobench2 100 1 5 1000 3 + */ static void fsioBench2(const char *delayStr, const char *indexStr, const char * onTimeStr, const char *offTimeStr, const char *countStr) { int index = atoi(indexStr); diff --git a/firmware/controllers/system_fsio.h b/firmware/controllers/system_fsio.h index 006a7cc9aa..ae3dfaa955 100644 --- a/firmware/controllers/system_fsio.h +++ b/firmware/controllers/system_fsio.h @@ -45,6 +45,10 @@ // Human-readable: rpm > fsio_setting(1) #define RPM_ABOVE_USER_SETTING_1 "rpm 1 fsio_setting >" +// Human-readable: rpm < fsio_setting(3) +#define RPM_BELOW_USER_SETTING_3 "rpm 3 fsio_setting <" + + // Human-readable: rpm > fsio_setting(2) #define RPM_ABOVE_USER_SETTING_2 "rpm 2 fsio_setting >"