1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-12-25 13:41:23 +01:00

check power overload only when not ack check

This commit is contained in:
Harald Barth 2021-11-03 09:45:30 +01:00
parent 77ee57eb83
commit 836ccc143e
2 changed files with 10 additions and 6 deletions

View File

@ -44,9 +44,10 @@
#include "LCN.h" #include "LCN.h"
#include "freeMemory.h" #include "freeMemory.h"
#if __has_include ( "myAutomation.h") // not yet in this branch
#include "RMFT.h" //#if __has_include ( "myAutomation.h")
#define RMFT_ACTIVE // #include "RMFT.h"
#endif // #define RMFT_ACTIVE
//#endif
#endif #endif

View File

@ -60,8 +60,6 @@ volatile bool ackflag = 0;
#endif #endif
void IRAM_ATTR DCCWaveform::loop(bool ackManagerActive) { void IRAM_ATTR DCCWaveform::loop(bool ackManagerActive) {
mainTrack.checkPowerOverload(false);
progTrack.checkPowerOverload(ackManagerActive);
#ifdef SLOW_ANALOG_READ #ifdef SLOW_ANALOG_READ
if (ackflag) { if (ackflag) {
progTrack.checkAck(); progTrack.checkAck();
@ -69,8 +67,13 @@ void IRAM_ATTR DCCWaveform::loop(bool ackManagerActive) {
portENTER_CRITICAL(&timerMux); portENTER_CRITICAL(&timerMux);
ackflag = 0; ackflag = 0;
portEXIT_CRITICAL(&timerMux); portEXIT_CRITICAL(&timerMux);
} else {
progTrack.checkPowerOverload(ackManagerActive);
} }
#else
progTrack.checkPowerOverload(ackManagerActive);
#endif #endif
mainTrack.checkPowerOverload(false);
} }
void IRAM_ATTR DCCWaveform::interruptHandler() { void IRAM_ATTR DCCWaveform::interruptHandler() {