mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2025-05-07 11:34:56 +02:00
5.4.9 CONSIST bad decoders
This commit is contained in:
parent
c79e01056e
commit
3fc3c2329a
5
DCC.cpp
5
DCC.cpp
@ -523,6 +523,7 @@ const ackOp FLASH LOCO_ID_PROG[] = {
|
|||||||
V0, WACK, MERGE,
|
V0, WACK, MERGE,
|
||||||
V0, WACK, MERGE,
|
V0, WACK, MERGE,
|
||||||
VB, WACK, NAKSKIP, // bad read of cv20, assume its 0
|
VB, WACK, NAKSKIP, // bad read of cv20, assume its 0
|
||||||
|
BAD20SKIP, // detect invalid cv20 value and ignore
|
||||||
STASHLOCOID, // keep cv 20 until we have cv19 as well.
|
STASHLOCOID, // keep cv 20 until we have cv19 as well.
|
||||||
SETCV, (ackOp)19,
|
SETCV, (ackOp)19,
|
||||||
STARTMERGE, // Setup to read cv 19
|
STARTMERGE, // Setup to read cv 19
|
||||||
@ -628,7 +629,9 @@ const ackOp FLASH CONSIST_ID_PROG[] = {
|
|||||||
BASELINE,
|
BASELINE,
|
||||||
SETCV,(ackOp)20,
|
SETCV,(ackOp)20,
|
||||||
SETBYTEH, // high byte to CV 20
|
SETBYTEH, // high byte to CV 20
|
||||||
WB,WACK, // ignore dedcoder without cv20 support
|
WB,WACK,ITSKIP,
|
||||||
|
FAIL_IF_NONZERO_NAK, // fail if writing long address to decoder that cant support it
|
||||||
|
SKIPTARGET,
|
||||||
SETCV,(ackOp)19,
|
SETCV,(ackOp)19,
|
||||||
SETBYTEL, // low byte of word
|
SETBYTEL, // low byte of word
|
||||||
WB,WACK,ITC1, // If ACK, we are done - callback(1) means Ok
|
WB,WACK,ITC1, // If ACK, we are done - callback(1) means Ok
|
||||||
|
14
DCCACK.cpp
14
DCCACK.cpp
@ -347,6 +347,20 @@ void DCCACK::loop() {
|
|||||||
opcode=GETFLASH(ackManagerProg);
|
opcode=GETFLASH(ackManagerProg);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case BAD20SKIP:
|
||||||
|
if (ackManagerByte > 120) {
|
||||||
|
// skip to SKIPTARGET if cv20 is >120 (some decoders respond with 255)
|
||||||
|
if (Diag::ACK) DIAG(F("XX cv20=%d "),ackManagerByte);
|
||||||
|
while (opcode!=SKIPTARGET) {
|
||||||
|
ackManagerProg++;
|
||||||
|
opcode=GETFLASH(ackManagerProg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case FAIL_IF_NONZERO_NAK: // fail if writing long address to decoder that cant support it
|
||||||
|
if (ackManagerByte==0) break;
|
||||||
|
callback(-4);
|
||||||
|
return;
|
||||||
case SKIPTARGET:
|
case SKIPTARGET:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
2
DCCACK.h
2
DCCACK.h
@ -58,6 +58,8 @@ enum ackOp : byte
|
|||||||
ITSKIP, // skip to SKIPTARGET if ack true
|
ITSKIP, // skip to SKIPTARGET if ack true
|
||||||
NAKSKIP, // skip to SKIPTARGET if ack false
|
NAKSKIP, // skip to SKIPTARGET if ack false
|
||||||
COMBINE1920, // combine cvs 19 and 20 and callback
|
COMBINE1920, // combine cvs 19 and 20 and callback
|
||||||
|
BAD20SKIP, // skip to SKIPTARGET if cv20 is >120 (some decoders respond with 255)
|
||||||
|
FAIL_IF_NONZERO_NAK, // fail if writing long address to decoder that cant support it
|
||||||
SKIPTARGET = 0xFF // jump to target
|
SKIPTARGET = 0xFF // jump to target
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1452,6 +1452,7 @@ void DCCEXParser::callback_Wloco(int16_t result)
|
|||||||
|
|
||||||
void DCCEXParser::callback_Wconsist(int16_t result)
|
void DCCEXParser::callback_Wconsist(int16_t result)
|
||||||
{
|
{
|
||||||
|
if (result==-4) DIAG(F("Long Consist %d not supported by decoder"),stashP[1]);
|
||||||
if (result==1) result=stashP[1]; // pick up original requested id from command
|
if (result==1) result=stashP[1]; // pick up original requested id from command
|
||||||
StringFormatter::send(getAsyncReplyStream(), F("<w CONSIST %d%S>\n"),
|
StringFormatter::send(getAsyncReplyStream(), F("<w CONSIST %d%S>\n"),
|
||||||
result, stashP[2]=="REVERSE"_hk ? F(" REVERSE") : F(""));
|
result, stashP[2]=="REVERSE"_hk ? F(" REVERSE") : F(""));
|
||||||
|
@ -3,7 +3,9 @@
|
|||||||
|
|
||||||
#include "StringFormatter.h"
|
#include "StringFormatter.h"
|
||||||
|
|
||||||
#define VERSION "5.4.8"
|
#define VERSION "5.4.9"
|
||||||
|
// 5.4.9 - Handle non-compliant decoders returning 255 for cv 20 and confusing <R> with bad consist addresses.
|
||||||
|
// - <W CONSIST longaddr> handles non-compliant decoders which NAK cv 20 writes.
|
||||||
// 5.4.8 - Bugfix: Insert idle packet at end of speed reminder loop; treat all function groups equal
|
// 5.4.8 - Bugfix: Insert idle packet at end of speed reminder loop; treat all function groups equal
|
||||||
// 5.4.7 - Bugfix: EXRAIL fix CLEAR_ALL_STASH
|
// 5.4.7 - Bugfix: EXRAIL fix CLEAR_ALL_STASH
|
||||||
// 5.4.6 - Bugfix: Do not drop further commands in same packet
|
// 5.4.6 - Bugfix: Do not drop further commands in same packet
|
||||||
|
Loading…
x
Reference in New Issue
Block a user