From 116838b4d4a4fde47ef06562812b7f8120e0ce36 Mon Sep 17 00:00:00 2001 From: rusefillc Date: Fri, 12 Apr 2024 13:27:05 -0400 Subject: [PATCH] fix https://github.com/rusefi/hellen154hyundai/issues/140 only:hellen154hyundai --- firmware/config/boards/hellen/hellen_common.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/firmware/config/boards/hellen/hellen_common.cpp b/firmware/config/boards/hellen/hellen_common.cpp index b17cdeeb03..45ad3c5288 100644 --- a/firmware/config/boards/hellen/hellen_common.cpp +++ b/firmware/config/boards/hellen/hellen_common.cpp @@ -52,8 +52,10 @@ bool boardEnableSendWidebandInfo() { return getHellenBoardEnabled(); } +static bool hellenEnPinInitialized = false; + bool fansDisabledByBoardStatus() { - return !getHellenBoardEnabled(); + return hellenEnPinInitialized && !getHellenBoardEnabled(); } void hellenEnableEn() { @@ -65,9 +67,8 @@ void hellenDisableEn() { } void setHellenEnPin(Gpio pin, bool enableBoardOnStartUp) { - static bool initialized = false; - if (!initialized) { - initialized = true; + if (!hellenEnPinInitialized) { + hellenEnPinInitialized = true; megaEn.initPin("EN", pin); if (enableBoardOnStartUp) { hellenEnableEn();