Skip to content

Commit e1f46c6

Browse files
committed
ESP32: Railcom::setLoco() when submitting packet
1 parent 1355687 commit e1f46c6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

DCCWaveformRMT.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "DCCWaveform.h"
2727
#include "DCCACK.h"
2828
#include "TrackManager.h"
29+
#include "Railcom.h"
2930

3031
DCCWaveform DCCWaveform::mainTrack(PREAMBLE_BITS_MAIN, true);
3132
DCCWaveform DCCWaveform::progTrack(PREAMBLE_BITS_PROG, false);
@@ -94,6 +95,9 @@ void DCCWaveform::schedulePacket(const byte buffer[], byte byteCount, byte repea
9495
do {
9596
ret = rmtchannel->RMTfillData(pendingPacket, pendingLength, pendingRepeats);
9697
} while(ret > 0);
98+
if (isMainTrack && ret == 0) { // packet will be next packet out
99+
Railcom::setLoco(pendingPacket[0],pendingPacket[1]);
100+
}
97101
}
98102
}
99103

0 commit comments

Comments
 (0)