From c8bf4347c22925bf2feac8dbbdd7246dd3766283 Mon Sep 17 00:00:00 2001 From: Asbelos Date: Sun, 27 Dec 2020 21:41:00 +0000 Subject: [PATCH] Update DCCWaveform.cpp (#109) Anti-jitter Prevents main track interrupt taking a variable time which causes prog track jitter. --- DCCWaveform.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/DCCWaveform.cpp b/DCCWaveform.cpp index 123ba9e..9eb7022 100644 --- a/DCCWaveform.cpp +++ b/DCCWaveform.cpp @@ -188,13 +188,17 @@ bool DCCWaveform::interrupt1() { setSignal(LOW); state = 0; } - else state = 2; + else { + setSignal(HIGH); // jitter prevention + state = 2; + } break; case 2: // 116us after case 0 setSignal(LOW); state = 3; break; case 3: // finished sending zero bit + setSignal(LOW); // jitter prevention state = 0; break; }