1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-23 08:06:13 +01:00

DIAGSERIAL corrections

for SAMD
This commit is contained in:
Asbelos 2020-07-25 01:40:20 +01:00
parent 6fadd18827
commit 09cf6763cb
3 changed files with 4 additions and 3 deletions

View File

@ -80,6 +80,7 @@ void setup() {
// Responsibility 1: Start the usb connection for diagnostics and possible JMRI input
// DIAGSERAL is normally Serial but uses SerialUSB on a SAMD processor
DIAGSERIAL.begin(115200);
while(!DIAGSERIAL);
// Responsibility 2: Start the DCC engine.
DCC::begin();

View File

@ -35,7 +35,7 @@ const int HASH_KEYWORD_MAIN=11339;
int DCCEXParser::stashP[MAX_PARAMS];
bool DCCEXParser::stashBusy;
Print & DCCEXParser::stashStream=Serial; // keep compiler happy but ovevride in constructor
Print & DCCEXParser::stashStream=DIAGSERIAL; // keep compiler happy but ovevride in constructor
// This is a JMRI command parser, one instance per incoming stream
// It doesnt know how the string got here, nor how it gets back.

View File

@ -93,7 +93,7 @@ bool WifiInterface::checkForOK(Stream & wifiStream, const unsigned int timeout,
while( millis()-startTime < timeout) {
while(wifiStream.available()) {
int ch=wifiStream.read();
if (echo) StringFormatter::printEscape(Serial,ch); /// THIS IS A DIAG IN DISGUISE
if (echo) StringFormatter::printEscape(DIAGSERIAL,ch); /// THIS IS A DIAG IN DISGUISE
if (ch!=pgm_read_byte_near(locator)) locator=waitfor;
if (ch==pgm_read_byte_near(locator)) {
locator++;
@ -139,7 +139,7 @@ void WifiInterface::loop(Stream & wifiStream) {
int ch=wifiStream.read();
// echo the char to the diagnostic stream in escaped format
StringFormatter::printEscape(Serial,ch); // DIAG in disguise
StringFormatter::printEscape(DIAGSERIAL,ch); // DIAG in disguise
switch (loopstate) {
case 0: // looking for +IPD