1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-12-25 13:41: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 "WiThrottle.h"
#include "DCCEXParser.h" #include "DCCEXParser.h"
#include "Turnouts.h" #include "Turnouts.h"
#include "CommandDistributor.h"
// Command parsing keywords // 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 (diag) DIAG(F("EXRAIL drive %d %d %d"),loco,speed,forward^invert);
if (DCCWaveform::mainTrack.getPowerMode()==POWERMODE::OFF) { if (DCCWaveform::mainTrack.getPowerMode()==POWERMODE::OFF) {
DCCWaveform::mainTrack.setPowerMode(POWERMODE::ON); DCCWaveform::mainTrack.setPowerMode(POWERMODE::ON);
Serial.println(F("<p1>")); // tell JMRI CommandDistributor::broadcastPower();
} }
DCC::setThrottle(loco,speed, forward^invert); DCC::setThrottle(loco,speed, forward^invert);
speedo=speed; speedo=speed;
@ -497,7 +498,7 @@ void RMFT2::loop2() {
DCCWaveform::mainTrack.setPowerMode(POWERMODE::OFF); DCCWaveform::mainTrack.setPowerMode(POWERMODE::OFF);
DCCWaveform::progTrack.setPowerMode(POWERMODE::OFF); DCCWaveform::progTrack.setPowerMode(POWERMODE::OFF);
DCC::setProgTrackSyncMain(false); DCC::setProgTrackSyncMain(false);
Serial.println(F("<p0>")); // Tell JMRI CommandDistributor::broadcastPower();
break; break;
case OPCODE_RESUME: case OPCODE_RESUME:
@ -598,7 +599,7 @@ void RMFT2::loop2() {
DCCWaveform::mainTrack.setPowerMode(POWERMODE::ON); DCCWaveform::mainTrack.setPowerMode(POWERMODE::ON);
DCCWaveform::progTrack.setPowerMode(POWERMODE::ON); DCCWaveform::progTrack.setPowerMode(POWERMODE::ON);
DCC::setProgTrackSyncMain(true); DCC::setProgTrackSyncMain(true);
Serial.println(F("<p1 JOIN>")); // Tell JMRI CommandDistributor::broadcastPower();
break; break;
case OPCODE_UNJOIN: case OPCODE_UNJOIN: