mirror of https://github.com/rusefi/rusefi.git
only: board on/off const char *msg
This commit is contained in:
parent
3e0fde22d2
commit
eff8589b0a
|
@ -63,12 +63,14 @@ static bool hellenEnPinInitialized = false;
|
|||
return !getHellenBoardEnabled();
|
||||
}
|
||||
|
||||
void hellenEnableEn() {
|
||||
megaEn.setValue(1);
|
||||
void hellenEnableEn(const char *msg) {
|
||||
efiPrintf("Turning board ON [%s]", msg);
|
||||
megaEn.setValue(1, /*isForce*/ true);
|
||||
}
|
||||
|
||||
void hellenDisableEn() {
|
||||
megaEn.setValue(0);
|
||||
void hellenDisableEn(const char *msg) {
|
||||
efiPrintf("Turning board off [%s]", msg);
|
||||
megaEn.setValue(0, /*isForce*/ true);
|
||||
}
|
||||
|
||||
void setHellenEnPin(Gpio pin, bool enableBoardOnStartUp) {
|
||||
|
@ -76,7 +78,7 @@ void setHellenEnPin(Gpio pin, bool enableBoardOnStartUp) {
|
|||
hellenEnPinInitialized = true;
|
||||
megaEn.initPin("EN", pin);
|
||||
if (enableBoardOnStartUp) {
|
||||
hellenEnableEn();
|
||||
hellenEnableEn("start-up");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,8 +18,8 @@ void setHellenEnPin(Gpio pin, bool enableBoardOnStartUp = true);
|
|||
void setHellen64MegaEnPin();
|
||||
bool isBoardWithPowerManagement();
|
||||
bool getHellenBoardEnabled();
|
||||
void hellenEnableEn();
|
||||
void hellenDisableEn();
|
||||
void hellenEnableEn(const char *msg = "");
|
||||
void hellenDisableEn(const char *msg = "");
|
||||
|
||||
void hellenBoardStandBy();
|
||||
void hellenMegaAccelerometerPreInitCS2Pin();
|
||||
|
|
|
@ -1103,11 +1103,11 @@ void configureRusefiLuaHooks(lua_State* lState) {
|
|||
|
||||
#if EFI_PROD_CODE && HW_HELLEN
|
||||
lua_register(lState, "hellenEnablePower", [](lua_State*) {
|
||||
hellenEnableEn();
|
||||
hellenEnableEn("Lua");
|
||||
return 0;
|
||||
});
|
||||
lua_register(lState, "hellenDisablePower", [](lua_State*) {
|
||||
hellenDisableEn();
|
||||
hellenDisableEn("Lua");
|
||||
return 0;
|
||||
});
|
||||
#endif // HW_HELLEN
|
||||
|
|
Loading…
Reference in New Issue