Skip to content

Commit a2da16d

Browse files
committed
Avoid printing or receiving serial if talking to LoRa radio
1 parent a4e8d67 commit a2da16d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Firmware/RTK_Everywhere/support.ino

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ int systemAvailable()
55
{
66
if (printEndpoint == PRINT_ENDPOINT_BLUETOOTH || printEndpoint == PRINT_ENDPOINT_ALL)
77
return (bluetoothRxDataAvailable());
8+
9+
// If the CH34x is disconnected (we are listening to LoRa), avoid reading characters from UART0
10+
// as this will trigger the system menu
11+
else if (usbSerialIsSelected == false)
12+
return(0);
13+
814
return (Serial.available());
915
}
1016

@@ -25,7 +31,10 @@ void systemWrite(const uint8_t *buffer, uint16_t length)
2531

2632
// Output data to USB serial if necessary
2733
if ((printEndpoint != PRINT_ENDPOINT_BLUETOOTH) && (!forwardGnssDataToUsbSerial))
28-
Serial.write(buffer, length);
34+
{
35+
if (usbSerialIsSelected == true) // Only use UART0 if we have the mux on the ESP's UART pointed at the CH34x
36+
Serial.write(buffer, length);
37+
}
2938
}
3039

3140
// Forward GNSS data to the USB serial port

0 commit comments

Comments
 (0)