diff --git a/libraries/AP_HAL_ChibiOS/hwdef/ARK_CANNODE/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/ARK_CANNODE/hwdef.dat index 7d690d41b122b..72c70c13be38e 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/ARK_CANNODE/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/ARK_CANNODE/hwdef.dat @@ -111,7 +111,7 @@ define GPS_MAX_RECEIVERS 1 define GPS_MAX_INSTANCES 1 define HAL_COMPASS_MAX_SENSORS 1 define AP_PERIPH_GPS_ENABLED 1 -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 define HAL_PERIPH_ENABLE_BARO define HAL_PERIPH_ENABLE_RC_OUT define HAL_PERIPH_ENABLE_NOTIFY diff --git a/libraries/AP_HAL_ChibiOS/hwdef/ARK_GPS/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/ARK_GPS/hwdef.dat index 838de1569d89b..adbe684dc7c16 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/ARK_GPS/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/ARK_GPS/hwdef.dat @@ -111,7 +111,7 @@ define GPS_MAX_RECEIVERS 1 define GPS_MAX_INSTANCES 1 define HAL_COMPASS_MAX_SENSORS 1 define AP_PERIPH_GPS_ENABLED 1 -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 define HAL_PERIPH_ENABLE_BARO define HAL_PERIPH_ENABLE_BUZZER define HAL_PERIPH_ENABLE_RC_OUT diff --git a/libraries/AP_HAL_ChibiOS/hwdef/ARK_RTK_GPS/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/ARK_RTK_GPS/hwdef.dat index ec16c07aac218..8efb3966cedcd 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/ARK_RTK_GPS/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/ARK_RTK_GPS/hwdef.dat @@ -123,7 +123,7 @@ define GPS_MAX_RECEIVERS 1 define GPS_MAX_INSTANCES 1 define HAL_COMPASS_MAX_SENSORS 1 define AP_PERIPH_GPS_ENABLED 1 -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 define HAL_PERIPH_ENABLE_BARO define HAL_PERIPH_ENABLE_BUZZER define HAL_PERIPH_ENABLE_NOTIFY diff --git a/libraries/AP_HAL_ChibiOS/hwdef/AeroFox-Airspeed-DLVR/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/AeroFox-Airspeed-DLVR/hwdef.dat index 2ba36a1af34cb..b32a46850e1e4 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/AeroFox-Airspeed-DLVR/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/AeroFox-Airspeed-DLVR/hwdef.dat @@ -10,7 +10,7 @@ define HAL_AIRSPEED_TYPE_DEFAULT 9 define AIRSPEED_MAX_SENSORS 1 define HAL_PERIPH_ENABLE_AIRSPEED -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 COMPASS QMC5883L I2C:0:0x0D false ROTATION_ROLL_180_YAW_90 COMPASS RM3100 I2C:0:0x20 false ROTATION_NONE COMPASS RM3100 I2C:0:0x21 false ROTATION_NONE diff --git a/libraries/AP_HAL_ChibiOS/hwdef/AeroFox-Airspeed/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/AeroFox-Airspeed/hwdef.dat index 5ca9c621c6a71..c78991ab27e6f 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/AeroFox-Airspeed/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/AeroFox-Airspeed/hwdef.dat @@ -10,7 +10,7 @@ define HAL_AIRSPEED_TYPE_DEFAULT 1 define AIRSPEED_MAX_SENSORS 1 define HAL_PERIPH_ENABLE_AIRSPEED -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 COMPASS QMC5883L I2C:0:0x0D false ROTATION_ROLL_180_YAW_90 COMPASS RM3100 I2C:0:0x20 false ROTATION_NONE COMPASS RM3100 I2C:0:0x21 false ROTATION_NONE diff --git a/libraries/AP_HAL_ChibiOS/hwdef/AeroFox-GNSS_F9P/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/AeroFox-GNSS_F9P/hwdef.dat index 4e8a7e7d21ade..9e1a14a905566 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/AeroFox-GNSS_F9P/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/AeroFox-GNSS_F9P/hwdef.dat @@ -81,7 +81,7 @@ define HAL_PERIPH_GPS_PORT_DEFAULT 0 # allow for F9P GPS modules with moving baseline define GPS_MOVING_BASELINE 1 -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 define HAL_COMPASS_MAX_SENSORS 1 # QMC5883L for different board varients diff --git a/libraries/AP_HAL_ChibiOS/hwdef/BirdCANdy/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/BirdCANdy/hwdef.dat index e9c54b8e1e000..0fe5876f5e0fa 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/BirdCANdy/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/BirdCANdy/hwdef.dat @@ -101,7 +101,7 @@ define HAL_COMPASS_MAX_SENSORS 1 # RCOU+GPS+MAG+BARO+Buzzer+NeoPixels define HAL_PERIPH_ENABLE_RC_OUT define AP_PERIPH_GPS_ENABLED 1 -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 define HAL_PERIPH_ENABLE_BARO define HAL_PERIPH_ENABLE_BUZZER define HAL_PERIPH_NEOPIXEL_COUNT 8 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/C-RTK2-HP/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/C-RTK2-HP/hwdef.dat index d88af3c236ca5..14ffb1be36043 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/C-RTK2-HP/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/C-RTK2-HP/hwdef.dat @@ -101,7 +101,7 @@ define GPS_MAX_INSTANCES 1 define AP_PERIPH_GPS_ENABLED 1 define GPS_MOVING_BASELINE 1 -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 define HAL_COMPASS_MAX_SENSORS 1 define AP_GPS_BACKEND_DEFAULT_ENABLED 0 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/CUAV_GPS/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/CUAV_GPS/hwdef.dat index 35b513a90593a..81c3a4d238269 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/CUAV_GPS/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/CUAV_GPS/hwdef.dat @@ -131,7 +131,7 @@ define HAL_COMPASS_MAX_SENSORS 1 # GPS+MAG+BARO+Buzzer+NeoPixels define AP_PERIPH_GPS_ENABLED 1 -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 define HAL_PERIPH_ENABLE_BARO # do direct neopixel LED output to enable the 'rainbow' effect on diff --git a/libraries/AP_HAL_ChibiOS/hwdef/CarbonixF405/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/CarbonixF405/hwdef.dat index 4076be53d4bc1..0f7c4f28d8e78 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/CarbonixF405/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/CarbonixF405/hwdef.dat @@ -112,7 +112,7 @@ define HAL_NO_GCS define AP_PARAM_MAX_EMBEDDED_PARAM 512 -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 define HAL_PERIPH_ENABLE_BARO define HAL_PERIPH_ENABLE_RC_OUT diff --git a/libraries/AP_HAL_ChibiOS/hwdef/CarbonixL496/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/CarbonixL496/hwdef.dat index fcb49ad7beb43..f69d78995c082 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/CarbonixL496/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/CarbonixL496/hwdef.dat @@ -115,7 +115,7 @@ define HAL_NO_GCS define AP_PARAM_MAX_EMBEDDED_PARAM 512 -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 define HAL_PERIPH_ENABLE_BARO define HAL_PERIPH_ENABLE_RC_OUT diff --git a/libraries/AP_HAL_ChibiOS/hwdef/CubeBlack-periph/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/CubeBlack-periph/hwdef.dat index d43a91164e1e8..55240ba00c83e 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/CubeBlack-periph/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/CubeBlack-periph/hwdef.dat @@ -25,7 +25,7 @@ env AP_PERIPH 1 define AP_PERIPH_GPS_ENABLED 1 -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 define HAL_PERIPH_ENABLE_BARO define HAL_PERIPH_ENABLE_RC_OUT diff --git a/libraries/AP_HAL_ChibiOS/hwdef/CubeOrange-periph-heavy/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/CubeOrange-periph-heavy/hwdef.dat index 9298c8969cc99..fcc4f21248c78 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/CubeOrange-periph-heavy/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/CubeOrange-periph-heavy/hwdef.dat @@ -18,7 +18,7 @@ env AP_PERIPH_HEAVY 1 define AP_CAN_SLCAN_ENABLED 1 define AP_PERIPH_BATTERY_ENABLED 1 define AP_PERIPH_GPS_ENABLED 1 -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 define HAL_PERIPH_ENABLE_BARO define HAL_PERIPH_ENABLE_RC_OUT define HAL_PERIPH_ENABLE_NOTIFY diff --git a/libraries/AP_HAL_ChibiOS/hwdef/CubeOrange-periph/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/CubeOrange-periph/hwdef.dat index 6f2b7e8b4e929..2e12823414eac 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/CubeOrange-periph/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/CubeOrange-periph/hwdef.dat @@ -18,7 +18,7 @@ env AP_PERIPH 1 define AP_CAN_SLCAN_ENABLED 1 define AP_PERIPH_BATTERY_ENABLED 1 define AP_PERIPH_GPS_ENABLED 1 -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 define HAL_PERIPH_ENABLE_BARO define HAL_PERIPH_ENABLE_RC_OUT define HAL_PERIPH_ENABLE_NOTIFY diff --git a/libraries/AP_HAL_ChibiOS/hwdef/FreeflyRTK/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/FreeflyRTK/hwdef.dat index 441a334964674..6d8c4a9ebc59b 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/FreeflyRTK/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/FreeflyRTK/hwdef.dat @@ -123,7 +123,7 @@ define HAL_COMPASS_MAX_SENSORS 1 # GPS+MAG+BARO+Buzzer+NeoPixels define AP_PERIPH_GPS_ENABLED 1 -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 define HAL_PERIPH_ENABLE_BARO define HAL_PERIPH_ENABLE_RC_OUT define HAL_PERIPH_ENABLE_NOTIFY diff --git a/libraries/AP_HAL_ChibiOS/hwdef/Here4AP/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/Here4AP/hwdef.dat index b1ea28453797c..d520476418710 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/Here4AP/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/Here4AP/hwdef.dat @@ -116,7 +116,7 @@ define HAL_COMPASS_MAX_SENSORS 1 define AP_PERIPH_GPS_ENABLED 1 -define HAL_PERIPH_ENABLE_MAG 1 +define AP_PERIPH_MAG_ENABLED 1 1 define GPS_MOVING_BASELINE 1 define HAL_PERIPH_GPS_PORT_DEFAULT 3 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/HitecMosaic/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/HitecMosaic/hwdef.dat index acacc9540897b..afccf9e322ddf 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/HitecMosaic/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/HitecMosaic/hwdef.dat @@ -139,7 +139,7 @@ env ROMFS_UNCOMPRESSED True define AP_PERIPH_GPS_ENABLED 1 -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 define HAL_PERIPH_ENABLE_BARO # septentrio on com 3 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/HolybroG4_Compass/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/HolybroG4_Compass/hwdef.dat index 2b849b6f64ea8..77b5c896747d5 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/HolybroG4_Compass/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/HolybroG4_Compass/hwdef.dat @@ -87,7 +87,7 @@ define HAL_DEVICE_THREAD_STACK 768 define AP_PARAM_MAX_EMBEDDED_PARAM 256 # MAG -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 # keep ROMFS uncompressed as we don't have enough RAM # to uncompress the bootloader at runtime diff --git a/libraries/AP_HAL_ChibiOS/hwdef/HolybroG4_GPS/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/HolybroG4_GPS/hwdef.dat index 386f13a4f24a5..2f5cb43ec88e2 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/HolybroG4_GPS/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/HolybroG4_GPS/hwdef.dat @@ -142,7 +142,7 @@ define HAL_PERIPH_ENABLE_IMU # GPS+MAG+LEDs define AP_PERIPH_GPS_ENABLED 1 -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 define HAL_PERIPH_ENABLE_BARO define HAL_PERIPH_ENABLE_IMU define HAL_PERIPH_ENABLE_NOTIFY diff --git a/libraries/AP_HAL_ChibiOS/hwdef/HolybroGPS/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/HolybroGPS/hwdef.dat index 339e6f47228c3..6ecb29d893431 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/HolybroGPS/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/HolybroGPS/hwdef.dat @@ -138,7 +138,7 @@ define HAL_COMPASS_MAX_SENSORS 1 # GPS+MAG+BARO+LEDs define AP_PERIPH_GPS_ENABLED 1 -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 define HAL_PERIPH_ENABLE_BARO define HAL_PERIPH_ENABLE_NOTIFY define HAL_PERIPH_ENABLE_RC_OUT diff --git a/libraries/AP_HAL_ChibiOS/hwdef/MFE_POS3_CAN/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/MFE_POS3_CAN/hwdef.dat index c9210c0d1caf1..f82cf60072f92 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/MFE_POS3_CAN/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/MFE_POS3_CAN/hwdef.dat @@ -98,7 +98,7 @@ define GPS_MOVING_BASELINE 1 # GPS+MAG+BARO+LEDs define AP_PERIPH_GPS_ENABLED 1 -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 # GPS on 1st port define HAL_PERIPH_GPS_PORT_DEFAULT 1 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/MatekG474-GPS/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/MatekG474-GPS/hwdef.dat index 54e4a040b7881..7ce661e6945ca 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/MatekG474-GPS/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/MatekG474-GPS/hwdef.dat @@ -18,7 +18,7 @@ define GPS_MOVING_BASELINE 1 # ----------- COMPASS -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 SPIDEV rm3100 SPI2 DEVID1 MAG_CS MODE0 1*MHZ 1*MHZ COMPASS RM3100 SPI:rm3100 false ROTATION_PITCH_180 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/MatekG474-Periph/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/MatekG474-Periph/hwdef.dat index 161cf12c289b1..81d2f2ce43ba6 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/MatekG474-Periph/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/MatekG474-Periph/hwdef.dat @@ -12,7 +12,7 @@ define GPS_MOVING_BASELINE 1 # ----------- COMPASS -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 SPIDEV rm3100 SPI2 DEVID1 MAG_CS MODE0 1*MHZ 1*MHZ COMPASS RM3100 SPI:rm3100 false ROTATION_PITCH_180 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/MatekH743-periph/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/MatekH743-periph/hwdef.dat index 5ff4250377966..a8e2bab91d074 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/MatekH743-periph/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/MatekH743-periph/hwdef.dat @@ -17,7 +17,7 @@ env AP_PERIPH 1 define AP_PERIPH_GPS_ENABLED 1 -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 define HAL_PERIPH_ENABLE_BARO define HAL_PERIPH_ENABLE_AIRSPEED define HAL_PERIPH_ENABLE_ADSB diff --git a/libraries/AP_HAL_ChibiOS/hwdef/MatekL431-GPS/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/MatekL431-GPS/hwdef.dat index 68b82ccc08822..f0b52133f39af 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/MatekL431-GPS/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/MatekL431-GPS/hwdef.dat @@ -12,7 +12,7 @@ define HAL_PERIPH_GPS_PORT_DEFAULT 2 # allow for F9P GPS modules with moving baseline define GPS_MOVING_BASELINE 1 -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 define HAL_PROBE_EXTERNAL_I2C_COMPASSES define HAL_COMPASS_MAX_SENSORS 1 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/MatekL431-MagHiRes/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/MatekL431-MagHiRes/hwdef.dat index 5908add14a797..42f6862f4c2e0 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/MatekL431-MagHiRes/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/MatekL431-MagHiRes/hwdef.dat @@ -1,7 +1,7 @@ include ../MatekL431/hwdef.inc -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 SPIDEV rm3100 SPI1 DEVID1 MAG_CS MODE0 1*MHZ 1*MHZ COMPASS RM3100 SPI:rm3100 false ROTATION_PITCH_180 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/MatekL431-Periph/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/MatekL431-Periph/hwdef.dat index e4913a47e1592..575f1861d00bb 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/MatekL431-Periph/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/MatekL431-Periph/hwdef.dat @@ -29,7 +29,7 @@ define AP_GPS_SBF_ENABLED 0 define AP_GPS_GSOF_ENABLED 0 # ---------------------- COMPASS --------------------------- -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 SPIDEV rm3100 SPI1 DEVID1 MAG_CS MODE0 1*MHZ 1*MHZ COMPASS RM3100 SPI:rm3100 false ROTATION_PITCH_180 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/Nucleo-L476/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/Nucleo-L476/hwdef.dat index 48aac7d48b52d..5ab040c8b3329 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/Nucleo-L476/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/Nucleo-L476/hwdef.dat @@ -92,7 +92,7 @@ define AP_PARAM_MAX_EMBEDDED_PARAM 512 define AP_PERIPH_GPS_ENABLED 1 define HAL_PERIPH_GPS_PORT_DEFAULT 0 -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 define HAL_PROBE_EXTERNAL_I2C_COMPASSES define HAL_I2C_INTERNAL_MASK 0 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/Nucleo-L496/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/Nucleo-L496/hwdef.dat index c88c27c7e02c6..6df88261149a4 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/Nucleo-L496/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/Nucleo-L496/hwdef.dat @@ -98,7 +98,7 @@ PA4 VSENSE ADC1 SCALE(2) define AP_PARAM_MAX_EMBEDDED_PARAM 512 define AP_PERIPH_GPS_ENABLED 1 -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 define HAL_PERIPH_ENABLE_BARO define HAL_PERIPH_ENABLE_AIRSPEED diff --git a/libraries/AP_HAL_ChibiOS/hwdef/Pixracer-periph/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/Pixracer-periph/hwdef.dat index bdd7f73286848..08114a20cca3c 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/Pixracer-periph/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/Pixracer-periph/hwdef.dat @@ -67,7 +67,7 @@ define AIRSPEED_MAX_SENSORS 1 define AP_PERIPH_GPS_ENABLED 1 define HAL_PERIPH_GPS_PORT_DEFAULT 3 -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 define HAL_PERIPH_ENABLE_BARO define AP_PERIPH_BATTERY_ENABLED 1 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/Sierra-F405/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/Sierra-F405/hwdef.dat index 964b0d4576a21..8cbd900e6c1cb 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/Sierra-F405/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/Sierra-F405/hwdef.dat @@ -83,7 +83,7 @@ define GPS_MAX_RECEIVERS 1 define GPS_MAX_INSTANCES 1 # ---------------------- COMPASS --------------------------- -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 SPIDEV rm3100 SPI1 DEVID1 MAG_CS MODE0 1*MHZ 1*MHZ COMPASS RM3100 SPI:rm3100 false ROTATION_PITCH_180 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/Sierra-F412/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/Sierra-F412/hwdef.dat index a04b5521495f1..c50ba5b1c874a 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/Sierra-F412/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/Sierra-F412/hwdef.dat @@ -102,7 +102,7 @@ define HAL_COMPASS_MAX_SENSORS 1 # GPS+MAG+BARO+Buzzer+NeoPixels define AP_PERIPH_GPS_ENABLED 1 define HAL_PERIPH_GPS_PORT_DEFAULT 3 -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 define HAL_PERIPH_ENABLE_BARO define HAL_PERIPH_ENABLE_RC_OUT define HAL_PERIPH_ENABLE_NOTIFY diff --git a/libraries/AP_HAL_ChibiOS/hwdef/Sierra-F9P/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/Sierra-F9P/hwdef.dat index 4aa1caf235286..3794a77a0d41a 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/Sierra-F9P/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/Sierra-F9P/hwdef.dat @@ -113,7 +113,7 @@ define HAL_COMPASS_MAX_SENSORS 1 # GPS+MAG+BARO+Buzzer+NeoPixels define AP_PERIPH_GPS_ENABLED 1 -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 define HAL_PERIPH_ENABLE_BARO define HAL_PERIPH_ENABLE_RC_OUT define HAL_PERIPH_ENABLE_NOTIFY diff --git a/libraries/AP_HAL_ChibiOS/hwdef/Sierra-L431/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/Sierra-L431/hwdef.dat index 4ae1b0a63d936..328f57aa8460c 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/Sierra-L431/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/Sierra-L431/hwdef.dat @@ -94,7 +94,7 @@ PA0 VDD_5V_SENS ADC1 SCALE(2) define AP_PARAM_MAX_EMBEDDED_PARAM 512 -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 define HAL_PERIPH_ENABLE_AIRSPEED define AIRSPEED_MAX_SENSORS 1 define HAL_AIRSPEED_TYPE_DEFAULT 1 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/Sierra-PrecisionPoint/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/Sierra-PrecisionPoint/hwdef.dat index a70f103910978..258c27f6fa311 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/Sierra-PrecisionPoint/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/Sierra-PrecisionPoint/hwdef.dat @@ -109,7 +109,7 @@ define HAL_COMPASS_MAX_SENSORS 1 # GPS+MAG+BARO+NeoPixels define AP_PERIPH_GPS_ENABLED 1 -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 define HAL_PERIPH_ENABLE_BARO define HAL_PERIPH_ENABLE_RC_OUT define HAL_PERIPH_ENABLE_NOTIFY diff --git a/libraries/AP_HAL_ChibiOS/hwdef/Sierra-TrueNavIC/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/Sierra-TrueNavIC/hwdef.dat index 2c05188baea1d..740a59454681f 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/Sierra-TrueNavIC/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/Sierra-TrueNavIC/hwdef.dat @@ -89,7 +89,7 @@ env ROMFS_UNCOMPRESSED True # enable GPS and compass define AP_PERIPH_GPS_ENABLED 1 define GPS_MAX_RATE_MS 200 -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 define HAL_PERIPH_ENABLE_BARO # disable dual GPS and GPS blending to save flash space diff --git a/libraries/AP_HAL_ChibiOS/hwdef/Sierra-TrueNavPro-G4/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/Sierra-TrueNavPro-G4/hwdef.dat index 5a6e8a7753f77..2764f8f9b7b1d 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/Sierra-TrueNavPro-G4/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/Sierra-TrueNavPro-G4/hwdef.dat @@ -84,7 +84,7 @@ define HAL_COMPASS_MAX_SENSORS 1 # GPS+MAG+BARO+LEDs define AP_PERIPH_GPS_ENABLED 1 -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 define HAL_PERIPH_ENABLE_BARO define HAL_PERIPH_NEOPIXEL_CHAN_WITHOUT_NOTIFY 0 define HAL_PERIPH_NEOPIXEL_COUNT_WITHOUT_NOTIFY 8 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/Sierra-TrueNavPro/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/Sierra-TrueNavPro/hwdef.dat index d74ca816980f2..75351254e6c1a 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/Sierra-TrueNavPro/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/Sierra-TrueNavPro/hwdef.dat @@ -87,7 +87,7 @@ env ROMFS_UNCOMPRESSED True # enable GPS and compass define AP_PERIPH_GPS_ENABLED 1 -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 define HAL_PERIPH_ENABLE_BARO define HAL_PERIPH_ENABLE_RC_OUT define HAL_PERIPH_ENABLE_NOTIFY diff --git a/libraries/AP_HAL_ChibiOS/hwdef/Sierra-TrueNorth/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/Sierra-TrueNorth/hwdef.dat index 93d1f863d0a1d..24005b955d96c 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/Sierra-TrueNorth/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/Sierra-TrueNorth/hwdef.dat @@ -63,7 +63,7 @@ define HAL_PERIPH_LISTEN_FOR_SERIAL_UART_REBOOT_CMD_PORT 0 env ROMFS_UNCOMPRESSED True # enable compass and airspeed -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 define HAL_COMPASS_MAX_SENSORS 1 # PWM, WS2812 LED diff --git a/libraries/AP_HAL_ChibiOS/hwdef/Sierra-TrueSpeed/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/Sierra-TrueSpeed/hwdef.dat index c831aece13cab..d23a8d2b8ae20 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/Sierra-TrueSpeed/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/Sierra-TrueSpeed/hwdef.dat @@ -82,7 +82,7 @@ define HAL_PERIPH_LISTEN_FOR_SERIAL_UART_REBOOT_CMD_PORT 0 env ROMFS_UNCOMPRESSED True # enable compass and airspeed -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 define HAL_PERIPH_ENABLE_AIRSPEED define HAL_COMPASS_MAX_SENSORS 1 define AIRSPEED_MAX_SENSORS 1 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/ZubaxGNSS/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/ZubaxGNSS/hwdef.dat index caf26bafa9ce0..4a52289c9c114 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/ZubaxGNSS/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/ZubaxGNSS/hwdef.dat @@ -131,7 +131,7 @@ BARO MS56XX SPI:ms5611 define HAL_BARO_ALLOW_INIT_NO_BARO define AP_PERIPH_GPS_ENABLED 1 -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 define HAL_PERIPH_ENABLE_BARO # reduce the number of CAN RX Buffer diff --git a/libraries/AP_HAL_ChibiOS/hwdef/f103-ADSB/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/f103-ADSB/hwdef.dat index 333f3120cb315..48a2110f88a17 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/f103-ADSB/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/f103-ADSB/hwdef.dat @@ -10,4 +10,4 @@ define AIRSPEED_MAX_SENSORS 1 define HAL_PERIPH_ADSB_PORT_DEFAULT 3 define HAL_PERIPH_ENABLE_ADSB define HAL_PERIPH_ENABLE_AIRSPEED -# define HAL_PERIPH_ENABLE_MAG +# define AP_PERIPH_MAG_ENABLED 1 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/f103-GPS/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/f103-GPS/hwdef.dat index 944400d3568aa..78e3fd9e7974d 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/f103-GPS/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/f103-GPS/hwdef.dat @@ -26,6 +26,6 @@ define AP_GPS_SBF_ENABLED 0 define AP_GPS_GSOF_ENABLED 0 # MAG -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 #define HAL_PERIPH_ENABLE_NCP5623_LED_WITHOUT_NOTIFY define HAL_PERIPH_ENABLE_TOSHIBA_LED_WITHOUT_NOTIFY diff --git a/libraries/AP_HAL_ChibiOS/hwdef/f103-QiotekPeriph/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/f103-QiotekPeriph/hwdef.dat index 443e803e9f23c..fdb8253d93521 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/f103-QiotekPeriph/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/f103-QiotekPeriph/hwdef.dat @@ -7,7 +7,7 @@ define HAL_AIRSPEED_TYPE_DEFAULT 15 define AIRSPEED_MAX_SENSORS 1 define HAL_PERIPH_ENABLE_AIRSPEED -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 COMPASS IST8310 I2C:0:0x0E false ROTATION_ROLL_180_YAW_270 COMPASS QMC5883L I2C:0:0x0D false ROTATION_ROLL_180_YAW_270 COMPASS RM3100 I2C:0:0x20 false ROTATION_NONE diff --git a/libraries/AP_HAL_ChibiOS/hwdef/f303-GPS/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/f303-GPS/hwdef.dat index 6f5a9e00cd3e5..bc428328be958 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/f303-GPS/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/f303-GPS/hwdef.dat @@ -10,7 +10,7 @@ define HAL_PROBE_EXTERNAL_I2C_COMPASSES # GPS+MAG define AP_PERIPH_GPS_ENABLED 1 -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 define HAL_PERIPH_ENABLE_NCP5623_LED_WITHOUT_NOTIFY # allow for F9P GPS modules with moving baseline diff --git a/libraries/AP_HAL_ChibiOS/hwdef/f303-M10025/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/f303-M10025/hwdef.dat index 5cef29a36cd24..367832906db64 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/f303-M10025/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/f303-M10025/hwdef.dat @@ -11,7 +11,7 @@ BARO DPS310 I2C:0:0x77 # GPS+MAG+LED+Baro define AP_PERIPH_GPS_ENABLED 1 -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 define HAL_PERIPH_ENABLE_NCP5623_BGR_LED_WITHOUT_NOTIFY define HAL_PERIPH_ENABLE_BARO # I2C Airspeed sensor must use a different address than 0x77 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/f303-M10070/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/f303-M10070/hwdef.dat index f1d7e0cbe2e0d..4f3716e2626db 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/f303-M10070/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/f303-M10070/hwdef.dat @@ -14,7 +14,7 @@ BARO DPS280 I2C:0:0x77 # GPS+MAG+LED+Baro define AP_PERIPH_GPS_ENABLED 1 -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 define HAL_PERIPH_ENABLE_NCP5623_BGR_LED_WITHOUT_NOTIFY define HAL_PERIPH_ENABLE_BARO diff --git a/libraries/AP_HAL_ChibiOS/hwdef/f303-MatekGPS/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/f303-MatekGPS/hwdef.dat index a74568a616a5e..fd9550bf37258 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/f303-MatekGPS/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/f303-MatekGPS/hwdef.dat @@ -122,7 +122,7 @@ BARO DPS310 I2C:0:0x76 # enable builtin GPS, mag and baro # also allow for airspeed on i2c port, and rangefinder on MSP port define AP_PERIPH_GPS_ENABLED 1 -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 define HAL_PERIPH_ENABLE_BARO define HAL_PERIPH_ENABLE_AIRSPEED define HAL_PERIPH_ENABLE_RANGEFINDER diff --git a/libraries/AP_HAL_ChibiOS/hwdef/f303-Universal/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/f303-Universal/hwdef.dat index 1f9eb9308a8f3..aac04b6822b42 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/f303-Universal/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/f303-Universal/hwdef.dat @@ -6,7 +6,7 @@ define HAL_PROBE_EXTERNAL_I2C_COMPASSES # enable all features define AP_PERIPH_GPS_ENABLED 1 -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 define HAL_PERIPH_ENABLE_BARO define HAL_PERIPH_ENABLE_AIRSPEED define HAL_PERIPH_ENABLE_ADSB diff --git a/libraries/AP_HAL_ChibiOS/hwdef/f405-MatekGPS/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/f405-MatekGPS/hwdef.dat index e21bd3c9ab599..dd3aaf21f212b 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/f405-MatekGPS/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/f405-MatekGPS/hwdef.dat @@ -144,7 +144,7 @@ define GPS_MAX_INSTANCES 1 # ---------------------- COMPASS --------------------------- -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 SPIDEV rm3100 SPI2 DEVID1 MAG_CS MODE0 1*MHZ 1*MHZ COMPASS RM3100 SPI:rm3100 false ROTATION_PITCH_180 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/mRoKitCANrevC/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/mRoKitCANrevC/hwdef.dat index 3c5b6a84a473a..b5b5233e80e52 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/mRoKitCANrevC/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/mRoKitCANrevC/hwdef.dat @@ -17,7 +17,7 @@ BARO DPS310 I2C:0:0x77 # GPS+MAG+LED+Baro define AP_PERIPH_GPS_ENABLED 1 -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 define HAL_PERIPH_ENABLE_NCP5623_BGR_LED_WITHOUT_NOTIFY define HAL_PERIPH_ENABLE_BARO # I2C Airspeed sensor must use a different address than 0x77 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/rGNSS/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/rGNSS/hwdef.dat index 188be0ea31675..69025f3ee3071 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/rGNSS/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/rGNSS/hwdef.dat @@ -115,7 +115,7 @@ define GPS_MOVING_BASELINE 1 # GPS+MAG+BARO+LEDs define AP_PERIPH_GPS_ENABLED 1 -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 define HAL_PERIPH_ENABLE_BARO define HAL_PERIPH_ENABLE_NOTIFY define HAL_PERIPH_ENABLE_RC_OUT diff --git a/libraries/AP_HAL_ChibiOS/hwdef/scripts/defaults_periph.h b/libraries/AP_HAL_ChibiOS/hwdef/scripts/defaults_periph.h index 39007428ca433..35d6d0789041e 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/scripts/defaults_periph.h +++ b/libraries/AP_HAL_ChibiOS/hwdef/scripts/defaults_periph.h @@ -172,6 +172,9 @@ #ifdef HAL_PERIPH_ENABLE_AHRS #error "Change 'define HAL_PERIPH_ENABLE_AHRS' to 'define AP_PERIPH_AHRS_ENABLED 1'" #endif +#ifdef HAL_PERIPH_ENABLE_MAG +#error "Change 'define HAL_PERIPH_ENABLE_MAG' to 'define AP_PERIPH_MAG_ENABLED 1'" +#endif /* * defaults for various AP_Periph features: @@ -188,6 +191,9 @@ #ifndef AP_PERIPH_AHRS_ENABLED #define AP_PERIPH_AHRS_ENABLED 0 #endif +#ifndef AP_PERIPH_MAG_ENABLED +#define AP_PERIPH_MAG_ENABLED 0 +#endif /* * turning on of ArduPilot features based on which AP_Periph features @@ -196,6 +202,7 @@ #define AP_BATTERY_ENABLED AP_PERIPH_BATTERY_ENABLED #define AP_GPS_ENABLED AP_PERIPH_GPS_ENABLED #define AP_AHRS_ENABLED AP_PERIPH_AHRS_ENABLED +#define AP_COMPASS_ENABLED AP_PERIPH_MAG_ENABLED /* * GPS Backends - we selectively turn backends on. @@ -381,7 +388,6 @@ #define AP_BATTERY_ESC_TELEM_OUTBOUND_ENABLED 0 #endif -#define AP_COMPASS_ENABLED defined(HAL_PERIPH_ENABLE_MAG) #define AP_BARO_ENABLED defined(HAL_PERIPH_ENABLE_BARO) #define AP_RANGEFINDER_ENABLED defined(HAL_PERIPH_ENABLE_RANGEFINDER) #define AP_RPM_ENABLED defined(HAL_PERIPH_ENABLE_RPM) diff --git a/libraries/AP_HAL_ChibiOS/hwdef/sw-nav-f405/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/sw-nav-f405/hwdef.dat index b525c809fd408..61155370c429e 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/sw-nav-f405/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/sw-nav-f405/hwdef.dat @@ -56,7 +56,7 @@ define AP_HAL_UARTDRIVER_ENABLED 0 define HAL_USE_ADC FALSE # compass -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 COMPASS MMC3416 I2C:0:0x30 false ROTATION_NONE diff --git a/libraries/AP_HAL_ChibiOS/hwdef/sw-spar-f407/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/sw-spar-f407/hwdef.dat index 86b5caf2ee357..71ca187745994 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/sw-spar-f407/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/sw-spar-f407/hwdef.dat @@ -95,7 +95,7 @@ define HAL_PERIPH_ENABLE_RANGEFINDER 2 define AP_PERIPH_RANGEFINDER_PORT_DEFAULT 2 # compass -define HAL_PERIPH_ENABLE_MAG +define AP_PERIPH_MAG_ENABLED 1 define HAL_COMPASS_MAX_SENSORS 2 COMPASS MMC3416 I2C:0:0x30 false ROTATION_NONE