1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2025-04-22 04:51:20 +02:00

Compare commits

...

3 Commits

Author SHA1 Message Date
Harald Barth
6689a1d35f version 5.2.57 2024-05-09 17:11:09 +02:00
Harald Barth
91818ed80c apply mode by binart bit match and not by equality 2024-05-09 17:06:33 +02:00
Harald Barth
86310aea4f getSignalSlot minor typo (and indent/comments) fix 2024-05-09 15:18:00 +02:00
4 changed files with 11 additions and 10 deletions

View File

@ -1145,7 +1145,7 @@ void RMFT2::kill(const FSH * reason, int operand) {
int16_t RMFT2::getSignalSlot(int16_t id) {
if (id > 0) {
if (id >= 0) {
int sigslot = 0;
int16_t sighandle = 0;
// Trundle down the signal list until we reach the end
@ -1155,14 +1155,14 @@ int16_t RMFT2::getSignalSlot(int16_t id) {
// for a LED signal it will be same as redpin
// but for a servo signal it will also have SERVO_SIGNAL_FLAG set.
VPIN sigid = sighandle & SIGNAL_ID_MASK;
if (sigid == (VPIN)id)
return sigslot; // found it
sigslot++; // keep looking
if (sigid == (VPIN)id) // cast to keep compiler happy but id is positive
return sigslot; // found it
sigslot++; // keep looking
};
}
// We did not find the signal
// If we got here, we did not find the signal
DIAG(F("EXRAIL Signal %d not defined"), id);
return -1;
return -1;
}
/* static */ void RMFT2::doSignal(int16_t id,char rag) {

View File

@ -1 +1 @@
#define GITHUB_SHA "devel-202404211704Z"
#define GITHUB_SHA "devel-202404091507Z"

View File

@ -35,7 +35,7 @@
#define APPLY_BY_MODE(findmode,function) \
FOR_EACH_TRACK(t) \
if (track[t]->getMode()==findmode) \
if (track[t]->getMode() & findmode) \
track[t]->function;
MotorDriver * TrackManager::track[MAX_TRACKS] = { NULL };
@ -398,7 +398,7 @@ bool TrackManager::parseEqualSign(Print *stream, int16_t params, int16_t p[])
if (params==2 && p[1]=="AUTO"_hk) // <= id AUTO>
return setTrackMode(p[0], track[p[0]]->getMode() | TRACK_MODE_AUTOINV);
if (params==2 && p[1]=="INV"_hk) // <= id AUTO>
if (params==2 && p[1]=="INV"_hk) // <= id INV>
return setTrackMode(p[0], track[p[0]]->getMode() | TRACK_MODE_INV);
if (params==3 && p[1]=="DC"_hk && p[2]>0) // <= id DC cab>

View File

@ -3,7 +3,8 @@
#include "StringFormatter.h"
#define VERSION "5.2.56"
#define VERSION "5.2.57"
// 5.2.57 - Bugfix autoreverse: Apply mode by binart bit match and not by equality
// 5.2.56 - Bugfix and refactor for EXRAIL getSignalSlot
// 5.2.55 - Move EXRAIL isSignal() to public to allow use in STEALTH call
// 5.2.54 - Bugfix for EXRAIL signal handling for active high