Skip to content

Commit

Permalink
Caculare from preamble start instead
Browse files Browse the repository at this point in the history
  • Loading branch information
habazut committed Sep 28, 2024
1 parent cbec612 commit 212708d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions DCCWaveform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,12 @@ void DCCWaveform::interrupt2() {
if (remainingPreambles==1) promotePendingPacket();
else if (isMainTrack && railcomActive) {
// cutout has ended so its now possible to poll the railcom detectors
if (remainingPreambles==5) railcomSampleWindow=true;
// requiredPreambles is one higher that preamble length so
// if preamble length is 16 then this evaluates to 5
if (remainingPreambles==(requiredPreambles-12)) railcomSampleWindow=true;
// cutout can be ended when read
else if (remainingPreambles==14) DCCTimer::ackRailcomTimer();
// see above for requiredPreambles
else if (remainingPreambles==(requiredPreambles-3)) DCCTimer::ackRailcomTimer();
}
// Update free memory diagnostic as we don't have anything else to do this time.
// Allow for checkAck and its called functions using 22 bytes more.
Expand Down

0 comments on commit 212708d

Please sign in to comment.