@@ -445,6 +445,22 @@ float batteryChargingPercentPerHour;
445
445
#include " bluetoothSelect.h"
446
446
#endif // COMPILE_BT
447
447
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
+
448
464
#define platformPrefix platformPrefixTable[productVariant] // Sets the prefix for broadcast names
449
465
450
466
#include < driver/uart.h> // Required for uart_set_rx_full_threshold() on cores <v2.0.5
@@ -1113,6 +1129,10 @@ void setup()
1113
1129
systemPrintf (" %8d mSec: Total boot time\r\n " , bootTime[bootTimeIndex]);
1114
1130
systemPrintln ();
1115
1131
}
1132
+
1133
+ // If necessary, switch to sending GNSS data out the USB serial port
1134
+ // to the PC
1135
+ forwardGnssDataToUsbSerial = settings.enableGnssToUsbSerial ;
1116
1136
}
1117
1137
1118
1138
void loop ()
0 commit comments