From 67bd886a98a7c7d006ce7d75d82518b0f232a3ec Mon Sep 17 00:00:00 2001 From: pmantoine Date: Wed, 15 Feb 2023 08:51:21 +0800 Subject: [PATCH] USB Serial fixes for EX-RAIL & debug --- CommandDistributor.cpp | 2 +- EXRAIL2.cpp | 11 +++++------ Turnouts.cpp | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/CommandDistributor.cpp b/CommandDistributor.cpp index 652d852..4b05c68 100644 --- a/CommandDistributor.cpp +++ b/CommandDistributor.cpp @@ -48,7 +48,7 @@ template void CommandDistributor::broadcastReply(clientType t // on a single USB connection config, write direct to Serial and ignore flush/shove template void CommandDistributor::broadcastReply(clientType type, Targs... msg){ (void)type; //shut up compiler warning - StringFormatter::send(&Serial, msg...); + StringFormatter::send(&USB_SERIAL, msg...); } #endif diff --git a/EXRAIL2.cpp b/EXRAIL2.cpp index 48f91cc..3bd8da7 100644 --- a/EXRAIL2.cpp +++ b/EXRAIL2.cpp @@ -1165,11 +1165,11 @@ void RMFT2::thrungeString(uint32_t strfar, thrunger mode, byte id) { // Find out where the string is going switch (mode) { case thrunge_print: - StringFormatter::send(&Serial,F("<* EXRAIL(%d) "),loco); - stream=&Serial; + StringFormatter::send(&USB_SERIAL,F("<* EXRAIL(%d) "),loco); + stream=&USB_SERIAL; break; - case thrunge_serial: stream=&Serial; break; + case thrunge_serial: stream=&USB_SERIAL; break; case thrunge_serial1: #ifdef SERIAL1_COMMANDS stream=&Serial1; @@ -1200,7 +1200,6 @@ void RMFT2::thrungeString(uint32_t strfar, thrunger mode, byte id) { stream=&Serial6; #endif break; - // TODO more serials for SAMx case thrunge_serial4: stream=&Serial4; break; case thrunge_lcn: #if defined(LCN_SERIAL) stream=&LCN_SERIAL; @@ -1233,11 +1232,11 @@ void RMFT2::thrungeString(uint32_t strfar, thrunger mode, byte id) { // and decide what to do next switch (mode) { case thrunge_print: - StringFormatter::send(&Serial,F(" *>\n")); + StringFormatter::send(&USB_SERIAL,F(" *>\n")); break; // TODO more serials for SAMx case thrunge_serial4: stream=&Serial4; break; case thrunge_parse: - DCCEXParser::parseOne(&Serial,(byte*)buffer->getString(),NULL); + DCCEXParser::parseOne(&USB_SERIAL,(byte*)buffer->getString(),NULL); break; case thrunge_broadcast: // TODO CommandDistributor::broadcastText(buffer->getString()); diff --git a/Turnouts.cpp b/Turnouts.cpp index 636922d..582ea7d 100644 --- a/Turnouts.cpp +++ b/Turnouts.cpp @@ -207,7 +207,7 @@ } #ifdef EESTOREDEBUG - printAll(&Serial); + printAll(&USB_SERIAL); #endif return tt; }