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

USB Serial fixes for EX-RAIL & debug

This commit is contained in:
pmantoine 2023-02-15 08:51:21 +08:00
parent 3292c93192
commit 67bd886a98
3 changed files with 7 additions and 8 deletions

View File

@ -48,7 +48,7 @@ template<typename... Targs> void CommandDistributor::broadcastReply(clientType t
// on a single USB connection config, write direct to Serial and ignore flush/shove // on a single USB connection config, write direct to Serial and ignore flush/shove
template<typename... Targs> void CommandDistributor::broadcastReply(clientType type, Targs... msg){ template<typename... Targs> void CommandDistributor::broadcastReply(clientType type, Targs... msg){
(void)type; //shut up compiler warning (void)type; //shut up compiler warning
StringFormatter::send(&Serial, msg...); StringFormatter::send(&USB_SERIAL, msg...);
} }
#endif #endif

View File

@ -1165,11 +1165,11 @@ void RMFT2::thrungeString(uint32_t strfar, thrunger mode, byte id) {
// Find out where the string is going // Find out where the string is going
switch (mode) { switch (mode) {
case thrunge_print: case thrunge_print:
StringFormatter::send(&Serial,F("<* EXRAIL(%d) "),loco); StringFormatter::send(&USB_SERIAL,F("<* EXRAIL(%d) "),loco);
stream=&Serial; stream=&USB_SERIAL;
break; break;
case thrunge_serial: stream=&Serial; break; case thrunge_serial: stream=&USB_SERIAL; break;
case thrunge_serial1: case thrunge_serial1:
#ifdef SERIAL1_COMMANDS #ifdef SERIAL1_COMMANDS
stream=&Serial1; stream=&Serial1;
@ -1200,7 +1200,6 @@ void RMFT2::thrungeString(uint32_t strfar, thrunger mode, byte id) {
stream=&Serial6; stream=&Serial6;
#endif #endif
break; break;
// TODO more serials for SAMx case thrunge_serial4: stream=&Serial4; break;
case thrunge_lcn: case thrunge_lcn:
#if defined(LCN_SERIAL) #if defined(LCN_SERIAL)
stream=&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 // and decide what to do next
switch (mode) { switch (mode) {
case thrunge_print: case thrunge_print:
StringFormatter::send(&Serial,F(" *>\n")); StringFormatter::send(&USB_SERIAL,F(" *>\n"));
break; break;
// TODO more serials for SAMx case thrunge_serial4: stream=&Serial4; break; // TODO more serials for SAMx case thrunge_serial4: stream=&Serial4; break;
case thrunge_parse: case thrunge_parse:
DCCEXParser::parseOne(&Serial,(byte*)buffer->getString(),NULL); DCCEXParser::parseOne(&USB_SERIAL,(byte*)buffer->getString(),NULL);
break; break;
case thrunge_broadcast: case thrunge_broadcast:
// TODO CommandDistributor::broadcastText(buffer->getString()); // TODO CommandDistributor::broadcastText(buffer->getString());

View File

@ -207,7 +207,7 @@
} }
#ifdef EESTOREDEBUG #ifdef EESTOREDEBUG
printAll(&Serial); printAll(&USB_SERIAL);
#endif #endif
return tt; return tt;
} }