1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2025-04-16 18:30:12 +02:00

Compare commits

...

6 Commits

Author SHA1 Message Date
Kcsmith0708
a030e88840
Merge 5d411e6a08 into 5d18c910fa 2025-03-11 00:23:00 +11:00
Asbelos
5d18c910fa More EXRAIL asserts 2025-03-10 10:34:21 +00:00
Kcsmith0708
5d411e6a08
Update DCCEXParser.cpp
edited out extra paren )
2024-04-12 16:28:11 -04:00
Kcsmith0708
7bd1bae470
Update DCCEXParser.cpp 2024-04-12 13:18:47 -04:00
Kcsmith0708
7cc3cf9c65
Update DCCEXParser.cpp
Added setVirtualLCDSerial(Null);
to stop the <@ responses from streaming through the serial monitor
2024-04-12 13:16:44 -04:00
Kcsmith0708
2738d86431
Update DCCEXParser.cpp
Virtual LCD#0  line 8 "Powered by DCC-EX"
2024-04-10 13:39:53 -04:00
2 changed files with 20 additions and 17 deletions

View File

@ -933,7 +933,9 @@ void DCCEXParser::parseOne(Print *stream, byte *com, RingStream * ringStream)
CommandDistributor::setVirtualLCDSerial(stream);
StringFormatter::send(stream,
F("<@ 0 0 \"DCC-EX v" VERSION "\">\n"
"<@ 0 1 \"Lic GPLv3\">\n"));
"<@ 0 1 \"Lic GPLv3 \">\n"
"<@ 0 8 \"Powered by DCC-EX \">\n"
CommandDistributor::setVirtualLCDSerial(NULL);
return;
#endif
default: //anything else will diagnose and drop out to <X>

View File

@ -53,7 +53,7 @@ constexpr int16_t seqCount(const int16_t value, const int16_t pos=0, const int16
#define new
#define MotorDriver(power_pin,signal_pin,signal_pin2, \
brake_pin,current_pin,senseFactor,tripMilliamps,faultPin) \
power_pin,signal_pin,signal_pin2,brake_pin,current_pin,faultPin
abs(power_pin),abs(signal_pin),abs(signal_pin2),abs(brake_pin),abs(current_pin),abs(faultPin)
#ifndef PIN_BLACKLIST
#define PIN_BLACKLIST UNUSED_PIN
#endif
@ -128,37 +128,38 @@ constexpr bool unsafePin(const int16_t value, const uint16_t pos=0 ) {
//check speeds
#undef SPEED
#define SPEED(speed) static_assert(speed>=0 && speed<128,"Speed out of valid range 0-127");
#define SPEED(speed) static_assert(speed>=0 && speed<128,"\n\nUSER ERROR: Speed out of valid range 0-127\n");
#undef FWD
#define FWD(speed) static_assert(speed>=0 && speed<128,"Speed out of valid range 0-127");
#define FWD(speed) static_assert(speed>=0 && speed<128,"\n\nUSER ERROR: Speed out of valid range 0-127\n");
#undef REV
#define REV(speed) static_assert(speed>=0 && speed<128,"Speed out of valid range 0-127");
#define REV(speed) static_assert(speed>=0 && speed<128,"\n\nUSER ERROR: Speed out of valid range 0-127\n");
// check duplicate sequences
#undef SEQUENCE
#define SEQUENCE(id) static_assert(seqCount(id)==1,"Duplicate ROUTE/AUTOMATION/SEQUENCE " #id);
#define SEQUENCE(id) static_assert(seqCount(id)==1,"\n\nUSER ERROR: Duplicate ROUTE/AUTOMATION/SEQUENCE(" #id")\n");
#undef AUTOMATION
#define AUTOMATION(id,description) static_assert(seqCount(id)==1,"Duplicate ROUTE/AUTOMATION/SEQUENCE " #id);
#define AUTOMATION(id,description) static_assert(seqCount(id)==1,"\n\nUSER ERROR: Duplicate ROUTE/AUTOMATION/SEQUENCE(" #id")\n");
#undef ROUTE
#define ROUTE(id,description) static_assert(seqCount(id)==1,"Duplicate ROUTE/AUTOMATION/SEQUENCE " #id);
#define ROUTE(id,description) static_assert(seqCount(id)==1,"\n\nUSER ERROR: Duplicate ROUTE/AUTOMATION/SEQUENCE(" #id")\n");
// check dangerous pins
#define _PIN_RESERVED_ "\n\nUSER ERROR: Pin is used by Motor Shield or other critical function.\n"
#undef SET
#define SET(vpin) static_assert(!unsafePin(vpin),"SET(" #vpin ") not safe to use in EXRAIL");
#define SET(vpin) static_assert(!unsafePin(vpin),"SET(" #vpin ")" _PIN_RESERVED_);
#undef RESET
#define RESET(vpin) static_assert(!unsafePin(vpin),"RESET(" #vpin ") not safe to use in EXRAIL");
#define RESET(vpin) static_assert(!unsafePin(vpin),"RESET(" #vpin ")" _PIN_RESERVED_);
#undef BLINK
#define BLINK(vpin,onDuty,offDuty) static_assert(!unsafePin(vpin),"BLINK(" #vpin ") not safe to use in EXRAIL");
#define BLINK(vpin,onDuty,offDuty) static_assert(!unsafePin(vpin),"BLINK(" #vpin ")" _PIN_RESERVED_);
#undef SIGNAL
#define SIGNAL(redpin,amberpin,greenpin) \
static_assert(!unsafePin(redpin),"RED " #redpin " not safe to use in EXRAIL"); \
static_assert(amberpin==0 ||!unsafePin(amberpin),"AMBER " #amberpin " not safe to use in EXRAIL"); \
static_assert(!unsafePin(greenpin),"GREEN " #greenpin " not safe to use in EXRAIL");
static_assert(!unsafePin(redpin),"Red pin " #redpin _PIN_RESERVED_); \
static_assert(amberpin==0 ||!unsafePin(amberpin),"Amber pin " #amberpin _PIN_RESERVED_); \
static_assert(!unsafePin(greenpin),"Green pin " #greenpin _PIN_RESERVED_);
#undef SIGNALH
#define SIGNALH(redpin,amberpin,greenpin) \
static_assert(!unsafePin(redpin),"RED " #redpin " not safe to use in EXRAIL"); \
static_assert(amberpin==0 ||!unsafePin(amberpin),"AMBER " #amberpin " not safe to use in EXRAIL"); \
static_assert(!unsafePin(greenpin),"GREEN " #greenpin " not safe to use in EXRAIL");
static_assert(!unsafePin(redpin),"Red pin " #redpin _PIN_RESERVED_); \
static_assert(amberpin==0 ||!unsafePin(amberpin),"Amber pin " #amberpin _PIN_RESERVED_); \
static_assert(!unsafePin(greenpin),"Green pin " #greenpin _PIN_RESERVED_);
// and run the assert pass.
#include "myAutomation.h"