1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-27 01:56:14 +01:00

Update DCCWaveform.cpp (#109)

Anti-jitter
Prevents main track interrupt taking a variable time which causes prog track jitter.
This commit is contained in:
Asbelos 2020-12-27 21:41:00 +00:00 committed by GitHub
parent 883ac61fc7
commit c8bf4347c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -188,13 +188,17 @@ bool DCCWaveform::interrupt1() {
setSignal(LOW); setSignal(LOW);
state = 0; state = 0;
} }
else state = 2; else {
setSignal(HIGH); // jitter prevention
state = 2;
}
break; break;
case 2: // 116us after case 0 case 2: // 116us after case 0
setSignal(LOW); setSignal(LOW);
state = 3; state = 3;
break; break;
case 3: // finished sending zero bit case 3: // finished sending zero bit
setSignal(LOW); // jitter prevention
state = 0; state = 0;
break; break;
} }