Skip to content
This repository was archived by the owner on Jan 28, 2021. It is now read-only.

Commit f07ca08

Browse files
committed
Update SparkFun_Ublox_Arduino_Library.h
1 parent 20490f1 commit f07ca08

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Diff for: src/SparkFun_Ublox_Arduino_Library.h

+11-2
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,17 @@
7777
#endif
7878

7979
// Define Serial for SparkFun SAMD based boards.
80-
#if defined(ARDUINO_ARCH_SAMD)
81-
#define Serial SerialUSB
80+
// Boards like the RedBoard Turbo use SerialUSB (not Serial).
81+
// But other boards like the SAMD51 Thing Plus use Serial (not SerialUSB).
82+
// The next nine lines let the code compile cleanly on as many SAMD boards as possible.
83+
#if defined(ARDUINO_ARCH_SAMD) // Is this a SAMD board?
84+
#if defined(USB_VID) // Is the USB Vendor ID defined?
85+
#if (USB_VID == 0x1B4F) // Is this a SparkFun board?
86+
#if !defined(ARDUINO_SAMD51_THING_PLUS) // If it is not a SAMD51 Thing Plus
87+
#define Serial SerialUSB // Define Serial as SerialUSB
88+
#endif
89+
#endif
90+
#endif
8291
#endif
8392
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
8493

0 commit comments

Comments
 (0)