From ea785b4f07407c5a0142f8e5187a20a2f32ffd07 Mon Sep 17 00:00:00 2001 From: Asbelos Date: Sun, 20 Sep 2020 00:59:07 +0100 Subject: [PATCH 1/2] V fixes, R command and github sha. --- DCCEXParser.cpp | 44 ++++++++++++++++++++++++++++++++------------ DCCEXParser.h | 1 + GITHUB_SHA.h | 1 + 3 files changed, 34 insertions(+), 12 deletions(-) create mode 100644 GITHUB_SHA.h diff --git a/DCCEXParser.cpp b/DCCEXParser.cpp index b34698d..858f2a5 100644 --- a/DCCEXParser.cpp +++ b/DCCEXParser.cpp @@ -25,6 +25,7 @@ #include "Outputs.h" #include "Sensors.h" #include "freeMemory.h" +#include "GITHUB_SHA.h" #include "EEStore.h" #include "DIAG.h" @@ -222,23 +223,37 @@ void DCCEXParser::parse(Print * stream, byte *com, bool blocking) { return; case 'V': // VERIFY CV ON PROG - if (!stashCallback(stream,p)) break; - if (params==2) DCC::verifyCVByte(p[0],p[1],callback_Vbyte,blocking); - else if (params==3) DCC::verifyCVBit(p[0],p[1],p[2],callback_Vbit,blocking); - else break; - return; - + if (params==2) { // + if (!stashCallback(stream,p)) break; + DCC::verifyCVByte(p[0],p[1],callback_Vbyte,blocking); + return; + } + if (params==3) { + if (!stashCallback(stream,p)) break; + DCC::verifyCVBit(p[0],p[1],p[2],callback_Vbit,blocking); + return; + } + break; + case 'B': // WRITE CV BIT ON PROG if (!stashCallback(stream,p)) break; DCC::writeCVBit(p[0],p[1],p[2],callback_B,blocking); return; - case 'R': // READ CV ON PROG - if (!stashCallback(stream,p)) break; - DCC::readCV(p[0],callback_R,blocking); - return; - + case 'R': // READ CV ON PROG + if (params==3) { // + if (!stashCallback(stream,p)) break; + DCC::readCV(p[0],callback_R,blocking); + return; + } + if (params==0) { // New read loco id + if (!stashCallback(stream,p)) break; + DCC::getLocoId(callback_Rloco,blocking); + return; + } + break; + case '1': // POWERON <1 [MAIN|PROG]> case '0': // POWEROFF <0 [MAIN | PROG] > if (params>1) break; @@ -289,7 +304,7 @@ void DCCEXParser::parse(Print * stream, byte *com, bool blocking) { case 's': // StringFormatter::send(stream,F(""),DCCWaveform::mainTrack.getPowerMode()==POWERMODE::ON ); - StringFormatter::send(stream,F(""), VERSION, __DATE__, __TIME__ ); + StringFormatter::send(stream,F(""), VERSION, F(GITHUB_SHA)); // TODO Send stats of speed reminders table // TODO send status of turnouts etc etc return; @@ -531,4 +546,9 @@ void DCCEXParser::callback_R(int result) { StringFormatter::send(stashStream,F(""),stashP[1],stashP[2],stashP[0],result); stashBusy=false; } + +void DCCEXParser::callback_Rloco(int result) { + StringFormatter::send(stashStream,F(""),result); + stashBusy=false; +} diff --git a/DCCEXParser.h b/DCCEXParser.h index a90e1b4..e154ff9 100644 --- a/DCCEXParser.h +++ b/DCCEXParser.h @@ -55,6 +55,7 @@ struct DCCEXParser static void callback_W(int result); static void callback_B(int result); static void callback_R(int result); + static void callback_Rloco(int result); static void callback_Vbit(int result); static void callback_Vbyte(int result); static FILTER_CALLBACK filterCallback; diff --git a/GITHUB_SHA.h b/GITHUB_SHA.h new file mode 100644 index 0000000..cca6c46 --- /dev/null +++ b/GITHUB_SHA.h @@ -0,0 +1 @@ +#define GITHUB_SHA "9db6d36" From 283a988ba34cd34ec181354884bae9b3d0d51a1d Mon Sep 17 00:00:00 2001 From: Fred Date: Mon, 21 Sep 2020 11:35:14 -0400 Subject: [PATCH 2/2] Update and rename readme.md to README.md --- README.md | 39 +++++++++++++++++++++++++++++++++++++++ readme.md | 3 --- 2 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 README.md delete mode 100644 readme.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..4bdc9c1 --- /dev/null +++ b/README.md @@ -0,0 +1,39 @@ +# What's DCC++ EX +------------ + +DCC++ EX is an open-source hardware and software system for the operation of DCC-equipped model railroads. It expands on the work of Gregg E. Berman's original DCC++ (which can be found here in the BaseStation-Classic repository) + +The system consists of two parts, the DCC++ EX Command Station and one of many front end controllers. These controllers can be hardware controllers (called CABs or Throttles), software applications like JMRI, phone apps like Engine Driver, or our exWebThrottle that is a simple application you run in a browser like a web page and control your model trains. + +The DCC++ EX Command Station consists of an Arduino micro controller fitted with an Arduino Motor Shield (or other supported motor controllers) that can be connected directly to the tracks of a model railroad. + +# 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. More information about the sketch can be found in the included PDF file. + +To utilize this sketch, you can use our automated installer, or download a zip file from this repository and open the file "CommandStation-EX.ino" after unzipping it to your Arduino IDE projects folder. Please do not rename the folder containing the sketch code, nor add any files in that folder. The Arduino IDE relies on the structure and name of the folder to properly display and compile the code. + +The latest production release of the Master branch is 3.0.1: + +* Supports the Arduino Uno, Arduino Mega, and Arduino Nano +* Built-in configuration for both the original Arduino Motor Shield, Pololu MC33926 Motor Shield, LMD18200, and BTS7960B +* Built-in configuration and support of Ethernet Shields and the ESP82266 WiFi module (networking for use with Mega only). + +For more information on the overall DCC++ EX system, please follow the links in the PDF file. + +Detailed diagrams showing pin mappings and required jumpers for the Motor Shields can be found in the Documentation Repository + +The Master branch contains all of the Command Station functionality showed in the DCC-EX YouTube channel. + +# How to find more information +-------------------------- + +[DCC++ EX WEB Page](https://dcc-ex.github.io "DCC++ EX WEB Page") + +[The DCC++ EX Discord and live support](https://discord.gg/y2sB4Fp "The DCC++ EX Discord Server") + +[TrainBoard DCC++ Forum](https://www.trainboard.com/highball/index.php?forums/dcc.177/ "TrainBoard DCC++ Forum") + +-May 2020 +!! diff --git a/readme.md b/readme.md deleted file mode 100644 index 402608a..0000000 --- a/readme.md +++ /dev/null @@ -1,3 +0,0 @@ -# CommandStation EX - -Welcome to the future of DCC++ and affordable model railroading. The team current working on this project have invested a lot of time know how and code to see this through. More to come soon!!!!! \ No newline at end of file