Skip to content

Commit e65a387

Browse files
committed
Fix coexistence with other IMU libs
1 parent 42f0656 commit e65a387

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/LSM9DS1.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ int LSM9DS1Class::writeRegister(uint8_t slaveAddress, uint8_t address, uint8_t v
259259
}
260260

261261
#ifdef ARDUINO_ARDUINO_NANO33BLE
262-
LSM9DS1Class IMU(Wire1);
262+
LSM9DS1Class IMU_LSM9DS1(Wire1);
263263
#else
264-
LSM9DS1Class IMU(Wire);
265-
#endif
264+
LSM9DS1Class IMU_LSM9DS1(Wire);
265+
#endif

src/LSM9DS1.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,6 @@ class LSM9DS1Class {
5858
TwoWire* _wire;
5959
};
6060

61-
extern LSM9DS1Class IMU;
61+
extern LSM9DS1Class IMU_LSM9DS1;
62+
#undef IMU
63+
#define IMU IMU_LSM9DS1

0 commit comments

Comments
 (0)