semi magical hellen includes

This commit is contained in:
Matthew Kennedy 2023-06-05 03:01:37 -04:00 committed by rusefillc
parent d3c88ebdad
commit 50e4537bb2
19 changed files with 52 additions and 37 deletions

View File

@ -97,8 +97,9 @@ void boardOnConfigurationChange(engine_configuration_s * /*previousConfiguration
alphaCamPullDown.setValue(engineConfiguration->boardUseCamPullDown);
}
#include "hellen_leds_144.cpp"
void setBoardConfigOverrides() {
setHellen144LedPins();
// todo: do we need this conditional on boardId or not really?
setHellenMegaEnPin();
setupVbatt();

View File

@ -140,8 +140,9 @@ void boardOnConfigurationChange(engine_configuration_s * /*previousConfiguration
alphaD5PullDown.setValue(engineConfiguration->boardUseD5PullDown);
}
#include "hellen_leds_144.cpp"
void setBoardConfigOverrides() {
setHellen144LedPins();
setupVbatt();
// todo: do we need this conditional on boardId or not really?
setHellenMegaEnPin();

View File

@ -145,8 +145,9 @@ void boardOnConfigurationChange(engine_configuration_s * /*previousConfiguration
//alphaD5PullDown.setValue(engineConfiguration->boardUseD5PullDown);
}
#include "hellen_leds_144.cpp"
void setBoardConfigOverrides() {
setHellen144LedPins();
setupVbatt();
setHellenSdCardSpi2();

View File

@ -105,8 +105,9 @@ void boardInitHardware() {
void boardOnConfigurationChange(engine_configuration_s * /*previousConfiguration*/) {
}
#include "hellen_leds_144.cpp"
void setBoardConfigOverrides() {
setHellen144LedPins();
setupVbatt();
setHellenSdCardSpi2();

View File

@ -78,8 +78,9 @@ static void setupDefaultSensorInputs() {
engineConfiguration->iat.adcChannel = H144_IN_IAT;
}
#include "hellen_leds_144.cpp"
void setBoardConfigOverrides() {
setHellen144LedPins();
setupVbatt();
setHellenSdCardSpi2();

View File

@ -62,8 +62,9 @@ void onBoardStandBy() {
hellenBoardStandBy();
}
#include "hellen_leds_144.cpp"
void setBoardConfigOverrides() {
setHellen144LedPins();
setHellenMegaEnPin();
setupVbatt();

View File

@ -68,8 +68,9 @@ static void setupDefaultSensorInputs() {
engineConfiguration->iat.adcChannel = H144_IN_IAT;
}
#include "hellen_leds_144.cpp"
void setBoardConfigOverrides() {
setHellen144LedPins();
setupVbatt();
setHellenSdCardSpi2();

View File

@ -74,8 +74,9 @@ static void setupDefaultSensorInputs() {
engineConfiguration->iat.adcChannel = H144_IN_IAT;
}
#include "hellen_leds_144.cpp"
void setBoardConfigOverrides() {
setHellen144LedPins();
setupVbatt();
setHellenSdCardSpi3();

View File

@ -73,8 +73,9 @@ static void setupDefaultSensorInputs() {
engineConfiguration->iat.adcChannel = H144_IN_IAT;
}
#include "hellen_leds_176.cpp"
void setBoardConfigOverrides() {
setHellen176LedPins();
setupVbatt();
setHellenSdCardSpi3();

View File

@ -129,8 +129,9 @@ static void setHellen128ETBConfig() {
}
}
#include "hellen_leds_176.cpp"
void setBoardConfigOverrides() {
setHellen176LedPins();
setupVbatt();
setHellenSdCardSpi2();

View File

@ -67,10 +67,11 @@ static void setupDefaultSensorInputs() {
engineConfiguration->iat.adcChannel = H144_IN_IAT;
}
#include "hellen_leds_144.cpp"
static bool isFirstInvocation = true;
void setBoardConfigOverrides() {
setHellen144LedPins();
setupVbatt();
setHellenSdCardSpi2();

View File

@ -68,8 +68,9 @@ static void setupDefaultSensorInputs() {
engineConfiguration->iat.adcChannel = H144_IN_IAT;
}
#include "hellen_leds_176.cpp"
void setBoardConfigOverrides() {
setHellen176LedPins();
setupVbatt();
setHellenSdCardSpi2();

View File

@ -64,8 +64,9 @@ static void setupDefaultSensorInputs() {
engineConfiguration->iat.adcChannel = H144_IN_IAT;
}
#include "hellen_leds_176.cpp"
void setBoardConfigOverrides() {
setHellen176LedPins();
setupVbatt();
if (engine->engineState.hellenBoardId == -1) {

View File

@ -69,8 +69,9 @@ static void setupDefaultSensorInputs() {
engineConfiguration->iat.adcChannel = H144_IN_IAT;
}
#include "hellen_leds_144.cpp"
void setBoardConfigOverrides() {
setHellen144LedPins();
setupVbatt();
// hellen88bmw uses L6205PD

View File

@ -68,8 +68,9 @@ static void setupDefaultSensorInputs() {
engineConfiguration->iat.adcChannel = H144_IN_IAT;
}
#include "hellen_leds_144.cpp"
void setBoardConfigOverrides() {
setHellen144LedPins();
setupVbatt();
setHellenSdCardSpi2();

View File

@ -5,31 +5,11 @@ void hellenWbo() {
engineConfiguration->enableAemXSeries = true;
}
void setHellen144LedPins() {
#ifdef EFI_COMMUNICATION_PIN
engineConfiguration->communicationLedPin = EFI_COMMUNICATION_PIN;
#else
engineConfiguration->communicationLedPin = H144_LED3;
#endif /* EFI_COMMUNICATION_PIN */
engineConfiguration->runningLedPin = H144_LED2;
engineConfiguration->warningLedPin = H144_LED4;
}
void setHellenCan() {
engineConfiguration->canTxPin = Gpio::D1;
engineConfiguration->canRxPin = Gpio::D0;
}
void setHellen176LedPins() {
#ifdef EFI_COMMUNICATION_PIN
engineConfiguration->communicationLedPin = EFI_COMMUNICATION_PIN;
#else
engineConfiguration->communicationLedPin = Gpio::H10;
#endif /* EFI_COMMUNICATION_PIN */
engineConfiguration->runningLedPin = Gpio::H9; // green
engineConfiguration->warningLedPin = Gpio::H11; // yellow
}
void setHellenMegaEnPin() {
static bool initialized = false;
static OutputPin megaEn;

View File

@ -0,0 +1,11 @@
Gpio getCommunicationLedPin() {
return H144_LED3; // blue
}
Gpio getRunningLedPin() {
return H144_LED2; // green
}
Gpio getWarningLedPin() {
return H144_LED4; // yellow
}

View File

@ -0,0 +1,11 @@
Gpio getCommunicationLedPin() {
return Gpio::H10; // blue
}
Gpio getRunningLedPin() {
return Gpio::H9; // green
}
Gpio getWarningLedPin() {
return Gpio::H11; // yellow
}

View File

@ -23,8 +23,6 @@
void hellenWbo();
void setHellen144LedPins();
void setHellen176LedPins();
void setHellenMegaEnPin();
void hellenBoardStandBy();
void configureHellenMegaAccCS2Pin();