mirror of https://github.com/rusefi/rusefi-1.git
20 lines
444 B
C++
20 lines
444 B
C++
#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);
|
|
}
|
|
|
|
void MainRelayController::onIgnitionStateChanged(bool ignitionOn) {
|
|
hasIgnitionVoltage = ignitionOn;
|
|
}
|