Skip to content

Commit bb26957

Browse files
committed
Fix coexistence with other IMU libs
1 parent bd9bae6 commit bb26957

File tree

3 files changed

+7
-37
lines changed

3 files changed

+7
-37
lines changed

src/ArduinoIMU.h

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/BMI270.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,8 @@ void BoschSensorClass::print_rslt(int8_t rslt)
452452
}
453453
}
454454

455-
#if IMU_INCLUDED
456-
BoschSensorClass IMU(Wire1);
455+
#ifdef TARGET_ARDUINO_NANO33BLE
456+
BoschSensorClass IMU_BMI270_BMM150(Wire1);
457+
#else
458+
BoschSensorClass IMU_BMI270_BMM150(Wire);
457459
#endif

src/BoschSensorClass.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@
2121
#include <Wire.h>
2222
#include "utilities/BMI270-Sensor-API/bmi270.h"
2323
#include "utilities/BMM150-Sensor-API/bmm150.h"
24-
#include "ArduinoIMU.h"
2524

26-
27-
#define IMU_INCLUDED !HAS_INCLUDE_IMU
2825
struct dev_info {
2926
TwoWire* _wire;
3027
uint8_t dev_addr;
@@ -87,6 +84,6 @@ class BoschSensorClass {
8784
uint16_t _int_status;
8885
};
8986

90-
#if IMU_INCLUDED
91-
extern BoschSensorClass IMU;
92-
#endif
87+
extern BoschSensorClass IMU_BMI270_BMM150;
88+
#undef IMU
89+
#define IMU IMU_BMI270_BMM150

0 commit comments

Comments
 (0)