From 506b65d0eaf0d0d58abd46657df0a630a4334e59 Mon Sep 17 00:00:00 2001 From: Asbelos Date: Wed, 18 May 2022 17:44:41 +0100 Subject: [PATCH 1/2] Fix command for signals --- EXRAIL2.cpp | 18 ++++++++++++++---- version.h | 3 ++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/EXRAIL2.cpp b/EXRAIL2.cpp index 60c66c6..6e8b0a3 100644 --- a/EXRAIL2.cpp +++ b/EXRAIL2.cpp @@ -320,12 +320,22 @@ bool RMFT2::parseSlash(Print * stream, byte & paramCount, int16_t p[]) { // Now stream the flags for (int id=0;id\n")); return true; } diff --git a/version.h b/version.h index cc95b56..846ad3a 100644 --- a/version.h +++ b/version.h @@ -4,9 +4,10 @@ #include "StringFormatter.h" -#define VERSION "4.1.1 rc2" +#define VERSION "4.1.1 rc3" // 4.1.1 Bugfix: preserve turnout format // Bugfix: parse multiple commands in one buffer string correct +// Bugfix: command signal status in Exrail // 4.1.0 ... // // 4.0.2 EXRAIL additions: From ebebd0dc1114f1bb4a0bac3e8138aff1c8af9aeb Mon Sep 17 00:00:00 2001 From: Asbelos Date: Thu, 19 May 2022 09:03:28 +0100 Subject: [PATCH 2/2] Improved display and loop time for signals. --- EXRAIL2.cpp | 21 +++++++++++---------- EXRAIL2.h | 1 + 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/EXRAIL2.cpp b/EXRAIL2.cpp index 6e8b0a3..541e2fb 100644 --- a/EXRAIL2.cpp +++ b/EXRAIL2.cpp @@ -172,7 +172,7 @@ int16_t LookList::find(int16_t value) { for (int sigpos=0;;sigpos+=4) { VPIN sigid=GETFLASHW(RMFT2::SignalDefinitions+sigpos); if (sigid==0) break; // end of signal list - doSignal(sigid & (~ SERVO_SIGNAL_FLAG) & (~ACTIVE_HIGH_SIGNAL_FLAG), SIGNAL_RED); + doSignal(sigid & SIGNAL_ID_MASK, SIGNAL_RED); } for (progCounter=0;; SKIPOP){ @@ -327,14 +327,15 @@ bool RMFT2::parseSlash(Print * stream, byte & paramCount, int16_t p[]) { } } // do the signals - // flags[n] represents the state of the nth signal in the table - for (int id=0;id\n")); return true; @@ -994,7 +995,7 @@ int16_t RMFT2::getSignalSlot(VPIN id) { // for a LED signal it will be same as redpin // but for a servo signal it will also have SERVO_SIGNAL_FLAG set. - if ((sigid & ~SERVO_SIGNAL_FLAG & ~ACTIVE_HIGH_SIGNAL_FLAG)!= id) continue; // keep looking + if ((sigid & SIGNAL_ID_MASK)!= id) continue; // keep looking return sigpos/4; // relative slot in signals table } } diff --git a/EXRAIL2.h b/EXRAIL2.h index b44ce6c..3b9b874 100644 --- a/EXRAIL2.h +++ b/EXRAIL2.h @@ -107,6 +107,7 @@ class LookList { static void activateEvent(int16_t addr, bool active); static const int16_t SERVO_SIGNAL_FLAG=0x4000; static const int16_t ACTIVE_HIGH_SIGNAL_FLAG=0x2000; + static const int16_t SIGNAL_ID_MASK=0x0FFF; // Throttle Info Access functions built by exrail macros static const byte rosterNameCount;