|
52 | 52 |
|
53 | 53 | #include "u-blox_config_keys.h"
|
54 | 54 |
|
55 |
| -// Define Serial for SparkFun SAMD based boards. |
56 |
| -// Boards like the RedBoard Turbo use SerialUSB (not Serial). |
57 |
| -// But other boards like the SAMD51 Thing Plus use Serial (not SerialUSB). |
58 |
| -// The next nine lines let the code compile cleanly on as many SAMD boards as possible. |
59 |
| -#if defined(ARDUINO_ARCH_SAMD) // Is this a SAMD board? |
60 |
| -#if defined(USB_VID) // Is the USB Vendor ID defined? |
61 |
| -#if (USB_VID == 0x1B4F) // Is this a SparkFun board? |
62 |
| -#if !defined(ARDUINO_SAMD51_THING_PLUS) & !defined(ARDUINO_SAMD51_MICROMOD) // If it is not a SAMD51 Thing Plus or SAMD51 MicroMod |
63 |
| -#define Serial SerialUSB // Define Serial as SerialUSB |
64 |
| -#endif |
65 |
| -#endif |
66 |
| -#endif |
67 |
| -#endif |
68 | 55 | //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
69 | 56 |
|
70 | 57 | //Define a digital pin to aid checksum failure capture and analysis
|
@@ -623,7 +610,28 @@ class SFE_UBLOX_GPS
|
623 | 610 |
|
624 | 611 | boolean getRELPOSNED(uint16_t maxWait = 1100); //Get Relative Positioning Information of the NED frame
|
625 | 612 |
|
| 613 | + // Enable debug messages using the chosen Serial port (Stream) |
| 614 | + // Boards like the RedBoard Turbo use SerialUSB (not Serial). |
| 615 | + // But other boards like the SAMD51 Thing Plus use Serial (not SerialUSB). |
| 616 | + // These lines let the code compile cleanly on as many SAMD boards as possible. |
| 617 | + #if defined(ARDUINO_ARCH_SAMD) // Is this a SAMD board? |
| 618 | + #if defined(USB_VID) // Is the USB Vendor ID defined? |
| 619 | + #if (USB_VID == 0x1B4F) // Is this a SparkFun board? |
| 620 | + #if !defined(ARDUINO_SAMD51_THING_PLUS) & !defined(ARDUINO_SAMD51_MICROMOD) // If it is not a SAMD51 Thing Plus or SAMD51 MicroMod |
| 621 | + void enableDebugging(Stream &debugPort = SerialUSB, boolean printLimitedDebug = false); //Given a port to print to, enable debug messages. Default to all, not limited. |
| 622 | + #else |
626 | 623 | void enableDebugging(Stream &debugPort = Serial, boolean printLimitedDebug = false); //Given a port to print to, enable debug messages. Default to all, not limited.
|
| 624 | + #endif |
| 625 | + #else |
| 626 | + void enableDebugging(Stream &debugPort = Serial, boolean printLimitedDebug = false); //Given a port to print to, enable debug messages. Default to all, not limited. |
| 627 | + #endif |
| 628 | + #else |
| 629 | + void enableDebugging(Stream &debugPort = Serial, boolean printLimitedDebug = false); //Given a port to print to, enable debug messages. Default to all, not limited. |
| 630 | + #endif |
| 631 | + #else |
| 632 | + void enableDebugging(Stream &debugPort = Serial, boolean printLimitedDebug = false); //Given a port to print to, enable debug messages. Default to all, not limited. |
| 633 | + #endif |
| 634 | + |
627 | 635 | void disableDebugging(void); //Turn off debug statements
|
628 | 636 | void debugPrint(char *message); //Safely print debug statements
|
629 | 637 | void debugPrintln(char *message); //Safely print debug statements
|
|
0 commit comments