Skip to content

Commit 652b736

Browse files
peterbarkerandyp1per
authored andcommitted
AP_Compass: have AK09916-via-ICM20948 depend on AP_INERTIALSENSOR_ENABLED
1 parent 3b09612 commit 652b736

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

libraries/AP_Compass/AP_Compass_AK09916.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ AP_Compass_Backend *AP_Compass_AK09916::probe_ICM20948(uint8_t inv2_instance,
175175
AP_Compass_Backend *AP_Compass_AK09916::probe_ICM20948_SPI(uint8_t inv2_instance,
176176
enum Rotation rotation)
177177
{
178-
#if AP_INERTIALSENSOR_ENABLED
179178
AP_InertialSensor &ins = AP::ins();
180179

181180
AP_AK09916_BusDriver *bus =
@@ -191,9 +190,6 @@ AP_Compass_Backend *AP_Compass_AK09916::probe_ICM20948_SPI(uint8_t inv2_instance
191190
}
192191

193192
return sensor;
194-
#else
195-
return nullptr;
196-
#endif
197193
}
198194

199195
AP_Compass_Backend *AP_Compass_AK09916::probe_ICM20948_I2C(uint8_t inv2_instance,

libraries/AP_Compass/AP_Compass_config.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <AP_MSP/msp.h>
66
#include <AP_AHRS/AP_AHRS_config.h>
77
#include <AP_GPS/AP_GPS_config.h>
8+
#include <AP_InertialSensor/AP_InertialSensor_config.h>
89

910
#ifndef AP_COMPASS_ENABLED
1011
#define AP_COMPASS_ENABLED 1
@@ -85,7 +86,7 @@
8586
#endif
8687

8788
#ifndef AP_COMPASS_ICM20948_ENABLED
88-
#define AP_COMPASS_ICM20948_ENABLED AP_COMPASS_I2C_BACKEND_DEFAULT_ENABLED
89+
#define AP_COMPASS_ICM20948_ENABLED AP_COMPASS_I2C_BACKEND_DEFAULT_ENABLED && AP_INERTIALSENSOR_ENABLED
8990
#endif
9091

9192
#ifndef AP_COMPASS_IIS2MDC_ENABLED

0 commit comments

Comments
 (0)