mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-11-24 00:26:13 +01:00
Compare commits
No commits in common. "8eec85edcf742b42bdd53517baa9b271463151ca" and "be218d3032967a64326a1daddf954cf0baa8b35c" have entirely different histories.
8eec85edcf
...
be218d3032
|
@ -209,7 +209,9 @@ int16_t CommandDistributor::retClockTime() {
|
||||||
|
|
||||||
void CommandDistributor::broadcastLoco(byte slot) {
|
void CommandDistributor::broadcastLoco(byte slot) {
|
||||||
DCC::LOCO * sp=&DCC::speedTable[slot];
|
DCC::LOCO * sp=&DCC::speedTable[slot];
|
||||||
broadcastReply(COMMAND_TYPE, F("<l %d %d %d %l>\n"), sp->loco,slot,sp->speedCode,sp->functions);
|
uint32_t func = sp->functions;
|
||||||
|
func = func & 0x1fffffff; // mask out bits 0-28
|
||||||
|
broadcastReply(COMMAND_TYPE, F("<l %d %d %d %l>\n"), sp->loco,slot,sp->speedCode,func);
|
||||||
#ifdef SABERTOOTH
|
#ifdef SABERTOOTH
|
||||||
if (Serial2 && sp->loco == SABERTOOTH) {
|
if (Serial2 && sp->loco == SABERTOOTH) {
|
||||||
static uint8_t rampingmode = 0;
|
static uint8_t rampingmode = 0;
|
||||||
|
|
2
DCC.cpp
2
DCC.cpp
|
@ -242,7 +242,7 @@ void DCC::changeFn( int cab, int16_t functionNumber) {
|
||||||
// Report function state (used from withrottle protocol)
|
// Report function state (used from withrottle protocol)
|
||||||
// returns 0 false, 1 true or -1 for do not know
|
// returns 0 false, 1 true or -1 for do not know
|
||||||
int8_t DCC::getFn( int cab, int16_t functionNumber) {
|
int8_t DCC::getFn( int cab, int16_t functionNumber) {
|
||||||
if (cab<=0 || functionNumber>31)
|
if (cab<=0 || functionNumber>28)
|
||||||
return -1; // unknown
|
return -1; // unknown
|
||||||
int reg = lookupSpeedTable(cab);
|
int reg = lookupSpeedTable(cab);
|
||||||
if (reg<0)
|
if (reg<0)
|
||||||
|
|
|
@ -68,7 +68,7 @@ Once a new OPCODE is decided upon, update this list.
|
||||||
K, Reserved for future use - Potentially Railcom
|
K, Reserved for future use - Potentially Railcom
|
||||||
l, Loco speedbyte/function map broadcast
|
l, Loco speedbyte/function map broadcast
|
||||||
L, Reserved for LCC interface (implemented in EXRAIL)
|
L, Reserved for LCC interface (implemented in EXRAIL)
|
||||||
m, message to throttles broadcast
|
m,
|
||||||
M, Write DCC packet
|
M, Write DCC packet
|
||||||
n,
|
n,
|
||||||
N,
|
N,
|
||||||
|
@ -283,22 +283,25 @@ void DCCEXParser::parseOne(Print *stream, byte *com, RingStream * ringStream)
|
||||||
return; // filterCallback asked us to ignore
|
return; // filterCallback asked us to ignore
|
||||||
case 't': // THROTTLE <t [REGISTER] CAB SPEED DIRECTION>
|
case 't': // THROTTLE <t [REGISTER] CAB SPEED DIRECTION>
|
||||||
{
|
{
|
||||||
|
if (params==1) { // <t cab> display state
|
||||||
|
|
||||||
|
int16_t slot=DCC::lookupSpeedTable(p[0],false);
|
||||||
|
if (slot>=0) {
|
||||||
|
DCC::LOCO * sp=&DCC::speedTable[slot];
|
||||||
|
StringFormatter::send(stream,F("<l %d %d %d %l>\n"),
|
||||||
|
sp->loco,slot,sp->speedCode,sp->functions);
|
||||||
|
}
|
||||||
|
else // send dummy state speed 0 fwd no functions.
|
||||||
|
StringFormatter::send(stream,F("<l %d -1 128 0>\n"),p[0]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int16_t cab;
|
int16_t cab;
|
||||||
int16_t tspeed;
|
int16_t tspeed;
|
||||||
int16_t direction;
|
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 (params == 4)
|
if (params == 4)
|
||||||
{ // <t REGISTER CAB SPEED DIRECTION>
|
{ // <t REGISTER CAB SPEED DIRECTION>
|
||||||
// ignore register p[0]
|
|
||||||
cab = p[1];
|
cab = p[1];
|
||||||
tspeed = p[2];
|
tspeed = p[2];
|
||||||
direction = p[3];
|
direction = p[3];
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
#define GITHUB_SHA "devel-202403111353Z"
|
#define GITHUB_SHA "devel-202402241957Z"
|
||||||
|
|
|
@ -3,8 +3,7 @@
|
||||||
|
|
||||||
#include "StringFormatter.h"
|
#include "StringFormatter.h"
|
||||||
|
|
||||||
#define VERSION "5.2.39"
|
#define VERSION "5.2.38"
|
||||||
// 5.2.39 - Functions for DC frequency: Use func up to F31
|
|
||||||
// 5.2.38 - Exrail MESSAGE("text") to send a user message to all
|
// 5.2.38 - Exrail MESSAGE("text") to send a user message to all
|
||||||
// connected throttles (uses <m "text"> and withrottle Hmtext.
|
// connected throttles (uses <m "text"> and withrottle Hmtext.
|
||||||
// 5.2.37 - Bugfix ESP32: Use BOOSTER_INPUT define
|
// 5.2.37 - Bugfix ESP32: Use BOOSTER_INPUT define
|
||||||
|
|
Loading…
Reference in New Issue
Block a user