From 8a5a832b1d5e2301073b1170b977346de15ecc14 Mon Sep 17 00:00:00 2001 From: Asbelos Date: Tue, 9 Apr 2024 20:59:57 +0100 Subject: [PATCH] Reduced EXRAIL diag noise --- EXRAIL2.cpp | 16 ++++++------- Release_Notes/EXRAIL additions.md | 38 ------------------------------- version.h | 8 ++++++- 3 files changed, 15 insertions(+), 47 deletions(-) delete mode 100644 Release_Notes/EXRAIL additions.md diff --git a/EXRAIL2.cpp b/EXRAIL2.cpp index ef4387c..9293c96 100644 --- a/EXRAIL2.cpp +++ b/EXRAIL2.cpp @@ -176,7 +176,7 @@ LookList* RMFT2::LookListLoader(OPCODE op1, OPCODE op2, OPCODE op3) { /* static */ void RMFT2::begin() { - DIAG(F("EXRAIL RoutCode at =%P"),RouteCode); + //DIAG(F("EXRAIL RoutCode at =%P"),RouteCode); bool saved_diag=diag; diag=true; @@ -411,7 +411,7 @@ void RMFT2::createNewTask(int route, uint16_t cab) { void RMFT2::driveLoco(byte speed) { if (loco<=0) return; // Prevent broadcast! - if (diag) DIAG(F("EXRAIL drive %d %d %d"),loco,speed,forward^invert); + //if (diag) DIAG(F("EXRAIL drive %d %d %d"),loco,speed,forward^invert); /* TODO..... power on appropriate track if DC or main if dcc if (TrackManager::getMainPowerMode()==POWERMODE::OFF) { @@ -1066,7 +1066,7 @@ void RMFT2::loop2() { case OPCODE_ROUTE: case OPCODE_AUTOMATION: case OPCODE_SEQUENCE: - if (diag) DIAG(F("EXRAIL begin(%d)"),operand); + //if (diag) DIAG(F("EXRAIL begin(%d)"),operand); break; case OPCODE_AUTOSTART: // Handled only during begin process @@ -1146,7 +1146,7 @@ int16_t RMFT2::getSignalSlot(int16_t id) { /* static */ void RMFT2::doSignal(int16_t id,char rag) { if (!(compileFeatures & FEATURE_SIGNAL)) return; // dont compile code below - if (diag) DIAG(F(" doSignal %d %x"),id,rag); + //if (diag) DIAG(F(" doSignal %d %x"),id,rag); // Schedule any event handler for this signal change. // This will work even without a signal definition. @@ -1166,7 +1166,7 @@ int16_t RMFT2::getSignalSlot(int16_t id) { VPIN redpin=GETHIGHFLASHW(RMFT2::SignalDefinitions,sigpos+2); VPIN amberpin=GETHIGHFLASHW(RMFT2::SignalDefinitions,sigpos+4); VPIN greenpin=GETHIGHFLASHW(RMFT2::SignalDefinitions,sigpos+6); - if (diag) DIAG(F("signal %d %d %d %d %d"),sigid,id,redpin,amberpin,greenpin); + //if (diag) DIAG(F("signal %d %d %d %d %d"),sigid,id,redpin,amberpin,greenpin); VPIN sigtype=sigid & ~SIGNAL_ID_MASK; @@ -1174,7 +1174,7 @@ int16_t RMFT2::getSignalSlot(int16_t id) { // A servo signal, the pin numbers are actually servo positions // Note, setting a signal to a zero position has no effect. int16_t servopos= rag==SIGNAL_RED? redpin: (rag==SIGNAL_GREEN? greenpin : amberpin); - if (diag) DIAG(F("sigA %d %d"),id,servopos); + //if (diag) DIAG(F("sigA %d %d"),id,servopos); if (servopos!=0) IODevice::writeAnalogue(id,servopos,PCA9685::Bounce); return; } @@ -1292,7 +1292,7 @@ void RMFT2::rotateEvent(int16_t turntableId, bool change) { void RMFT2::clockEvent(int16_t clocktime, bool change) { // Hunt for an ONTIME for this time if (Diag::CMD) - DIAG(F("Looking for clock event at : %d"), clocktime); + DIAG(F("clockEvent at : %d"), clocktime); if (change) { onClockLookup->handleEvent(F("CLOCK"),clocktime); onClockLookup->handleEvent(F("CLOCK"),25*60+clocktime%60); @@ -1302,7 +1302,7 @@ void RMFT2::clockEvent(int16_t clocktime, bool change) { void RMFT2::powerEvent(int16_t track, bool overload) { // Hunt for an ONOVERLOAD for this item if (Diag::CMD) - DIAG(F("Looking for Power event on track : %c"), track); + DIAG(F("powerEvent : %c"), track); if (overload) { onOverloadLookup->handleEvent(F("POWER"),track); } diff --git a/Release_Notes/EXRAIL additions.md b/Release_Notes/EXRAIL additions.md deleted file mode 100644 index 690ff0a..0000000 --- a/Release_Notes/EXRAIL additions.md +++ /dev/null @@ -1,38 +0,0 @@ - -BLINK(vpin, onMs,offMs) - -which will start a vpin blinking until such time as it is SET, RESET or set by a signal operation such as RED, AMBER, GREEN. - -BLINK returns immediately, the blinking is autonomous. - -This means a signal that always blinks amber could be done like this: -``` -SIGNAL(30,31,32) -ONAMBER(30) BLINK(31,500,500) DONE -``` -The RED or GREEN calls will turn off the amber blink automatically. - -Alternatively a signal that has normal AMBER and flashing AMBER could be like this: - -#define FLASHAMBER(signal) \ - AMBER(signal) \ - BLINK(signal+1,500,500) - - (Caution: this issumes that the amber pin is redpin+1) - - == - - FTOGGLE(function) - Toggles the current loco function (see FON and FOFF) - - XFTOGGLE(loco,function) - Toggles the function on given loco. (See XFON, XFOFF) - - TOGGLE_TURNOUT(id) - Toggles the turnout (see CLOSE, THROW) - - STEALTH_GLOBAL(code) - ADVANCED C++ users only. - Inserts code such as static variables and functions that - may be utilised by multiple STEALTH operations. - \ No newline at end of file diff --git a/version.h b/version.h index a772201..3eaf199 100644 --- a/version.h +++ b/version.h @@ -3,7 +3,13 @@ #include "StringFormatter.h" -#define VERSION "5.2.46" +#define VERSION "5.2.47" +// 5.2.47 - EXRAIL additions: +// STEALTH_GLOBAL +// BLINK +// TOGGLE_TURNOUT +// FTOGGLE, XFTOGGLE +// Reduced code-developmenmt DIAG noise // 5.2.46 - Support for extended consist CV20 in and // - New cmd to handle long/short consist ids // 5.2.45 - ESP32 Trackmanager reset cab number to 0 when track is not DC