Skip to content

Commit 7f911da

Browse files
author
noah-jonathan rosa
committed
Removed macro definition of Wire
1 parent 33edb9e commit 7f911da

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

examples/X_NUCLEO_GNSS1A1_HelloWorld_I2C/X_NUCLEO_GNSS1A1_HelloWorld_I2C.ino

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,24 @@ int waitType = 0;
5858
#define waitForRequest 0
5959
#define waitForAnswer 1
6060

61-
#ifdef ARDUINO_SAM_DUE
62-
#define Wire Wire1
63-
#endif
61+
TwoWire *devI2C;
62+
63+
6464

6565
void setup()
6666
{
6767
//Initialize serial port for user communication
68+
#ifdef ARDUINO_SAM_DUE
69+
devI2C = &Wire1;
70+
#else
71+
devI2C = &Wire;
72+
#endif
6873
Serial.begin(115200);
6974
Serial.println("Setup begin");
7075
//Initialize the i2c communication
71-
Wire.begin();
76+
devI2C->begin();
7277
//Create the device object passing to it the i2c interface
73-
gps = new TeseoLIV3F(&Wire, 7, 13);
78+
gps = new TeseoLIV3F(devI2C, 7, 13);
7479
//Initialize the device
7580
gps->init();
7681
Serial.println("Setup end");

0 commit comments

Comments
 (0)