1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-12-25 13:41:23 +01:00

Merge branch 'master' into nanoEvery2

This commit is contained in:
Asbelos 2021-01-31 10:38:19 +00:00
commit dc36cbee0c

11
DCC.cpp
View File

@ -481,9 +481,14 @@ void DCC::getLocoId(ACK_CALLBACK callback, bool blocking) {
} }
void DCC::setLocoId(int id,ACK_CALLBACK callback, bool blocking) { void DCC::setLocoId(int id,ACK_CALLBACK callback, bool blocking) {
if (id<=0 || id>9999) callback(-1); if (id<1 || id>10239) { //0x27FF according to standard
if (id<=127) ackManagerSetup(id,SHORT_LOCO_ID_PROG, callback, blocking); callback(-1);
else ackManagerSetup(id | 0xc000,LONG_LOCO_ID_PROG, callback, blocking); return;
}
if (id<=127)
ackManagerSetup(id, SHORT_LOCO_ID_PROG, callback, blocking);
else
ackManagerSetup(id | 0xc000,LONG_LOCO_ID_PROG, callback, blocking);
} }
void DCC::forgetLoco(int cab) { // removes any speed reminders for this loco void DCC::forgetLoco(int cab) { // removes any speed reminders for this loco