From d9bd1e75f23a64bdae36ad599743d3485df5f68e Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Fri, 21 Feb 2025 00:09:35 +0100 Subject: [PATCH] sort power output different --- CommandDistributor.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CommandDistributor.cpp b/CommandDistributor.cpp index e889f62..cdfbe2d 100644 --- a/CommandDistributor.cpp +++ b/CommandDistributor.cpp @@ -280,6 +280,9 @@ void CommandDistributor::broadcastPower() { state = '1'; } + if (state != '2') + broadcastReply(COMMAND_TYPE, F("\n"),state); + // additional info about MAIN, PROG and JOIN bool main=TrackManager::getMainPower()==POWERMODE::ON; bool prog=TrackManager::getProgPower()==POWERMODE::ON; @@ -288,7 +291,7 @@ void CommandDistributor::broadcastPower() { const FSH * reason=F(""); if (join) { reason = F(" JOIN"); // with space at start so we can append without space - broadcastReply(COMMAND_TYPE, F("\n"),reason); + broadcastReply(COMMAND_TYPE, F("\n"),reason); } else { if (main) { //reason = F("MAIN"); @@ -299,9 +302,6 @@ void CommandDistributor::broadcastPower() { broadcastReply(COMMAND_TYPE, F("\n")); } } - - if (state != '2') - broadcastReply(COMMAND_TYPE, F("\n"),state); #ifdef CD_HANDLE_RING // send '1' if all main are on, otherwise global state (which in that case is '0' or '2') broadcastReply(WITHROTTLE_TYPE, F("PPA%c\n"), main?'1': state);