1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-27 01:56:14 +01:00

ACK MANAGER lazy decoders

Double check lazy decoders that do not ACK when writing.
This commit is contained in:
Asbelos 2021-03-24 09:51:31 +00:00
parent f8f80b18ca
commit a8c9c2f98d

23
DCC.cpp
View File

@ -315,10 +315,9 @@ const ackOp FLASH READ_BIT_PROG[] = {
const ackOp FLASH WRITE_BYTE_PROG[] = { const ackOp FLASH WRITE_BYTE_PROG[] = {
BASELINE, BASELINE,
WB,WACK, // Write WB,WACK,ITC1, // Write and callback(1) if ACK
// VB,WACK, // validate byte, unnecessary after write gave ACK. // handle decoders that dont ack a write
// Also, in some cases, like decoder reset, the value read back is not the same as written. VB,WACK,ITC1, // validate byte and callback(1) if correct
ITC1, // if ok callback (1)
FAIL // callback (-1) FAIL // callback (-1)
}; };
@ -444,14 +443,15 @@ const ackOp FLASH SHORT_LOCO_ID_PROG[] = {
BASELINE, BASELINE,
SETCV,(ackOp)19, SETCV,(ackOp)19,
SETBYTE, (ackOp)0, SETBYTE, (ackOp)0,
WB,WACK, // ignore router without cv19 support WB,WACK, // ignore dedcoder without cv19 support
// Turn off long address flag // Turn off long address flag
SETCV,(ackOp)29, SETCV,(ackOp)29,
SETBIT,(ackOp)5, SETBIT,(ackOp)5,
W0,WACK,NAKFAIL, W0,WACK,
V0,WACK,NAKFAIL,
SETCV, (ackOp)1, SETCV, (ackOp)1,
SETBYTEL, // low byte of word SETBYTEL, // low byte of word
WB,WACK,NAKFAIL, WB,WACK, // some decoders don't ACK writes
VB,WACK,ITCB, VB,WACK,ITCB,
FAIL FAIL
}; };
@ -461,20 +461,21 @@ const ackOp FLASH LONG_LOCO_ID_PROG[] = {
// Clear consist CV 19 // Clear consist CV 19
SETCV,(ackOp)19, SETCV,(ackOp)19,
SETBYTE, (ackOp)0, SETBYTE, (ackOp)0,
WB,WACK, // ignore router without cv19 support WB,WACK, // ignore decoder without cv19 support
// Turn on long address flag cv29 bit 5 // Turn on long address flag cv29 bit 5
SETCV,(ackOp)29, SETCV,(ackOp)29,
SETBIT,(ackOp)5, SETBIT,(ackOp)5,
W1,WACK,NAKFAIL, W1,WACK,
V1,WACK,NAKFAIL,
// Store high byte of address in cv 17 // Store high byte of address in cv 17
SETCV, (ackOp)17, SETCV, (ackOp)17,
SETBYTEH, // high byte of word SETBYTEH, // high byte of word
WB,WACK,NAKFAIL, WB,WACK,
VB,WACK,NAKFAIL, VB,WACK,NAKFAIL,
// store // store
SETCV, (ackOp)18, SETCV, (ackOp)18,
SETBYTEL, // low byte of word SETBYTEL, // low byte of word
WB,WACK,NAKFAIL, WB,WACK,
VB,WACK,ITC1, // callback(1) means Ok VB,WACK,ITC1, // callback(1) means Ok
FAIL FAIL
}; };