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

Conflict with IridiumSBD I2C library and SerialUSB (Qwiic Micro) #151

Closed
adamgarbo opened this issue Nov 22, 2020 · 3 comments · Fixed by #155
Closed

Conflict with IridiumSBD I2C library and SerialUSB (Qwiic Micro) #151

adamgarbo opened this issue Nov 22, 2020 · 3 comments · Fixed by #155
Labels
fixed Issue is fixed

Comments

@adamgarbo
Copy link
Contributor

Hi there,

I've encountered an issue when attempting to use a SparkFun Qwiic Micro with a RockBLOCK 9603 and the IridiumSBD I2C library. The issue is described in detail here: sparkfun/SparkFun_IridiumSBD_I2C_Arduino_Library#2

To summarize, the u-blox library is defining all instances of Serial as SerialUSB. However, the Qwiic Micro (one of the SerialUSB boards) uses Serial to connect to the RockBLOCK but this is being overwritten by the u-blox library as SerialUSB.

Commenting out line 63 resolves the issue:

#define Serial SerialUSB // Define Serial as SerialUSB

Cheers,
Adam

@PaulZC
Copy link
Collaborator

PaulZC commented Nov 23, 2020

Hi Adam (@adamgarbo),
Thanks for finding this!
I suspect that if we change this line, the issue will go away...
I'll run some tests.
Cheers,
Paul

@PaulZC
Copy link
Collaborator

PaulZC commented Nov 23, 2020

Hi Adam,
I'm not completely happy with this proposed fix - it is inelegant but seems to do the trick. Can you please test it?
75eedde
Many thanks,
Paul

@adamgarbo
Copy link
Contributor Author

Hi @PaulZC,

The fix appears to resolve the issue. In the case of the Qwiic Micro, it looks like SerialUSB will either need to be used explicitly, or a serial port definition other than Serial will need to be used (e.g. #define SERIAL_PORT SerialUSB).

I'd be curious to learn more about how the Arduino compiler and how it handles conflicting #define statements. If it was done in order, the two define statements below should in theory work. I don't think it's that simple, though!

#define Serial SerialUSB
#define IridiumSerial Serial

Cheers,
Adam

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
fixed Issue is fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants