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

Emit EXRAIL power changes

This commit is contained in:
Asbelos 2021-12-07 00:57:08 +00:00
parent 18695888dd
commit 2049cc89b3

View File

@ -24,6 +24,7 @@
#include "WiThrottle.h"
#include "DCCEXParser.h"
#include "Turnouts.h"
#include "CommandDistributor.h"
// Command parsing keywords
@ -340,7 +341,7 @@ void RMFT2::driveLoco(byte speed) {
if (diag) DIAG(F("EXRAIL drive %d %d %d"),loco,speed,forward^invert);
if (DCCWaveform::mainTrack.getPowerMode()==POWERMODE::OFF) {
DCCWaveform::mainTrack.setPowerMode(POWERMODE::ON);
Serial.println(F("<p1>")); // tell JMRI
CommandDistributor::broadcastPower();
}
DCC::setThrottle(loco,speed, forward^invert);
speedo=speed;
@ -497,7 +498,7 @@ void RMFT2::loop2() {
DCCWaveform::mainTrack.setPowerMode(POWERMODE::OFF);
DCCWaveform::progTrack.setPowerMode(POWERMODE::OFF);
DCC::setProgTrackSyncMain(false);
Serial.println(F("<p0>")); // Tell JMRI
CommandDistributor::broadcastPower();
break;
case OPCODE_RESUME:
@ -598,7 +599,7 @@ void RMFT2::loop2() {
DCCWaveform::mainTrack.setPowerMode(POWERMODE::ON);
DCCWaveform::progTrack.setPowerMode(POWERMODE::ON);
DCC::setProgTrackSyncMain(true);
Serial.println(F("<p1 JOIN>")); // Tell JMRI
CommandDistributor::broadcastPower();
break;
case OPCODE_UNJOIN: