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

Compare commits

..

4 Commits

Author SHA1 Message Date
Kcsmith0708
409717aca9
Merge 2c133da14040d63993a71bd82ded11560255d646 into 6689a1d35fc2927f0e5aa1da99525cc8b2b0bf82 2024-05-10 14:27:23 -04:00
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) { int16_t RMFT2::getSignalSlot(int16_t id) {
if (id > 0) { if (id >= 0) {
int sigslot = 0; int sigslot = 0;
int16_t sighandle = 0; int16_t sighandle = 0;
// Trundle down the signal list until we reach the end // Trundle down the signal list until we reach the end
@ -1155,12 +1155,12 @@ int16_t RMFT2::getSignalSlot(int16_t id) {
// for a LED signal it will be same as redpin // for a LED signal it will be same as redpin
// but for a servo signal it will also have SERVO_SIGNAL_FLAG set. // but for a servo signal it will also have SERVO_SIGNAL_FLAG set.
VPIN sigid = sighandle & SIGNAL_ID_MASK; VPIN sigid = sighandle & SIGNAL_ID_MASK;
if (sigid == (VPIN)id) if (sigid == (VPIN)id) // cast to keep compiler happy but id is positive
return sigslot; // found it return sigslot; // found it
sigslot++; // keep looking 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); DIAG(F("EXRAIL Signal %d not defined"), id);
return -1; return -1;
} }

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) \ #define APPLY_BY_MODE(findmode,function) \
FOR_EACH_TRACK(t) \ FOR_EACH_TRACK(t) \
if (track[t]->getMode()==findmode) \ if (track[t]->getMode() & findmode) \
track[t]->function; track[t]->function;
MotorDriver * TrackManager::track[MAX_TRACKS] = { NULL }; 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> if (params==2 && p[1]=="AUTO"_hk) // <= id AUTO>
return setTrackMode(p[0], track[p[0]]->getMode() | TRACK_MODE_AUTOINV); 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); return setTrackMode(p[0], track[p[0]]->getMode() | TRACK_MODE_INV);
if (params==3 && p[1]=="DC"_hk && p[2]>0) // <= id DC cab> if (params==3 && p[1]=="DC"_hk && p[2]>0) // <= id DC cab>

View File

@ -3,7 +3,8 @@
#include "StringFormatter.h" #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.56 - Bugfix and refactor for EXRAIL getSignalSlot
// 5.2.55 - Move EXRAIL isSignal() to public to allow use in STEALTH call // 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 // 5.2.54 - Bugfix for EXRAIL signal handling for active high