From 931e348c3d638a7c75d102723c9e1d1488a62499 Mon Sep 17 00:00:00 2001 From: Kcsmith0708 Date: Thu, 24 Mar 2022 11:32:24 -0400 Subject: [PATCH 01/11] Update version.h (#222) Cleaned up & Updated 4.0.0 Section for public release --- version.h | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/version.h b/version.h index 2889212..014eeec 100644 --- a/version.h +++ b/version.h @@ -8,34 +8,39 @@ // EXRAIL POWERON // 4.0.0 Major functional and non-functional changes. // Engine Driver "DriveAway" feature enhancement -//.......JMRI feature enhancement. Provides for multiple additional DCC++EX wifi -//.........connections as accessory controllers or CS for a programming track when -//.........motor shield is added -// New HAL added for I/O (digital and analogue inputs and outputs, servos etc). +// 'Discovered Server' multicast Dynamic Network Server (mDNS) displays available WiFi connections to a DCC++EX Command Station +// New EX-RAIL "Extended Railroad Automation Instruction Language" automation capability. +// EX-Rail Function commands for creating Automation, Route & Sequence Scripts +// EX-RAIL “ROSTER” Engines Id & Function key layout on Engine Driver or WiThrottle +// EX-RAIL DCC++EX Commands to Control EX-RAIL via JMRI Send pane and IDE Serial monitors +// New JMRI feature enhancements; +// Reads DCC++EX EEPROM & automatically uploades any Signals, DCC Turnouts, Servo Turnouts, Vpin Turnouts , & Output pane +// Turnout class revised to expand turnout capabilities, new commands added. +// Provides for multiple additional DCC++EX WiFi connections as accessory controllers or CS for a programming track when Motor Shields are added +// Supports Multiple Command Station connections and individual tracking of Send DCC++ Command panes and DCC++ Traffic Monitor panes +// New HAL added for I/O (digital and analogue inputs and outputs, servos etc) +// Automatically detects & connects to supported devices included in your config.h file // Support for MCP23008, MCP23017 and PCF9584 I2C GPIO Extender modules. // Support for PCA9685 PWM (servo) control modules. // Support for analogue inputs on Arduino pins and on ADS111x I2C modules. // Support for MP3 sound playback via DFPlayer module. // Support for HC-SR04 Ultrasonic range sensor module. // Support for VL53L0X Laser range sensor module (Time-Of-Flight). -//.........Added diagnostic command to show configured devices -// Native non-blocking I2C drivers for AVR and Nano architectures (fallback -// to blocking Wire library for other platforms). -// EEPROM layout change - deletes EEPROM contents on first start following upgrade. -// New EX-RAIL automation capability. -// Turnout class revised to expand turnout capabilities, new commands added. -// Output class now allows ID > 255. -// Configuration options to globally flip polarity of DCC Accessory states when driven -// from command and command. -// Increased use of display for showing loco decoder programming information. +// Added diagnostic command to show configured devices +// New Processor Support added +// Compiles on Nano Every and Teensy +// Native non-blocking I2C drivers for AVR and Nano architectures (fallback to blocking Wire library for other platforms). // Can disable EEPROM code +// EEPROM layout change - deletes EEPROM contents on first start following upgrade. +// Output class now allows ID > 255. +// Configuration options to globally flip polarity of DCC Accessory states when driven from command and command. +// Increased use of display for showing loco decoder programming information. // Can define border between long and short addresses // Turnout and accessory states (thrown/closed = 0/1 or 1/0) can be set to match RCN-213 // Bugfix: one-off error in CIPSEND drop -// Compiles on Nano Every // Bugfix: disgnostic display of ack pulses >32kus -//.......Bugfix: Current read from wrong ADC during interrupt -// ... +// Bugfix: Current read from wrong ADC during interrupt +// 3.2.0 Development Release Includes all of 3.1.1 thru 3.1.7 enhancements // 3.1.7 Bugfix: Unknown locos should have speed forward // 3.1.6 Make output ID two bytes and guess format/size of registered outputs found in EEPROM // 3.1.5 Fix LCD corruption on power-up From 331538549f81f62b8630e3bbc752b452ef0db2de Mon Sep 17 00:00:00 2001 From: Helmut Fischer <39243870+thehefi@users.noreply.github.com> Date: Thu, 24 Mar 2022 16:36:34 +0100 Subject: [PATCH 02/11] README.md: removed misleading "folder/subforlders" (#218) Removed misleading mention of "folder named CommandStation-EX and its subforlders" --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9062575..0296d8f 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Both CommandStation-EX and BaseStation-Classic support much of the NMRA Digital # What’s in this Repository? -This repository, CommandStation-EX, contains a complete DCC++ EX Commmand Station sketch designed for compiling and uploading into an Arduino Uno, Mega, or Nano. All sketch files are in the folder named CommandStation-EX and its subforlders. +This repository, CommandStation-EX, contains a complete DCC++ EX Commmand Station sketch designed for compiling and uploading into an Arduino Uno, Mega, or Nano. To utilize this sketch, you can use the following: From 71cd3fc2925d084eedbe1aebb61d75e4459f2b26 Mon Sep 17 00:00:00 2001 From: Helmut Fischer <39243870+thehefi@users.noreply.github.com> Date: Thu, 24 Mar 2022 16:37:29 +0100 Subject: [PATCH 03/11] README.md: dead link to rewrite (#217) Corrected dead link to `notes/rewrite.md' with appropriat text. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0296d8f..f820075 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ in config.h. * Automatic slot (register) management * Automation (coming soon) -NOTE: DCC-EX is a major rewrite to the code. We started over and rebuilt it from the ground up! For what that means to you, click [HERE](notes/rewrite.md). +NOTE: DCC-EX is a major rewrite to the code. We started over and rebuilt it from the ground up! For what that means, you can read [HERE](https://dcc-ex.com/about/rewrite.html). # More information You can learn more at the [DCC++ EX website](https://dcc-ex.com/) From b29eedf772ac319108c9dd90437ef5a15bd8aaa7 Mon Sep 17 00:00:00 2001 From: Fred Date: Mon, 28 Mar 2022 17:44:16 -0400 Subject: [PATCH 04/11] Create label-sponsors.yml file When users who are sponsors submit a PR or an issue, a "sponsors" label will appear next to their name --- .github/workflows/label-sponsors.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .github/workflows/label-sponsors.yml diff --git a/.github/workflows/label-sponsors.yml b/.github/workflows/label-sponsors.yml new file mode 100644 index 0000000..f3eb819 --- /dev/null +++ b/.github/workflows/label-sponsors.yml @@ -0,0 +1,2 @@ +- name: Sponsor Labels + uses: JasonEtco/is-sponsor-label-action@v1.2.0 From 90ca262cd98f04ded4052b636f9fa29faf157f37 Mon Sep 17 00:00:00 2001 From: Fred Date: Mon, 28 Mar 2022 17:48:48 -0400 Subject: [PATCH 05/11] Update label-sponsors.yml Fix actions --- .github/workflows/label-sponsors.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/label-sponsors.yml b/.github/workflows/label-sponsors.yml index f3eb819..b5c7479 100644 --- a/.github/workflows/label-sponsors.yml +++ b/.github/workflows/label-sponsors.yml @@ -1,2 +1,14 @@ -- name: Sponsor Labels - uses: JasonEtco/is-sponsor-label-action@v1.2.0 +name: Label sponsors +on: + pull_request: + types: [opened] + issues: + types: [opened] +jobs: + build: + name: is-sponsor-label + runs-on: ubuntu-latest + steps: + - uses: JasonEtco/is-sponsor-label-action@v1.2.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 5b12c2864de512a8f7d0c24d2e8ff92e37ef39e7 Mon Sep 17 00:00:00 2001 From: Fred Date: Mon, 28 Mar 2022 19:40:18 -0400 Subject: [PATCH 06/11] Create FUNDING.yml Add patreon as our first funding site --- .github/FUNDING.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..68287f8 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +patreon: DCC-EX From a37ca6b6b61b7931206b6a73218e227909459271 Mon Sep 17 00:00:00 2001 From: Fred Date: Mon, 28 Mar 2022 19:43:06 -0400 Subject: [PATCH 07/11] Update FUNDING.yml --- .github/FUNDING.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 68287f8..cf99c1f 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1 +1 @@ -patreon: DCC-EX +patreon: dccex From 0ab3fe07c56cc0aa9877a026f30ec14ae97d3c11 Mon Sep 17 00:00:00 2001 From: Fred Date: Tue, 29 Mar 2022 11:59:40 -0400 Subject: [PATCH 08/11] Update FUNDING.yml --- .github/FUNDING.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index cf99c1f..3d53467 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1 +1,2 @@ +github: DCC-EX patreon: dccex From 566f8ada23430eb758f8a51bca955444effcb89e Mon Sep 17 00:00:00 2001 From: Asbelos Date: Thu, 31 Mar 2022 15:46:50 +0100 Subject: [PATCH 09/11] Incoming LCN turnout throw. --- LCN.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/LCN.cpp b/LCN.cpp index 16b3f3f..efb49ff 100644 --- a/LCN.cpp +++ b/LCN.cpp @@ -50,7 +50,11 @@ void LCN::loop() { if (Diag::LCN) DIAG(F("LCN IN %d%c"),id,(char)ch); if (!Turnout::exists(id)) LCNTurnout::create(id); Turnout::setClosedStateOnly(id,ch=='t'); - Turnout::turnoutlistHash++; // signals ED update of turnout data + id = 0; + } + else if (ch == 'y' || ch == 'Y') { // Turnout opcodes + if (Diag::LCN) DIAG(F("LCN IN %d%c"),id,(char)ch); + Turnout::setClosed(id,ch=='y'); id = 0; } else if (ch == 'S' || ch == 's') { From 731d838e8305c0a9c0924b1b5f631a1648b229e5 Mon Sep 17 00:00:00 2001 From: Asbelos Date: Thu, 31 Mar 2022 21:52:43 +0100 Subject: [PATCH 10/11] KILLALL macro and DIAGNOSTIC messages when KILL command used. --- EXRAIL2.cpp | 10 +++++++--- EXRAIL2.h | 2 +- EXRAIL2MacroReset.h | 2 ++ EXRAILMacros.h | 1 + 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/EXRAIL2.cpp b/EXRAIL2.cpp index 669a632..3c7af23 100644 --- a/EXRAIL2.cpp +++ b/EXRAIL2.cpp @@ -360,7 +360,7 @@ bool RMFT2::parseSlash(Print * stream, byte & paramCount, int16_t p[]) { // check KILL ALL here, otherwise the next validation confuses ALL with a flag if (p[0]==HASH_KEYWORD_KILL && p[1]==HASH_KEYWORD_ALL) { - while (loopTask) delete loopTask; // destructor changes loopTask + while (loopTask) loopTask->kill(F("KILL ALL")); // destructor changes loopTask return true; } @@ -373,7 +373,7 @@ bool RMFT2::parseSlash(Print * stream, byte & paramCount, int16_t p[]) { RMFT2 * task=loopTask; while(task) { if (task->taskId==p[1]) { - delete task; + task->kill(F("KILL")); return true; } task=task->next; @@ -812,7 +812,11 @@ void RMFT2::loop2() { case OPCODE_ENDEXRAIL: kill(); return; - + + case OPCODE_KILLALL: + while(loopTask) loopTask->kill(F("KILLALL")); + return; + case OPCODE_JOIN: DCCWaveform::mainTrack.setPowerMode(POWERMODE::ON); DCCWaveform::progTrack.setPowerMode(POWERMODE::ON); diff --git a/EXRAIL2.h b/EXRAIL2.h index dc33b76..6cc0243 100644 --- a/EXRAIL2.h +++ b/EXRAIL2.h @@ -49,7 +49,7 @@ enum OPCODE : byte {OPCODE_THROW,OPCODE_CLOSE, OPCODE_ONCLOSE, OPCODE_ONTHROW, OPCODE_SERVOTURNOUT, OPCODE_PINTURNOUT, OPCODE_PRINT,OPCODE_DCCACTIVATE, OPCODE_ONACTIVATE,OPCODE_ONDEACTIVATE,OPCODE_IFGTE,OPCODE_IFLT, - OPCODE_ROSTER, + OPCODE_ROSTER,OPCODE_KILLALL, OPCODE_ROUTE,OPCODE_AUTOMATION,OPCODE_SEQUENCE,OPCODE_ENDTASK,OPCODE_ENDEXRAIL }; diff --git a/EXRAIL2MacroReset.h b/EXRAIL2MacroReset.h index 67939db..06318c7 100644 --- a/EXRAIL2MacroReset.h +++ b/EXRAIL2MacroReset.h @@ -69,6 +69,7 @@ #undef IFTIMEOUT #undef INVERT_DIRECTION #undef JOIN +#undef KILLALL #undef LATCH #undef LCD #undef LCN @@ -166,6 +167,7 @@ #define IFTIMEOUT #define INVERT_DIRECTION #define JOIN +#define KILLALL #define LATCH(sensor_id) #define LCD(row,msg) #define LCN(msg) diff --git a/EXRAILMacros.h b/EXRAILMacros.h index 912c6c4..07b75d2 100644 --- a/EXRAILMacros.h +++ b/EXRAILMacros.h @@ -215,6 +215,7 @@ const FLASH int16_t RMFT2::SignalDefinitions[] = { #define IFTIMEOUT OPCODE_IFTIMEOUT,0,0, #define INVERT_DIRECTION OPCODE_INVERT_DIRECTION,0,0, #define JOIN OPCODE_JOIN,0,0, +#define KILLALL OPCODE_KILLALL,0,0, #define LATCH(sensor_id) OPCODE_LATCH,V(sensor_id), #define LCD(id,msg) PRINT(msg) #define LCN(msg) PRINT(msg) From 7c1c6dafa1351923f18593a3e79baa370de26823 Mon Sep 17 00:00:00 2001 From: Asbelos Date: Thu, 31 Mar 2022 22:04:40 +0100 Subject: [PATCH 11/11] EXRAIL PARSE --- EXRAIL2MacroReset.h | 2 ++ EXRAILMacros.h | 3 +++ version.h | 3 ++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/EXRAIL2MacroReset.h b/EXRAIL2MacroReset.h index 06318c7..e28452a 100644 --- a/EXRAIL2MacroReset.h +++ b/EXRAIL2MacroReset.h @@ -79,6 +79,7 @@ #undef ONDEACTIVATEL #undef ONCLOSE #undef ONTHROW +#undef PARSE #undef PAUSE #undef PIN_TURNOUT #undef PRINT @@ -180,6 +181,7 @@ #define PAUSE #define PIN_TURNOUT(id,pin,description...) #define PRINT(msg) +#define PARSE(msg) #define POM(cv,value) #define POWEROFF #define POWERON diff --git a/EXRAILMacros.h b/EXRAILMacros.h index 07b75d2..e0b078c 100644 --- a/EXRAILMacros.h +++ b/EXRAILMacros.h @@ -71,6 +71,8 @@ void RMFT2::emitWithrottleDescriptions(Print * stream) { const int StringMacroTracker1=__COUNTER__; #undef BROADCAST #define BROADCAST(msg) case (__COUNTER__ - StringMacroTracker1) : CommandDistributor::broadcastText(F(msg));break; +#undef PARSE +#define PARSE(msg) case (__COUNTER__ - StringMacroTracker1) : DCCEXParser::parse(F(msg));break; #undef PRINT #define PRINT(msg) case (__COUNTER__ - StringMacroTracker1) : printMessage2(F(msg));break; #undef LCN @@ -231,6 +233,7 @@ const FLASH int16_t RMFT2::SignalDefinitions[] = { #define POWEROFF OPCODE_POWEROFF,0,0, #define POWERON OPCODE_POWERON,0,0, #define PRINT(msg) OPCODE_PRINT,V(__COUNTER__ - StringMacroTracker2), +#define PARSE(msg) PRINT(msg) #define READ_LOCO OPCODE_READ_LOCO1,0,0,OPCODE_READ_LOCO2,0,0, #define RED(signal_id) OPCODE_RED,V(signal_id), #define RESERVE(blockid) OPCODE_RESERVE,V(blockid), diff --git a/version.h b/version.h index 9abcc7b..563b10d 100644 --- a/version.h +++ b/version.h @@ -6,8 +6,9 @@ #define VERSION "4.0.2" // 4.0.2 EXRAIL additions: +// PARSE <> commands // VIRTUAL_TURNOUT -// command to stop all tasks. +// and KILLALL command to stop all tasks. // FORGET forgets the current loco in DCC reminder tables. // Servo signals (SERVO_SIGNAL) // High-On signal pins (SIGNALH)