mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2025-01-11 21:31:02 +01:00
Increase PROG repeats
refer @grbba
This commit is contained in:
parent
333410c368
commit
ff881790ac
12
DCC.cpp
12
DCC.cpp
@ -454,9 +454,10 @@ void DCC::ackManagerLoop() {
|
|||||||
case W1: // write 1 bit
|
case W1: // write 1 bit
|
||||||
{
|
{
|
||||||
if (resets<RESET_MIN) return; // try later
|
if (resets<RESET_MIN) return; // try later
|
||||||
|
if (debugMode) DIAG(F("\nW%d cv=%d bit=%d"),opcode==W1, ackManagerCv,ackManagerBitNum);
|
||||||
byte instruction = WRITE_BIT | (opcode==W1 ? BIT_ON : BIT_OFF) | ackManagerBitNum;
|
byte instruction = WRITE_BIT | (opcode==W1 ? BIT_ON : BIT_OFF) | ackManagerBitNum;
|
||||||
byte message[] = {cv1(BIT_MANIPULATE, ackManagerCv), cv2(ackManagerCv), instruction };
|
byte message[] = {cv1(BIT_MANIPULATE, ackManagerCv), cv2(ackManagerCv), instruction };
|
||||||
DCCWaveform::progTrack.schedulePacket(message, sizeof(message), 6);
|
DCCWaveform::progTrack.schedulePacket(message, sizeof(message), PROG_REPEATS);
|
||||||
DCCWaveform::progTrack.setAckPending(debugMode);
|
DCCWaveform::progTrack.setAckPending(debugMode);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -464,8 +465,9 @@ void DCC::ackManagerLoop() {
|
|||||||
case WB: // write byte
|
case WB: // write byte
|
||||||
{
|
{
|
||||||
if (resets<RESET_MIN) return; // try later
|
if (resets<RESET_MIN) return; // try later
|
||||||
|
if (debugMode) DIAG(F("\nWB cv=%d value=%d"),ackManagerCv,ackManagerByte);
|
||||||
byte message[] = {cv1(WRITE_BYTE, ackManagerCv), cv2(ackManagerCv), ackManagerByte};
|
byte message[] = {cv1(WRITE_BYTE, ackManagerCv), cv2(ackManagerCv), ackManagerByte};
|
||||||
DCCWaveform::progTrack.schedulePacket(message, sizeof(message), 6);
|
DCCWaveform::progTrack.schedulePacket(message, sizeof(message), PROG_REPEATS);
|
||||||
DCCWaveform::progTrack.setAckPending(debugMode);
|
DCCWaveform::progTrack.setAckPending(debugMode);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -473,9 +475,9 @@ void DCC::ackManagerLoop() {
|
|||||||
case VB: // Issue validate Byte packet
|
case VB: // Issue validate Byte packet
|
||||||
{
|
{
|
||||||
if (resets<RESET_MIN) return; // try later
|
if (resets<RESET_MIN) return; // try later
|
||||||
if (debugMode) DIAG(F("\nVB %d %d"),ackManagerCv,ackManagerByte);
|
if (debugMode) DIAG(F("\nVB cv=%d value=%d"),ackManagerCv,ackManagerByte);
|
||||||
byte message[] = { cv1(VERIFY_BYTE, ackManagerCv), cv2(ackManagerCv), ackManagerByte};
|
byte message[] = { cv1(VERIFY_BYTE, ackManagerCv), cv2(ackManagerCv), ackManagerByte};
|
||||||
DCCWaveform::progTrack.schedulePacket(message, sizeof(message), 5);
|
DCCWaveform::progTrack.schedulePacket(message, sizeof(message), PROG_REPEATS);
|
||||||
DCCWaveform::progTrack.setAckPending(debugMode);
|
DCCWaveform::progTrack.setAckPending(debugMode);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -487,7 +489,7 @@ void DCC::ackManagerLoop() {
|
|||||||
if (debugMode) DIAG(F("\nV%d cv=%d bit=%d"),opcode==V1, ackManagerCv,ackManagerBitNum);
|
if (debugMode) DIAG(F("\nV%d cv=%d bit=%d"),opcode==V1, ackManagerCv,ackManagerBitNum);
|
||||||
byte instruction = VERIFY_BIT | (opcode==V0?BIT_OFF:BIT_ON) | ackManagerBitNum;
|
byte instruction = VERIFY_BIT | (opcode==V0?BIT_OFF:BIT_ON) | ackManagerBitNum;
|
||||||
byte message[] = {cv1(BIT_MANIPULATE, ackManagerCv), cv2(ackManagerCv), instruction };
|
byte message[] = {cv1(BIT_MANIPULATE, ackManagerCv), cv2(ackManagerCv), instruction };
|
||||||
DCCWaveform::progTrack.schedulePacket(message, sizeof(message), 5);
|
DCCWaveform::progTrack.schedulePacket(message, sizeof(message), PROG_REPEATS);
|
||||||
DCCWaveform::progTrack.setAckPending(debugMode);
|
DCCWaveform::progTrack.setAckPending(debugMode);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
1
DCC.h
1
DCC.h
@ -107,6 +107,7 @@ private:
|
|||||||
static ACK_CALLBACK ackManagerCallback;
|
static ACK_CALLBACK ackManagerCallback;
|
||||||
static void ackManagerSetup(int cv, byte bitNumOrbyteValue, ackOp const program[], ACK_CALLBACK callback);
|
static void ackManagerSetup(int cv, byte bitNumOrbyteValue, ackOp const program[], ACK_CALLBACK callback);
|
||||||
static void ackManagerLoop();
|
static void ackManagerLoop();
|
||||||
|
static const int PROG_REPEATS=8; // repeats of programming commands (some decoders need at least 8 to be reliable)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user