mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-11-23 08:06:13 +01:00
parent
0582d939c5
commit
ad4928043c
31
DCC.cpp
31
DCC.cpp
|
@ -208,49 +208,40 @@ void DCC::setProgTrackSyncMain(bool on) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const ackOp PROGMEM WRITE_BIT0_PROG[] = {
|
const ackOp PROGMEM WRITE_BIT0_PROG[] = {
|
||||||
POWERON,
|
|
||||||
BASELINE,
|
BASELINE,
|
||||||
W0,WACK,
|
W0,WACK,
|
||||||
V0, WACK, // validate bit is 0
|
V0, WACK, // validate bit is 0
|
||||||
ITC1, // if acked, callback(1)
|
ITC1, // if acked, callback(1)
|
||||||
FAIL, // callback (-1)
|
FAIL // callback (-1)
|
||||||
POWEROFF
|
|
||||||
};
|
};
|
||||||
const ackOp PROGMEM WRITE_BIT1_PROG[] = {
|
const ackOp PROGMEM WRITE_BIT1_PROG[] = {
|
||||||
POWERON,
|
|
||||||
BASELINE,
|
BASELINE,
|
||||||
W1,WACK,
|
W1,WACK,
|
||||||
V1, WACK, // validate bit is 1
|
V1, WACK, // validate bit is 1
|
||||||
ITC1, // if acked, callback(1)
|
ITC1, // if acked, callback(1)
|
||||||
FAIL, // callback (-1)
|
FAIL // callback (-1)
|
||||||
POWEROFF
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const ackOp PROGMEM READ_BIT_PROG[] = {
|
const ackOp PROGMEM READ_BIT_PROG[] = {
|
||||||
POWERON,
|
|
||||||
BASELINE,
|
BASELINE,
|
||||||
V1, WACK, // validate bit is 1
|
V1, WACK, // validate bit is 1
|
||||||
ITC1, // if acked, callback(1)
|
ITC1, // if acked, callback(1)
|
||||||
V0, WACK, // validate bit is zero
|
V0, WACK, // validate bit is zero
|
||||||
ITC0, // if acked callback 0
|
ITC0, // if acked callback 0
|
||||||
FAIL, // bit not readable
|
FAIL // bit not readable
|
||||||
POWEROFF
|
};
|
||||||
};
|
|
||||||
|
|
||||||
const ackOp PROGMEM WRITE_BYTE_PROG[] = {
|
const ackOp PROGMEM WRITE_BYTE_PROG[] = {
|
||||||
POWERON,
|
|
||||||
BASELINE,
|
BASELINE,
|
||||||
WB,WACK, // Write
|
WB,WACK, // Write
|
||||||
VB,WACK, // validate byte
|
VB,WACK, // validate byte
|
||||||
ITC1, // if ok callback (1)
|
ITC1, // if ok callback (1)
|
||||||
FAIL, // callback (-1)
|
FAIL // callback (-1)
|
||||||
POWEROFF
|
};
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
const ackOp PROGMEM READ_CV_PROG[] = {
|
const ackOp PROGMEM READ_CV_PROG[] = {
|
||||||
POWERON,
|
|
||||||
BASELINE,
|
BASELINE,
|
||||||
STARTMERGE, //clear bit and byte values ready for merge pass
|
STARTMERGE, //clear bit and byte values ready for merge pass
|
||||||
// each bit is validated against 0 and the result inverted in MERGE
|
// each bit is validated against 0 and the result inverted in MERGE
|
||||||
|
@ -270,13 +261,10 @@ const ackOp PROGMEM READ_CV_PROG[] = {
|
||||||
V0, WACK, MERGE,
|
V0, WACK, MERGE,
|
||||||
V0, WACK, MERGE,
|
V0, WACK, MERGE,
|
||||||
VB, WACK, ITCB, // verify merged byte and return it if acked ok
|
VB, WACK, ITCB, // verify merged byte and return it if acked ok
|
||||||
FAIL, // verification failed
|
FAIL }; // verification failed
|
||||||
POWEROFF
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
const ackOp PROGMEM LOCO_ID_PROG[] = {
|
const ackOp PROGMEM LOCO_ID_PROG[] = {
|
||||||
POWERON,
|
|
||||||
BASELINE,
|
BASELINE,
|
||||||
SETCV,(ackOp)29,
|
SETCV,(ackOp)29,
|
||||||
SETBIT,(ackOp)5,
|
SETBIT,(ackOp)5,
|
||||||
|
@ -321,9 +309,8 @@ const ackOp PROGMEM LOCO_ID_PROG[] = {
|
||||||
V0, WACK, MERGE,
|
V0, WACK, MERGE,
|
||||||
V0, WACK, MERGE,
|
V0, WACK, MERGE,
|
||||||
VB, WACK, ITCB, // verify merged byte and callback
|
VB, WACK, ITCB, // verify merged byte and callback
|
||||||
FAIL,
|
FAIL
|
||||||
POWEROFF
|
};
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// On the following prog-track functions blocking defaults to false.
|
// On the following prog-track functions blocking defaults to false.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user