From 0582d939c5f00a8622562caddb5263ac6757dea4 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Tue, 8 Sep 2020 10:12:40 +0200 Subject: [PATCH] Fastfail if no CV there --- DCC.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/DCC.cpp b/DCC.cpp index 7645591..ad76707 100644 --- a/DCC.cpp +++ b/DCC.cpp @@ -256,9 +256,14 @@ const ackOp PROGMEM READ_CV_PROG[] = { // each bit is validated against 0 and the result inverted in MERGE // this is because there tend to be more zeros in cv values than ones. // There is no need for one validation as entire byte is validated at the end - V0, WACK, MERGE, // read and merge bit 0 - V0, WACK, MERGE, // read and merge bit 1 etc - V0, WACK, MERGE, + V0, WACK, MERGE, // read and merge first tested bit (7) + ITSKIP, // do small excursion if there was no ack + SETBIT,(ackOp)7, + V1, WACK, NAKFAIL, // test if there is an ack on the inverse of this bit (7) + SETBIT,(ackOp)6, // and abort whole test if not else continue with bit (6) + SKIPTARGET, + V0, WACK, MERGE, // read and merge second tested bit (6) + V0, WACK, MERGE, // read and merge third tested bit (5) ... V0, WACK, MERGE, V0, WACK, MERGE, V0, WACK, MERGE,