Skip to content

Commit

Permalink
AP_HAL_ChibiOS: create and use AP_PERIPH_AHRS_ENABLED
Browse files Browse the repository at this point in the history
  • Loading branch information
shiv-tyagi authored and peterbarker committed Jan 28, 2025
1 parent e0c9f5f commit 99a5018
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion libraries/AP_HAL_ChibiOS/hwdef/scripts/defaults_periph.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@
#ifdef HAL_PERIPH_ENABLE_BATTERY_BALANCE
#error "Change 'define HAL_PERIPH_ENABLE_BATTERY_BALANCE' to 'define AP_PERIPH_BATTERY_BALANCE_ENABLED 1'"
#endif
#ifdef HAL_PERIPH_ENABLE_AHRS
#error "Change 'define HAL_PERIPH_ENABLE_AHRS' to 'define AP_PERIPH_AHRS_ENABLED 1'"
#endif

/*
* defaults for various AP_Periph features:
Expand All @@ -182,13 +185,17 @@
#ifndef AP_PERIPH_GPS_ENABLED
#define AP_PERIPH_GPS_ENABLED 0
#endif
#ifndef AP_PERIPH_AHRS_ENABLED
#define AP_PERIPH_AHRS_ENABLED 0
#endif

/*
* turning on of ArduPilot features based on which AP_Periph features
* are enabled:
*/
#define AP_BATTERY_ENABLED AP_PERIPH_BATTERY_ENABLED
#define AP_GPS_ENABLED AP_PERIPH_GPS_ENABLED
#define AP_AHRS_ENABLED AP_PERIPH_AHRS_ENABLED

/*
* GPS Backends - we selectively turn backends on.
Expand Down Expand Up @@ -374,7 +381,6 @@
#define AP_BATTERY_ESC_TELEM_OUTBOUND_ENABLED 0
#endif

#define AP_AHRS_ENABLED defined(HAL_PERIPH_ENABLE_AHRS)
#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)
Expand Down

0 comments on commit 99a5018

Please sign in to comment.