From 08810dafd7eedc7cdb52c10626afb8a4b3ede97d Mon Sep 17 00:00:00 2001 From: Ash-4 <81280775+Ash-4@users.noreply.github.com> Date: Mon, 30 Aug 2021 16:37:06 -0500 Subject: [PATCH] Update retry counter will also display running total prior to its reset. RCOUNT step included in Verify program will count when Verify fails --- DCC.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/DCC.h b/DCC.h index cf1680f..c7dcbe0 100644 --- a/DCC.h +++ b/DCC.h @@ -41,6 +41,7 @@ enum ackOp : byte ITCB7, // If True callback(byte &0x7F) NAKFAIL, // if false callback(-1) FAIL, // callback(-1) + RCOUNT, // increment ackRetry counter STARTMERGE, // Clear bit and byte settings ready for merge pass MERGE, // Merge previous wack response with byte value and decrement bit number (use for readimng CV bytes) SETBIT, // sets bit number to next prog byte @@ -115,9 +116,11 @@ public: static inline void setGlobalSpeedsteps(byte s) { globalSpeedsteps = s; }; - static inline void setAckRetry(byte retry) { + static inline int16_t setAckRetry(byte retry) { ackRetry = retry; + ackRetryPSum = ackRetrySum; ackRetrySum = 0; // reset running total + return ackRetryPSum; }; private: @@ -154,6 +157,7 @@ private: static byte ackManagerRetry; static byte ackRetry; static int16_t ackRetrySum; + static int16_t ackRetryPSum; static int ackManagerWord; static byte ackManagerStash; static bool ackReceived;