From eff8589b0af520d2a5be46a8c6f9afb72922f223 Mon Sep 17 00:00:00 2001 From: rusefi Date: Tue, 23 Apr 2024 16:42:47 -0400 Subject: [PATCH] only: board on/off const char *msg --- firmware/config/boards/hellen/hellen_common.cpp | 12 +++++++----- firmware/config/boards/hellen_meta.h | 4 ++-- firmware/controllers/lua/lua_hooks.cpp | 4 ++-- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/firmware/config/boards/hellen/hellen_common.cpp b/firmware/config/boards/hellen/hellen_common.cpp index 28a6200bce..8fca12402f 100644 --- a/firmware/config/boards/hellen/hellen_common.cpp +++ b/firmware/config/boards/hellen/hellen_common.cpp @@ -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"); } } } diff --git a/firmware/config/boards/hellen_meta.h b/firmware/config/boards/hellen_meta.h index 0b9f365da1..3a998ad578 100644 --- a/firmware/config/boards/hellen_meta.h +++ b/firmware/config/boards/hellen_meta.h @@ -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(); diff --git a/firmware/controllers/lua/lua_hooks.cpp b/firmware/controllers/lua/lua_hooks.cpp index 2451b7dc77..e243d686a2 100644 --- a/firmware/controllers/lua/lua_hooks.cpp +++ b/firmware/controllers/lua/lua_hooks.cpp @@ -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