From dc13a0e209cd7b1c58088f738d68908e2f29a31b Mon Sep 17 00:00:00 2001 From: Asbelos Date: Fri, 3 Jul 2020 17:12:53 +0100 Subject: [PATCH] Update DCCWaveform.cpp --- DCCWaveform.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/DCCWaveform.cpp b/DCCWaveform.cpp index bdeacc4..77ef23a 100644 --- a/DCCWaveform.cpp +++ b/DCCWaveform.cpp @@ -140,6 +140,11 @@ bool DCCWaveform::interrupt1() { state = 0; break; } + + // ACK check is prog track only and will only be checked if + // this is not case(0) which needs relatively expensive packet change code to be called. + if (ackPending) checkAck(); + return false; } @@ -189,12 +194,7 @@ void DCCWaveform::interrupt2() { if (sentResetsSincePacket<250) sentResetsSincePacket++; } } - } - - // ACK check is prog track only and will only be checked if bits_sent=4 ... - // This means only once per 9-bit-byte AND never at the same cycle as the - // relatively expensive packet change code just above. - if (ackPending && bits_sent==4) checkAck(); + } }