From b2a9022c1979dec70ff7cc5b3beba76278ce9dcd Mon Sep 17 00:00:00 2001 From: Asbelos Date: Sun, 21 Jun 2020 12:59:58 +0100 Subject: [PATCH] Preamble count to include previous stop bit --- DCCWaveform.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/DCCWaveform.cpp b/DCCWaveform.cpp index dcfb1d5..31458cf 100644 --- a/DCCWaveform.cpp +++ b/DCCWaveform.cpp @@ -52,7 +52,9 @@ DCCWaveform::DCCWaveform( byte preambleBits, bool isMain) { packetPending = false; memcpy(transmitPacket, idlePacket, sizeof(idlePacket)); state = 0; - requiredPreambles = preambleBits; + // The +1 below is to allow the preamble generator to create the stop bit + // fpr the previous packet. + requiredPreambles = preambleBits+1; bytes_sent = 0; bits_sent = 0; sampleDelay = 0;