1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2025-07-28 18:03:45 +02:00
This commit is contained in:
Asbelos
2025-01-10 11:27:47 +00:00
parent 6f0ff49945
commit e20935848f
12 changed files with 273 additions and 146 deletions

View File

@@ -6,7 +6,7 @@
* © 2020-2023 Harald Barth
* © 2020-2021 M Steve Todd
* © 2020-2021 Fred Decker
* © 2020-2021 Chris Harlow
* © 2020-2025 Chris Harlow
* © 2022 Colin Murdoch
* All rights reserved.
*
@@ -68,7 +68,8 @@ Once a new OPCODE is decided upon, update this list.
K, Reserved for future use - Potentially Railcom
l, Loco speedbyte/function map broadcast
L, Reserved for LCC interface (implemented in EXRAIL)
m, message to throttles broadcast
m, message to throttles (broadcast output)
m, set momentum
M, Write DCC packet
n, Reserved for SensorCam
N, Reserved for Sensorcam
@@ -316,12 +317,9 @@ void DCCEXParser::parseOne(Print *stream, byte *com, RingStream * ringStream)
int16_t direction;
if (params==1) { // <t cab> display state
int16_t slot=DCC::lookupSpeedTable(p[0],false);
if (slot>=0)
CommandDistributor::broadcastLoco(slot);
else // send dummy state speed 0 fwd no functions.
StringFormatter::send(stream,F("<l %d -1 128 0>\n"),p[0]);
return;
if (p[0]<=0) break;
CommandDistributor::broadcastLoco(DCC::lookupSpeedTable(p[0],false));
return;
}
if (params == 4)
@@ -489,6 +487,19 @@ void DCCEXParser::parseOne(Print *stream, byte *com, RingStream * ringStream)
DCC::writeCVBitMain(p[0], p[1], p[2], p[3]);
return;
#endif
case 'm': // <m cabid momentum [braking]>
// <m LINEAR|POWER>
if (params==1) {
if (p[0]=="LINEAR"_hk) DCC::linearAcceleration=true;
else if (p[0]=="POWER"_hk) DCC::linearAcceleration=false;
else break;
return;
}
if (params<2 || params>3) break;
if (params==2) p[2]=p[1];
if (DCC::setMomentum(p[0],p[1],p[2])) return;
break;
case 'M': // WRITE TRANSPARENT DCC PACKET MAIN <M REG X1 ... X9>
#ifndef DISABLE_PROG
@@ -638,7 +649,7 @@ void DCCEXParser::parseOne(Print *stream, byte *com, RingStream * ringStream)
}
case '!': // ESTOP ALL <!>
DCC::setThrottle(0,1,1); // this broadcasts speed 1(estop) and sets all reminders to speed 1.
DCC::estopAll(); // this broadcasts speed 1(estop) and sets all reminders to speed 1.
return;
#ifdef HAS_ENOUGH_MEMORY