@@ -445,6 +445,22 @@ float batteryChargingPercentPerHour;
445445#include " bluetoothSelect.h"
446446#endif // COMPILE_BT
447447
448+ // This value controls the data that is output from the USB serial port
449+ // to the host PC. By default (false) status and debug messages are output
450+ // to the USB serial port. When this value is set to true then the status
451+ // and debug messages are discarded and only GNSS data is output to USB
452+ // serial.
453+ //
454+ // Switching from status and debug messages to GNSS output is done in two
455+ // places, at the end of setup and at the end of maenuMain. In both of
456+ // these places the new value comes from settings.enableGnssToUsbSerial.
457+ // Upon boot status and debug messages are output at least until the end
458+ // of setup. Upon entry into menuMain, this value is set false to again
459+ // output menu output, status and debug messages to be output. At the end
460+ // of setup the value is updated and if enabled GNSS data is sent to the
461+ // USB serial port and PC.
462+ volatile bool forwardGnssDataToUsbSerial;
463+
448464#define platformPrefix platformPrefixTable[productVariant] // Sets the prefix for broadcast names
449465
450466#include < driver/uart.h> // Required for uart_set_rx_full_threshold() on cores <v2.0.5
@@ -1113,6 +1129,10 @@ void setup()
11131129 systemPrintf (" %8d mSec: Total boot time\r\n " , bootTime[bootTimeIndex]);
11141130 systemPrintln ();
11151131 }
1132+
1133+ // If necessary, switch to sending GNSS data out the USB serial port
1134+ // to the PC
1135+ forwardGnssDataToUsbSerial = settings.enableGnssToUsbSerial ;
11161136}
11171137
11181138void loop ()
0 commit comments