Skip to content

Commit d385ea0

Browse files
committed
Fix has_include usage
1 parent 7d4cfd0 commit d385ea0

File tree

4 files changed

+10
-35
lines changed

4 files changed

+10
-35
lines changed

src/ArduinoIMU.h

-29
This file was deleted.

src/Arduino_LSM6DS3.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1818
*/
1919

20-
#ifndef _ARUDINO_LSM6DS3_H_
21-
#define _ARUDINO_LSM6DS3_H_
20+
#ifndef _ARDUINO_LSM6DS3_H_
21+
#define _ARDUINO_LSM6DS3_H_
2222

2323
#include "LSM6DS3.h"
2424

src/LSM6DS3.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,8 @@ int LSM6DS3Class::writeRegister(uint8_t address, uint8_t value)
207207
}
208208
return 1;
209209
}
210-
#ifdef IMU_INCLUDED
210+
211+
#ifndef LSM6DS3_SHOULDNT_DECLARE_IMU_OBJECT
211212
#ifdef ARDUINO_AVR_UNO_WIFI_REV2
212213
LSM6DS3Class IMU(SPI, SPIIMU_SS, SPIIMU_INT);
213214
#else

src/LSM6DS3.h

+6-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,12 @@
2020
#include <Arduino.h>
2121
#include <Wire.h>
2222
#include <SPI.h>
23-
#include "ArduinoIMU.h"
2423

25-
#define IMU_INCLUDED !HAS_INCLUDE_IMU
24+
#if defined __has_include
25+
#if __has_include("Arduino_LSM6DSOX.h") || __has_include("Arduino_LSM9DS1.h") || __has_include("BoschSensorClass.h")
26+
#define LSM6DS3_SHOULDNT_DECLARE_IMU_OBJECT
27+
#endif
28+
#endif
2629

2730
#define LSM6DS3_ADDRESS 0x6A
2831

@@ -87,6 +90,6 @@ class LSM6DS3Class {
8790

8891
SPISettings _spiSettings;
8992
};
90-
#ifdef IMU_INCLUDED
93+
#ifndef LSM6DS3_SHOULDNT_DECLARE_IMU_OBJECT
9194
extern LSM6DS3Class IMU;
9295
#endif

0 commit comments

Comments
 (0)