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

prevent DC addr 0

This commit is contained in:
Asbelos 2022-03-18 20:03:19 +00:00
parent 75b16c9047
commit 4f2dc0934f

View File

@ -2,7 +2,7 @@
* © 2022 Chris Harlow * © 2022 Chris Harlow
* All rights reserved. * All rights reserved.
* *
* This file is part of Asbelos DCC API * This file is part of DCC++EX
* *
* This is free software: you can redistribute it and/or modify * This is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -150,7 +150,7 @@ bool TrackManager::parseJ(Print *stream, int16_t params, int16_t p[])
if (params==2 && p[1]==HASH_KEYWORD_OFF) // <= id OFF> if (params==2 && p[1]==HASH_KEYWORD_OFF) // <= id OFF>
return setTrackMode(p[0],TRACK_MODE_OFF); return setTrackMode(p[0],TRACK_MODE_OFF);
if (params==3 && p[1]==HASH_KEYWORD_DC) // <= id DC cab> if (params==3 && p[1]==HASH_KEYWORD_DC && p[2]>0) // <= id DC cab>
return setTrackMode(p[0],p[2]); return setTrackMode(p[0],p[2]);
return false; return false;