File tree Expand file tree Collapse file tree
examples/X_NUCLEO_GNSS1A1_HelloWorld_I2C Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,24 +58,24 @@ int waitType = 0;
5858#define waitForRequest 0
5959#define waitForAnswer 1
6060
61- TwoWire *devI2C;
61+ #ifdef ARDUINO_SAM_DUE
62+ #define DEV_I2C Wire1
63+ #endif
6264
65+ #ifdef ARDUINO_ARCH_STM32
66+ #define DEV_I2C Wire
67+ #endif
6368
6469
6570void setup ()
6671{
6772 // Initialize serial port for user communication
68- #ifdef ARDUINO_SAM_DUE
69- devI2C = &Wire1;
70- #else
71- devI2C = &Wire;
72- #endif
7373 Serial.begin (115200 );
7474 Serial.println (" Setup begin" );
7575 // Initialize the i2c communication
76- devI2C-> begin ();
76+ DEV_I2C. begin ();
7777 // Create the device object passing to it the i2c interface
78- gps = new TeseoLIV3F (devI2C , 7 , 13 );
78+ gps = new TeseoLIV3F (&DEV_I2C , 7 , 13 );
7979 // Initialize the device
8080 gps->init ();
8181 Serial.println (" Setup end" );
You can’t perform that action at this time.
0 commit comments