Skip to content

Commit

Permalink
AP_HAL_ChibiOS: use AP_PERIPH_IMU_ENABLED in place of HAL_PERIPH_ENAB…
Browse files Browse the repository at this point in the history
…LE_IMU
  • Loading branch information
shiv-tyagi authored and peterbarker committed Feb 7, 2025
1 parent 61fb095 commit f62e65f
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 8 deletions.
5 changes: 4 additions & 1 deletion libraries/AP_HAL_ChibiOS/hwdef/CubeNode-ETH/hwdef.dat
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ include ../CubeNode/hwdef.dat
undef PE0
undef PE1
undef PC12
undef HAL_PERIPH_ENABLE_IMU
undef AP_PERIPH_IMU_ENABLED
undef HAL_GCS_ENABLED

# disable IMU
def AP_PERIPH_IMU_ENABLED 0

# need to use UART8 to get RTS/CTS
PE1 UART8_TX UART8
PE0 UART8_RX UART8
Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_HAL_ChibiOS/hwdef/CubeNode/hwdef.dat
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ SPIDEV icm45686 SPI3 DEVID4 IMU_CS MODE0 24*MHZ 24*MHZ

IMU Invensensev3 SPI:icm45686 ROTATION_NONE

define HAL_PERIPH_ENABLE_IMU
define AP_PERIPH_IMU_ENABLED 1

# Periph GCS
define HAL_GCS_ENABLED 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ define AP_PERIPH_MAG_ENABLED 1
define AP_PERIPH_BARO_ENABLED 1
define HAL_PERIPH_ENABLE_RC_OUT
define HAL_PERIPH_ENABLE_NOTIFY
define HAL_PERIPH_ENABLE_IMU
define AP_PERIPH_IMU_ENABLED 1
define HAL_LOGGING_ENABLED TRUE


Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_HAL_ChibiOS/hwdef/CubeOrange-periph/hwdef.dat
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ define AP_PERIPH_MAG_ENABLED 1
define AP_PERIPH_BARO_ENABLED 1
define HAL_PERIPH_ENABLE_RC_OUT
define HAL_PERIPH_ENABLE_NOTIFY
define HAL_PERIPH_ENABLE_IMU
define AP_PERIPH_IMU_ENABLED 1

define AP_KDECAN_ENABLED 1

Expand Down
3 changes: 1 addition & 2 deletions libraries/AP_HAL_ChibiOS/hwdef/HolybroG4_GPS/hwdef.dat
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,12 @@ SPIDEV icm42688 SPI1 DEVID1 ICM_CS MODE0 24*MHZ 24*MHZ

IMU Invensensev3 SPI:icm42688 ROTATION_YAW_180

define HAL_PERIPH_ENABLE_IMU
define AP_PERIPH_IMU_ENABLED 1

# GPS+MAG+LEDs
define AP_PERIPH_GPS_ENABLED 1
define AP_PERIPH_MAG_ENABLED 1
define AP_PERIPH_BARO_ENABLED 1
define HAL_PERIPH_ENABLE_IMU
define HAL_PERIPH_ENABLE_NOTIFY
define HAL_PERIPH_ENABLE_RC_OUT

Expand Down
10 changes: 8 additions & 2 deletions libraries/AP_HAL_ChibiOS/hwdef/scripts/defaults_periph.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@
#ifdef HAL_PERIPH_ENABLE_RANGEFINDER
#error "Change 'define HAL_PERIPH_ENABLE_RANGEFINDER' to 'define AP_PERIPH_RANGEFINDER_ENABLED 1'"
#endif
#ifdef HAL_PERIPH_ENABLE_IMU
#error "Change 'define HAL_PERIPH_ENABLE_IMU' to 'define AP_PERIPH_IMU_ENABLED 1'"
#endif

/*
* defaults for various AP_Periph features:
Expand All @@ -206,6 +209,9 @@
#ifndef AP_PERIPH_RANGEFINDER_ENABLED
#define AP_PERIPH_RANGEFINDER_ENABLED 0
#endif
#ifndef AP_PERIPH_IMU_ENABLED
#define AP_PERIPH_IMU_ENABLED 0
#endif

/*
* turning on of ArduPilot features based on which AP_Periph features
Expand All @@ -217,6 +223,8 @@
#define AP_COMPASS_ENABLED AP_PERIPH_MAG_ENABLED
#define AP_BARO_ENABLED AP_PERIPH_BARO_ENABLED
#define AP_RANGEFINDER_ENABLED AP_PERIPH_RANGEFINDER_ENABLED
#define AP_INERTIALSENSOR_ENABLED AP_PERIPH_IMU_ENABLED
#define AP_INERTIALSENSOR_ALLOW_NO_SENSORS AP_PERIPH_IMU_ENABLED

/*
* GPS Backends - we selectively turn backends on.
Expand Down Expand Up @@ -406,8 +414,6 @@
#define AP_RCPROTOCOL_ENABLED defined(HAL_PERIPH_ENABLE_RCIN)
#define AP_RTC_ENABLED defined(HAL_PERIPH_ENABLE_RTC)
#define HAL_VISUALODOM_ENABLED defined(HAL_PERIPH_ENABLE_VISUALODOM)
#define AP_INERTIALSENSOR_ENABLED defined(HAL_PERIPH_ENABLE_IMU)
#define AP_INERTIALSENSOR_ALLOW_NO_SENSORS defined(HAL_PERIPH_ENABLE_IMU)
#define AP_INERTIALSENSOR_HARMONICNOTCH_ENABLED 0

#ifndef AP_BOOTLOADER_ALWAYS_ERASE
Expand Down

0 comments on commit f62e65f

Please sign in to comment.