diff --git a/DCC.cpp b/DCC.cpp index 7d5592b0..36463d3f 100644 --- a/DCC.cpp +++ b/DCC.cpp @@ -567,7 +567,7 @@ void DCC::loop() { void DCC::issueReminders() { // if the main track transmitter still has a pending packet, skip this time around. - if ( DCCWaveform::mainTrack.packetPending) return; + if (!DCCWaveform::mainTrack.reminderWindowOpen) return; // This loop searches for a loco in the speed table starting at nextLoco and cycling back around for (int reg=0;reg= transmitLength) { // end of transmission buffer... repeat or switch to next message @@ -270,6 +275,7 @@ void DCCWaveform::schedulePacket(const byte buffer[], byte byteCount, byte repea pendingLength = byteCount + 1; pendingRepeats = repeats; packetPending = true; + reminderWindowOpen = false; sentResetsSincePacket=0; } diff --git a/DCCWaveform.h b/DCCWaveform.h index 29d6a29e..562f1580 100644 --- a/DCCWaveform.h +++ b/DCCWaveform.h @@ -82,6 +82,7 @@ class DCCWaveform { } void schedulePacket(const byte buffer[], byte byteCount, byte repeats); volatile bool packetPending; + volatile bool reminderWindowOpen; volatile byte sentResetsSincePacket; volatile bool autoPowerOff=false; void setAckBaseline(); //prog track only