diff --git a/firmware/config/boards/hellen/hellen-nb1/board_configuration.cpp b/firmware/config/boards/hellen/hellen-nb1/board_configuration.cpp index 089a77455c..0f7b246867 100644 --- a/firmware/config/boards/hellen/hellen-nb1/board_configuration.cpp +++ b/firmware/config/boards/hellen/hellen-nb1/board_configuration.cpp @@ -12,6 +12,7 @@ #include "pch.h" #include "fsio_impl.h" +#include "custom_engine.h" static void setInjectorPins() { engineConfiguration->injectionPins[0] = GPIOG_7; @@ -56,16 +57,6 @@ static void setIgnitionPins() { engineConfiguration->ignitionPinMode = OM_DEFAULT; } -static void setLedPins() { -#ifdef EFI_COMMUNICATION_PIN - engineConfiguration->communicationLedPin = EFI_COMMUNICATION_PIN; -#else - engineConfiguration->communicationLedPin = GPIOH_10; -#endif /* EFI_COMMUNICATION_PIN */ - engineConfiguration->runningLedPin = GPIOH_9; // green - engineConfiguration->warningLedPin = GPIOH_11; // yellow -} - static void setupVbatt() { // 4.7k high side/4.7k low side = 2.0 ratio divider engineConfiguration->analogInputDividerCoefficient = 2.0f; @@ -104,7 +95,7 @@ static void setupDefaultSensorInputs() { } void setBoardConfigOverrides(void) { - setLedPins(); + setHellen144LedPins(); setupVbatt(); setSdCardConfigurationOverrides(); diff --git a/firmware/config/boards/hellen/hellen121nissan/board_configuration.cpp b/firmware/config/boards/hellen/hellen121nissan/board_configuration.cpp index a6230e1c99..f87536a11c 100644 --- a/firmware/config/boards/hellen/hellen121nissan/board_configuration.cpp +++ b/firmware/config/boards/hellen/hellen121nissan/board_configuration.cpp @@ -12,6 +12,7 @@ #include "pch.h" #include "fsio_impl.h" +#include "custom_engine.h" static void hellenWbo() { engineConfiguration->enableAemXSeries = true; @@ -50,16 +51,6 @@ static void setIgnitionPins() { engineConfiguration->ignitionPinMode = OM_DEFAULT; } -static void setLedPins() { -#ifdef EFI_COMMUNICATION_PIN - engineConfiguration->communicationLedPin = EFI_COMMUNICATION_PIN; -#else - engineConfiguration->communicationLedPin = GPIOE_7; -#endif /* EFI_COMMUNICATION_PIN */ - engineConfiguration->runningLedPin = GPIOG_1; // green - engineConfiguration->warningLedPin = GPIOE_8; // yellow -} - static void setupVbatt() { // 4.7k high side/4.7k low side = 2.0 ratio divider engineConfiguration->analogInputDividerCoefficient = 2.0f; @@ -104,7 +95,7 @@ static void setupDefaultSensorInputs() { } void setBoardConfigOverrides(void) { - setLedPins(); + setHellen144LedPins(); setupVbatt(); setSdCardConfigurationOverrides(); diff --git a/firmware/config/boards/hellen/hellen154hyundai/board_configuration.cpp b/firmware/config/boards/hellen/hellen154hyundai/board_configuration.cpp index f8d227d5ce..08967b9d57 100644 --- a/firmware/config/boards/hellen/hellen154hyundai/board_configuration.cpp +++ b/firmware/config/boards/hellen/hellen154hyundai/board_configuration.cpp @@ -12,6 +12,7 @@ #include "pch.h" #include "fsio_impl.h" +#include "custom_engine.h" static void hellenWbo() { engineConfiguration->enableAemXSeries = true; @@ -50,16 +51,6 @@ static void setIgnitionPins() { engineConfiguration->ignitionPinMode = OM_DEFAULT; } -static void setLedPins() { -#ifdef EFI_COMMUNICATION_PIN - engineConfiguration->communicationLedPin = EFI_COMMUNICATION_PIN; -#else - engineConfiguration->communicationLedPin = GPIOE_7; -#endif /* EFI_COMMUNICATION_PIN */ - engineConfiguration->runningLedPin = GPIOG_1; // green - engineConfiguration->warningLedPin = GPIOE_8; // yellow -} - static void setupVbatt() { // 4.7k high side/4.7k low side = 2.0 ratio divider engineConfiguration->analogInputDividerCoefficient = 2.0f; @@ -102,7 +93,7 @@ static void setupDefaultSensorInputs() { } void setBoardConfigOverrides(void) { - setLedPins(); + setHellen144LedPins(); setupVbatt(); setSdCardConfigurationOverrides(); diff --git a/firmware/config/boards/hellen/hellen64_miataNA6_94/board_configuration.cpp b/firmware/config/boards/hellen/hellen64_miataNA6_94/board_configuration.cpp index 92945b4ea1..2c86b95fc4 100644 --- a/firmware/config/boards/hellen/hellen64_miataNA6_94/board_configuration.cpp +++ b/firmware/config/boards/hellen/hellen64_miataNA6_94/board_configuration.cpp @@ -12,6 +12,7 @@ #include "pch.h" #include "fsio_impl.h" +#include "custom_engine.h" static void setInjectorPins() { engineConfiguration->injectionPins[0] = GPIOG_7; @@ -56,16 +57,6 @@ static void setIgnitionPins() { engineConfiguration->ignitionPinMode = OM_DEFAULT; } -static void setLedPins() { -#ifdef EFI_COMMUNICATION_PIN - engineConfiguration->communicationLedPin = EFI_COMMUNICATION_PIN; -#else - engineConfiguration->communicationLedPin = GPIOH_10; -#endif /* EFI_COMMUNICATION_PIN */ - engineConfiguration->runningLedPin = GPIOH_9; // green - engineConfiguration->warningLedPin = GPIOH_11; // yellow -} - static void setupVbatt() { // 4.7k high side/4.7k low side = 2.0 ratio divider engineConfiguration->analogInputDividerCoefficient = 2.0f; @@ -104,7 +95,7 @@ static void setupDefaultSensorInputs() { } void setBoardConfigOverrides(void) { - setLedPins(); + setHellen176LedPins(); setupVbatt(); setSdCardConfigurationOverrides(); diff --git a/firmware/config/boards/hellen/hellen72/board_configuration.cpp b/firmware/config/boards/hellen/hellen72/board_configuration.cpp index a938a063f5..4f6d3a3c15 100644 --- a/firmware/config/boards/hellen/hellen72/board_configuration.cpp +++ b/firmware/config/boards/hellen/hellen72/board_configuration.cpp @@ -12,6 +12,7 @@ #include "pch.h" #include "fsio_impl.h" +#include "custom_engine.h" static void hellenWbo() { engineConfiguration->enableAemXSeries = true; @@ -55,16 +56,6 @@ static void setIgnitionPins() { engineConfiguration->ignitionPinMode = OM_DEFAULT; } -static void setLedPins() { -#ifdef EFI_COMMUNICATION_PIN - engineConfiguration->communicationLedPin = EFI_COMMUNICATION_PIN; -#else - engineConfiguration->communicationLedPin = GPIOH_10; -#endif /* EFI_COMMUNICATION_PIN */ - engineConfiguration->runningLedPin = GPIOH_9; // green - engineConfiguration->warningLedPin = GPIOH_11; // yellow -} - static void setupVbatt() { // 4.7k high side/4.7k low side = 2.0 ratio divider engineConfiguration->analogInputDividerCoefficient = 2.0f; @@ -104,7 +95,7 @@ static void setupDefaultSensorInputs() { } void setBoardConfigOverrides(void) { - setLedPins(); + setHellen176LedPins(); setupVbatt(); setSdCardConfigurationOverrides(); diff --git a/firmware/config/engines/custom_engine.cpp b/firmware/config/engines/custom_engine.cpp index f77299d686..4404573a27 100644 --- a/firmware/config/engines/custom_engine.cpp +++ b/firmware/config/engines/custom_engine.cpp @@ -778,3 +778,23 @@ void setHellenDefaultVrThresholds(DECLARE_CONFIG_PARAMETER_SIGNATURE) { setLinearCurve(engineConfiguration->vrThreshold[i].values, PACK_PERCENT_BYTE_MULT * 0.6, PACK_PERCENT_BYTE_MULT * 1.2, PACK_PERCENT_BYTE_MULT * 0.1); } } + +void setHellen144LedPins() { +#ifdef EFI_COMMUNICATION_PIN + engineConfiguration->communicationLedPin = EFI_COMMUNICATION_PIN; +#else + engineConfiguration->communicationLedPin = GPIOE_7; +#endif /* EFI_COMMUNICATION_PIN */ + engineConfiguration->runningLedPin = GPIOG_1; + engineConfiguration->warningLedPin = GPIOE_8; +} + +void setHellen176LedPins() { +#ifdef EFI_COMMUNICATION_PIN + engineConfiguration->communicationLedPin = EFI_COMMUNICATION_PIN; +#else + engineConfiguration->communicationLedPin = GPIOH_10; +#endif /* EFI_COMMUNICATION_PIN */ + engineConfiguration->runningLedPin = GPIOH_9; // green + engineConfiguration->warningLedPin = GPIOH_11; // yellow +} diff --git a/firmware/config/engines/custom_engine.h b/firmware/config/engines/custom_engine.h index af451a34f5..b7e6d6cddf 100644 --- a/firmware/config/engines/custom_engine.h +++ b/firmware/config/engines/custom_engine.h @@ -35,3 +35,6 @@ void setBoschHDEV_5_injectors(DECLARE_CONFIG_PARAMETER_SIGNATURE); void setHellen72etb(DECLARE_CONFIG_PARAMETER_SIGNATURE); void setRotary(DECLARE_CONFIG_PARAMETER_SIGNATURE); void setVrThresholdTest(DECLARE_CONFIG_PARAMETER_SIGNATURE); + +void setHellen144LedPins(); +void setHellen176LedPins();