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

Allow negative route ids.

This commit is contained in:
Asbelos 2022-04-18 16:46:13 +01:00
parent 920fcbc095
commit 64cae26333

View File

@ -255,11 +255,14 @@ void WiThrottle::parse(RingStream * stream, byte * cmdx) {
int WiThrottle::getInt(byte * cmd) {
int i=0;
bool negate=cmd[0]=='-';
if (negate) cmd++;
while (cmd[0]>='0' && cmd[0]<='9') {
i=i*10 + (cmd[0]-'0');
cmd++;
}
return i;
if (negate) i=0-i;
return i ;
}
int WiThrottle::getLocoId(byte * cmd) {