1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-23 08:06:13 +01:00

fixup power broacast

This commit is contained in:
Asbelos 2021-12-13 21:16:58 +00:00
parent 2049cc89b3
commit 985f0e777c

View File

@ -104,12 +104,14 @@ void CommandDistributor::broadcastPower() {
bool main=DCCWaveform::mainTrack.getPowerMode()==POWERMODE::ON;
bool prog=DCCWaveform::progTrack.getPowerMode()==POWERMODE::ON;
bool join=DCCWaveform::progTrackSyncMain;
if (main && prog && join) reason=F("p1 JOIN");
else if (main && prog) reason=F("p1");
else if (main) reason=F("p1 MAIN");
else if (prog) reason=F("p1 PROG");
StringFormatter::send(broadcastBufferWriter,F("<%S>\n"),reason);
LCD(2,reason);
if (main && prog && join) reason=F("1 JOIN");
else if (main && prog) reason=F("1");
else if (main) reason=F("1 MAIN");
else if (prog) reason=F("1 PROG");
else reason=F("0");
StringFormatter::send(broadcastBufferWriter,
F("<p%S>\nPPA%c\n"),reason, main?'1':'0');
LCD(2,F("Power %S"),reason);
broadcast();
}