mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-11-27 01:56:14 +01:00
ACK Timer correction
This commit is contained in:
parent
50cbcabe00
commit
4d80152ad0
6
DCC.cpp
6
DCC.cpp
|
@ -391,12 +391,12 @@ void DCC::ackManagerLoop() {
|
||||||
|
|
||||||
// not in pulse
|
// not in pulse
|
||||||
if (ackPulseStart==0) return; // keep waiting for leading edge
|
if (ackPulseStart==0) return; // keep waiting for leading edge
|
||||||
{
|
{ // detected trailing edge of pulse
|
||||||
long pulseDuration=micros()-ackPulseStart;
|
long pulseDuration=micros()-ackPulseStart;
|
||||||
// TODO handle timer wrapover
|
// TODO handle timer wrapover
|
||||||
if (pulseDuration>4500 && pulseDuration<8500) {
|
if (pulseDuration>4500 && pulseDuration<8000) {
|
||||||
ackReceived=true;
|
ackReceived=true;
|
||||||
DCCWaveform::progTrack.killRemainingRepeats(); // probabaly no need after 8.5ms!!
|
DCCWaveform::progTrack.killRemainingRepeats(); // probably no need after 8.5ms!!
|
||||||
break; // we have a genuine ACK result
|
break; // we have a genuine ACK result
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user