mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2025-07-28 09:53:45 +02:00
Squashed commit of the following:
commitb34205b142
Merge:8703248
2829716
Author: Neil McKechnie <75813993+Neil-McK@users.noreply.github.com> Date: Mon Aug 23 10:05:54 2021 +0100 Merge branch 'EX-RAIL' into ackRetry commit8703248c49
Author: Ash-4 <81280775+Ash-4@users.noreply.github.com> Date: Sun Aug 22 16:47:38 2021 -0500 ACK RETRY max 255 with fallback to 3 if greater And includes LCD lines for power and ACK diags. commitf5d4522ed7
Author: Ash-4 <81280775+Ash-4@users.noreply.github.com> Date: Sun Aug 22 16:40:13 2021 -0500 ACK RETRY updated datatypes commit1dbf236697
Author: Ash-4 <81280775+Ash-4@users.noreply.github.com> Date: Sun Aug 22 16:35:14 2021 -0500 ACK RETRY updated datatypes commitd93584e9a4
Author: Ash-4 <81280775+Ash-4@users.noreply.github.com> Date: Sun Aug 22 13:16:24 2021 -0500 ACK RETRY updated default is 2 retries. commitf58ebac670
Author: Ash-4 <81280775+Ash-4@users.noreply.github.com> Date: Sat Aug 21 16:43:21 2021 -0500 ACK RETRY is 3 or less (default is 1) commit08350b215a
Author: Ash-4 <81280775+Ash-4@users.noreply.github.com> Date: Sat Aug 21 11:55:17 2021 -0500 ACK RETRY LCD display update. lcd(0, F("RETRY %d %d %d %d"), ackManagerCv, ackManagerRetry, ackRetry, ackRetrySum); commit11cd216017
Author: Ash-4 <81280775+Ash-4@users.noreply.github.com> Date: Sat Aug 21 00:54:28 2021 -0500 ACK RETRY ACK retry code added to ackManagerSetup and callback. The default is <D ACK RETRY 1>. For ACK tuning, set retry to zero. Retry count is captured on the LCD display, and lines in the serial monitor. commitb67027a1ed
Author: Ash-4 <81280775+Ash-4@users.noreply.github.com> Date: Sat Aug 21 00:33:01 2021 -0500 ACK RETRY variables added commit34d2ab3543
Author: Ash-4 <81280775+Ash-4@users.noreply.github.com> Date: Sat Aug 21 00:23:34 2021 -0500 Update DCCEXParser.cpp LCD lines added to display power commands and ACK settings, when updated. Also new command <D ACK RETRY 1>. commit8ca4011cb0
Author: Ash-4 <81280775+Ash-4@users.noreply.github.com> Date: Fri Aug 20 23:58:13 2021 -0500 Update CommandStation-EX.ino Update LCD row number for Ready and Free RAM. commit6571138389
Author: Harald Barth <haba@kth.se> Date: Sun Aug 1 22:08:34 2021 +0200 optimize command parser for size commitc4f659243e
Author: Harald Barth <haba@kth.se> Date: Sun Aug 1 15:07:06 2021 +0200 optimize for loops for size (and speed) commit55b7091d5a
Author: Harald Barth <haba@kth.se> Date: Sun Aug 1 12:45:29 2021 +0200 take less progmem for messages commit6d7c1925b0
Author: Harald Barth <haba@kth.se> Date: Sun Aug 1 11:56:12 2021 +0200 only pragma -O3 critical functions
This commit is contained in:
15
DCC.cpp
15
DCC.cpp
@@ -683,9 +683,13 @@ int DCC::nextLoco = 0;
|
||||
|
||||
//ACK MANAGER
|
||||
ackOp const * DCC::ackManagerProg;
|
||||
ackOp const * DCC::ackManagerProgStart;
|
||||
byte DCC::ackManagerByte;
|
||||
byte DCC::ackManagerStash;
|
||||
int DCC::ackManagerWord;
|
||||
byte DCC::ackManagerRetry;
|
||||
byte DCC::ackRetry = 2;
|
||||
int16_t DCC::ackRetrySum;
|
||||
int DCC::ackManagerCv;
|
||||
byte DCC::ackManagerBitNum;
|
||||
bool DCC::ackReceived;
|
||||
@@ -718,6 +722,8 @@ void DCC::ackManagerSetup(int cv, byte byteValueOrBitnum, ackOp const program[]
|
||||
|
||||
ackManagerCv = cv;
|
||||
ackManagerProg = program;
|
||||
ackManagerProgStart = program;
|
||||
ackManagerRetry = ackRetry;
|
||||
ackManagerByte = byteValueOrBitnum;
|
||||
ackManagerBitNum=byteValueOrBitnum;
|
||||
ackManagerCallback = callback;
|
||||
@@ -901,6 +907,15 @@ void DCC::ackManagerLoop() {
|
||||
}
|
||||
|
||||
void DCC::callback(int value) {
|
||||
// check for automatic retry
|
||||
if (value == -1 && ackManagerRetry > 0) {
|
||||
ackRetrySum ++;
|
||||
StringFormatter::lcd(0, F("RETRY %d %d %d %d"), ackManagerCv, ackManagerRetry, ackRetry, ackRetrySum);
|
||||
ackManagerRetry --;
|
||||
ackManagerProg = ackManagerProgStart;
|
||||
return;
|
||||
}
|
||||
|
||||
static unsigned long callbackStart;
|
||||
// We are about to leave programming mode
|
||||
// Rule 1: If we have written to a decoder we must maintain power for 100mS
|
||||
|
Reference in New Issue
Block a user