AP_Compass: do not detect extra bmm150 instances on SkyViper-v2450

This commit is contained in:
Peter Barker 2023-02-08 10:48:11 +11:00 committed by Peter Barker
parent a7a2779a0f
commit 9035de80ca
2 changed files with 10 additions and 1 deletions

View File

@ -1251,7 +1251,7 @@ void Compass::_probe_external_i2c_compasses(void)
#endif
#endif
#if AP_COMPASS_BMM150_ENABLED
#if AP_COMPASS_BMM150_DETECT_BACKENDS_ENABLED
// BMM150 on I2C
FOREACH_I2C_EXTERNAL(i) {
for (uint8_t addr=BMM150_I2C_ADDR_MIN; addr <= BMM150_I2C_ADDR_MAX; addr++) {

View File

@ -42,6 +42,15 @@
#define AP_COMPASS_BMM150_ENABLED AP_COMPASS_I2C_BACKEND_DEFAULT_ENABLED && !defined(STM32F1)
#endif
// this define dictates whether we iterate over the external i2c
// busses looking for BMM150. Ordinarily this should be true, but
// SkyViper specifies its BMM150 and thus does not need to probe.
// This is an interim arrangement until PCNC1 is eliminated as an
// auto-detect board.
#ifndef AP_COMPASS_BMM150_DETECT_BACKENDS_ENABLED
#define AP_COMPASS_BMM150_DETECT_BACKENDS_ENABLED AP_COMPASS_BMM150_ENABLED
#endif
#ifndef AP_COMPASS_HMC5843_ENABLED
#define AP_COMPASS_HMC5843_ENABLED AP_COMPASS_I2C_BACKEND_DEFAULT_ENABLED
#endif