mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-11-23 16:16:13 +01:00
DIAGSERIAL corrections
for SAMD
This commit is contained in:
parent
6fadd18827
commit
09cf6763cb
|
@ -80,6 +80,7 @@ void setup() {
|
||||||
// Responsibility 1: Start the usb connection for diagnostics and possible JMRI input
|
// Responsibility 1: Start the usb connection for diagnostics and possible JMRI input
|
||||||
// DIAGSERAL is normally Serial but uses SerialUSB on a SAMD processor
|
// DIAGSERAL is normally Serial but uses SerialUSB on a SAMD processor
|
||||||
DIAGSERIAL.begin(115200);
|
DIAGSERIAL.begin(115200);
|
||||||
|
while(!DIAGSERIAL);
|
||||||
|
|
||||||
// Responsibility 2: Start the DCC engine.
|
// Responsibility 2: Start the DCC engine.
|
||||||
DCC::begin();
|
DCC::begin();
|
||||||
|
|
|
@ -35,7 +35,7 @@ const int HASH_KEYWORD_MAIN=11339;
|
||||||
int DCCEXParser::stashP[MAX_PARAMS];
|
int DCCEXParser::stashP[MAX_PARAMS];
|
||||||
bool DCCEXParser::stashBusy;
|
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
|
// This is a JMRI command parser, one instance per incoming stream
|
||||||
// It doesnt know how the string got here, nor how it gets back.
|
// It doesnt know how the string got here, nor how it gets back.
|
||||||
|
|
|
@ -93,7 +93,7 @@ bool WifiInterface::checkForOK(Stream & wifiStream, const unsigned int timeout,
|
||||||
while( millis()-startTime < timeout) {
|
while( millis()-startTime < timeout) {
|
||||||
while(wifiStream.available()) {
|
while(wifiStream.available()) {
|
||||||
int ch=wifiStream.read();
|
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=waitfor;
|
||||||
if (ch==pgm_read_byte_near(locator)) {
|
if (ch==pgm_read_byte_near(locator)) {
|
||||||
locator++;
|
locator++;
|
||||||
|
@ -139,7 +139,7 @@ void WifiInterface::loop(Stream & wifiStream) {
|
||||||
int ch=wifiStream.read();
|
int ch=wifiStream.read();
|
||||||
|
|
||||||
// echo the char to the diagnostic stream in escaped format
|
// 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) {
|
switch (loopstate) {
|
||||||
case 0: // looking for +IPD
|
case 0: // looking for +IPD
|
||||||
|
|
Loading…
Reference in New Issue
Block a user