From fbb9e3eeee0330fd9fa64d81d47851aa12801f10 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Sat, 23 Mar 2024 01:00:48 +1100 Subject: [PATCH 1/2] hwdef: make a skyviper.inc, use it on skyviper-journey --- libraries/AP_HAL_ChibiOS/hwdef/include/skyviper.inc | 4 ++++ libraries/AP_HAL_ChibiOS/hwdef/skyviper-journey/hwdef.dat | 1 + libraries/AP_HAL_ChibiOS/hwdef/skyviper-v2450/hwdef.dat | 1 + 3 files changed, 6 insertions(+) create mode 100644 libraries/AP_HAL_ChibiOS/hwdef/include/skyviper.inc diff --git a/libraries/AP_HAL_ChibiOS/hwdef/include/skyviper.inc b/libraries/AP_HAL_ChibiOS/hwdef/include/skyviper.inc new file mode 100644 index 0000000000000..ce71694dfc776 --- /dev/null +++ b/libraries/AP_HAL_ChibiOS/hwdef/include/skyviper.inc @@ -0,0 +1,4 @@ +# include file for SkyViper boards. Move things in from +# skyviper-v2450/hwdef.dat as required. + +define AP_AIRSPEED_ENABLED 0 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/skyviper-journey/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/skyviper-journey/hwdef.dat index 5a3282bd63e63..a6711bd7eafb2 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/skyviper-journey/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/skyviper-journey/hwdef.dat @@ -134,6 +134,7 @@ env BUILD_ABIN True define AP_PARAM_MAX_EMBEDDED_PARAM 8192 # Disable un-needed hardware drivers +include ../include/skyviper.inc define HAL_WITH_ESC_TELEM 0 define AP_FETTEC_ONEWIRE_ENABLED 0 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/skyviper-v2450/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/skyviper-v2450/hwdef.dat index 88a6bf4711a66..9f110769cb3bc 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/skyviper-v2450/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/skyviper-v2450/hwdef.dat @@ -68,6 +68,7 @@ STORAGE_FLASH_PAGE 22 env BUILD_ABIN True # Disable un-needed hardware drivers +include ../include/skyviper.inc define AP_AIRSPEED_ENABLED 0 define AP_BEACON_ENABLED 0 define AP_OPTICALFLOW_ENABLED 0 From 1928f06f747244f89786a4d64eb1341b0561a069 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Sat, 23 Mar 2024 00:46:46 +1100 Subject: [PATCH 2/2] AP_Radio: correct guards around code in AP_Radio_cc2500 these were missed in a cleanup; the header is already guarded with these --- libraries/AP_Radio/AP_Radio_cc2500.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libraries/AP_Radio/AP_Radio_cc2500.cpp b/libraries/AP_Radio/AP_Radio_cc2500.cpp index fd6fc0a676e43..34ef0eef3041d 100644 --- a/libraries/AP_Radio/AP_Radio_cc2500.cpp +++ b/libraries/AP_Radio/AP_Radio_cc2500.cpp @@ -3,13 +3,14 @@ Many thanks to the cleanflight and betaflight projects */ +#include "AP_Radio_config.h" + +#if AP_RADIO_CC2500_ENABLED + #include // #pragma GCC optimize("O0") -#if CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS -#if HAL_RCINPUT_WITH_AP_RADIO - #include #include "AP_Radio_cc2500.h" #include @@ -1563,5 +1564,4 @@ void AP_Radio_cc2500::check_double_bind(void) radio_singleton->nextChannel(1); } -#endif // HAL_RCINPUT_WITH_AP_RADIO -#endif // CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS +#endif // AP_RADIO_CC2500_ENABLED