2021-11-24 04:47:51 -08:00
|
|
|
#include "pch.h"
|
|
|
|
|
|
|
|
#include "main_relay.h"
|
|
|
|
|
|
|
|
void MainRelayController::onSlowCallback() {
|
|
|
|
isBenchTest = engine->isInMainRelayBench();
|
|
|
|
|
|
|
|
#if EFI_MAIN_RELAY_CONTROL
|
|
|
|
mainRelayState = isBenchTest | hasIgnitionVoltage;
|
|
|
|
#else // not EFI_MAIN_RELAY_CONTROL
|
|
|
|
mainRelayState = !isBenchTest;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
enginePins.mainRelay.setValue(mainRelayState);
|
|
|
|
}
|
2021-12-07 18:28:04 -08:00
|
|
|
|
|
|
|
void MainRelayController::onIgnitionStateChanged(bool ignitionOn) {
|
|
|
|
hasIgnitionVoltage = ignitionOn;
|
|
|
|
}
|