From 836ccc143e98c783a6eb86d21d13fcf8d21bb951 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Wed, 3 Nov 2021 09:45:30 +0100 Subject: [PATCH] check power overload only when not ack check --- DCCEX.h | 9 +++++---- DCCWaveform.cpp | 7 +++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/DCCEX.h b/DCCEX.h index 8ff2f51..fa7f8b8 100644 --- a/DCCEX.h +++ b/DCCEX.h @@ -44,9 +44,10 @@ #include "LCN.h" #include "freeMemory.h" -#if __has_include ( "myAutomation.h") - #include "RMFT.h" - #define RMFT_ACTIVE -#endif +// not yet in this branch +//#if __has_include ( "myAutomation.h") +// #include "RMFT.h" +// #define RMFT_ACTIVE +//#endif #endif diff --git a/DCCWaveform.cpp b/DCCWaveform.cpp index a8b83e4..94cd91d 100644 --- a/DCCWaveform.cpp +++ b/DCCWaveform.cpp @@ -60,8 +60,6 @@ volatile bool ackflag = 0; #endif void IRAM_ATTR DCCWaveform::loop(bool ackManagerActive) { - mainTrack.checkPowerOverload(false); - progTrack.checkPowerOverload(ackManagerActive); #ifdef SLOW_ANALOG_READ if (ackflag) { progTrack.checkAck(); @@ -69,8 +67,13 @@ void IRAM_ATTR DCCWaveform::loop(bool ackManagerActive) { portENTER_CRITICAL(&timerMux); ackflag = 0; portEXIT_CRITICAL(&timerMux); + } else { + progTrack.checkPowerOverload(ackManagerActive); } +#else + progTrack.checkPowerOverload(ackManagerActive); #endif + mainTrack.checkPowerOverload(false); } void IRAM_ATTR DCCWaveform::interruptHandler() {