You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/u-blox_GNSS.h
+16-14Lines changed: 16 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -130,6 +130,8 @@ class DevUBLOXGNSS
130
130
// Flag to indicate if we are connected to UART1 or UART2
131
131
// Needed to select the correct config items when enabling a periodic message
132
132
bool _UART2 = false; // Default to UART1
133
+
// the lock / unlock functions can be used if you have multiple tasks writing to the bus.
134
+
// the idea is that in a RTOS you override this class and the two functions in which you take and give a mutex.
133
135
virtualboollock(void) { returntrue; }
134
136
virtualvoidunlock(void) { }
135
137
public:
@@ -181,18 +183,18 @@ class DevUBLOXGNSS
181
183
#if defined(USB_VID) // Is the USB Vendor ID defined?
182
184
#if (USB_VID == 0x1B4F) // Is this a SparkFun board?
183
185
#if !defined(ARDUINO_SAMD51_THING_PLUS) & !defined(ARDUINO_SAMD51_MICROMOD) // If it is not a SAMD51 Thing Plus or SAMD51 MicroMod
184
-
voidenableDebugging(Stream &debugPort = SerialUSB, bool printLimitedDebug = false); // Given a port to print to, enable debug messages. Default to all, not limited.
186
+
voidenableDebugging(Print &debugPort = SerialUSB, bool printLimitedDebug = false); // Given a port to print to, enable debug messages. Default to all, not limited.
185
187
#else
186
-
voidenableDebugging(Stream &debugPort = Serial, bool printLimitedDebug = false); // Given a port to print to, enable debug messages. Default to all, not limited.
188
+
voidenableDebugging(Print &debugPort = Serial, bool printLimitedDebug = false); // Given a port to print to, enable debug messages. Default to all, not limited.
187
189
#endif
188
190
#else
189
-
voidenableDebugging(Stream &debugPort = Serial, bool printLimitedDebug = false); // Given a port to print to, enable debug messages. Default to all, not limited.
191
+
voidenableDebugging(Print &debugPort = Serial, bool printLimitedDebug = false); // Given a port to print to, enable debug messages. Default to all, not limited.
190
192
#endif
191
193
#else
192
-
voidenableDebugging(Stream &debugPort = Serial, bool printLimitedDebug = false); // Given a port to print to, enable debug messages. Default to all, not limited.
194
+
voidenableDebugging(Print &debugPort = Serial, bool printLimitedDebug = false); // Given a port to print to, enable debug messages. Default to all, not limited.
193
195
#endif
194
196
#else
195
-
voidenableDebugging(Stream &debugPort = Serial, bool printLimitedDebug = false); // Given a port to print to, enable debug messages. Default to all, not limited.
197
+
voidenableDebugging(Print &debugPort = Serial, bool printLimitedDebug = false); // Given a port to print to, enable debug messages. Default to all, not limited.
196
198
#endif
197
199
198
200
voiddisableDebugging(void); // Turn off debug statements
@@ -319,10 +321,10 @@ class DevUBLOXGNSS
319
321
boolsetUSBInput(uint8_t comSettings, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Configure USB port to output UBX, NMEA, RTCM3, SPARTN or a combination thereof
320
322
boolsetSPIInput(uint8_t comSettings, uint8_t layer = VAL_LAYER_RAM_BBR, uint16_t maxWait = kUBLOXGNSSDefaultMaxWait); // Configure SPI port to output UBX, NMEA, RTCM3, SPARTN or a combination thereof
321
323
322
-
voidsetNMEAOutputPort(Stream &outputPort); // Sets the internal variable for the port to direct only NMEA characters to
323
-
voidsetRTCMOutputPort(Stream &outputPort); // Sets the internal variable for the port to direct only RTCM characters to
324
-
voidsetUBXOutputPort(Stream &outputPort); // Sets the internal variable for the port to direct only UBX characters to
325
-
voidsetOutputPort(Stream &outputPort); // Sets the internal variable for the port to direct ALL characters to
324
+
voidsetNMEAOutputPort(Print &outputPort); // Sets the internal variable for the port to direct only NMEA characters to
325
+
voidsetRTCMOutputPort(Print &outputPort); // Sets the internal variable for the port to direct only RTCM characters to
326
+
voidsetUBXOutputPort(Print &outputPort); // Sets the internal variable for the port to direct only UBX characters to
327
+
voidsetOutputPort(Print &outputPort); // Sets the internal variable for the port to direct ALL characters to
326
328
327
329
// Reset to defaults
328
330
@@ -1352,11 +1354,11 @@ class DevUBLOXGNSS
1352
1354
// Variables
1353
1355
SparkFun_UBLOX_GNSS::GNSSDeviceBus *_sfeBus;
1354
1356
1355
-
SparkFun_UBLOX_GNSS::SfeStream _nmeaOutputPort; // The user can assign an output port to print NMEA sentences if they wish
1356
-
SparkFun_UBLOX_GNSS::SfeStream _rtcmOutputPort; // The user can assign an output port to print RTCM sentences if they wish
1357
-
SparkFun_UBLOX_GNSS::SfeStream _ubxOutputPort; // The user can assign an output port to print UBX sentences if they wish
1358
-
SparkFun_UBLOX_GNSS::SfeStream _outputPort; // The user can assign an output port to print ALL characters to if they wish
1359
-
SparkFun_UBLOX_GNSS::SfeStream _debugSerial; // The stream to send debug messages to if enabled
1357
+
SparkFun_UBLOX_GNSS::SfePrint _nmeaOutputPort; // The user can assign an output port to print NMEA sentences if they wish
1358
+
SparkFun_UBLOX_GNSS::SfePrint _rtcmOutputPort; // The user can assign an output port to print RTCM sentences if they wish
1359
+
SparkFun_UBLOX_GNSS::SfePrint _ubxOutputPort; // The user can assign an output port to print UBX sentences if they wish
1360
+
SparkFun_UBLOX_GNSS::SfePrint _outputPort; // The user can assign an output port to print ALL characters to if they wish
1361
+
SparkFun_UBLOX_GNSS::SfePrint _debugSerial; // The stream to send debug messages to if enabled
1360
1362
bool _printDebug = false; // Flag to print the serial commands we are sending to the Serial port for debug
1361
1363
bool _printLimitedDebug = false; // Flag to print limited debug messages. Useful for I2C debugging or high navigation rates
0 commit comments