From 0f49b7f3ab90bc857e14ac3c58299d417bd5b3b0 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Mon, 15 Aug 2022 15:27:28 +1000 Subject: [PATCH] AP_HAL: move defaulting of HAL_DSHOT_ALARM into hwdef --- libraries/AP_HAL/AP_HAL_Boards.h | 4 ++++ libraries/AP_HAL/board/chibios.h | 8 -------- libraries/AP_HAL/board/linux.h | 1 - libraries/AP_HAL/board/sitl.h | 1 - 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/libraries/AP_HAL/AP_HAL_Boards.h b/libraries/AP_HAL/AP_HAL_Boards.h index 3cb843faaa..80d47142cc 100644 --- a/libraries/AP_HAL/AP_HAL_Boards.h +++ b/libraries/AP_HAL/AP_HAL_Boards.h @@ -285,6 +285,10 @@ #define AP_SIGNED_FIRMWARE 0 #endif +#ifndef HAL_DSHOT_ALARM_ENABLED +#define HAL_DSHOT_ALARM_ENABLED 0 +#endif + #ifndef HAL_HNF_MAX_FILTERS // On an F7 The difference in CPU load between 1 notch and 24 notches is about 2% // The difference in CPU load between 1Khz backend and 2Khz backend is about 10% diff --git a/libraries/AP_HAL/board/chibios.h b/libraries/AP_HAL/board/chibios.h index fa3e48511e..0227b684b6 100644 --- a/libraries/AP_HAL/board/chibios.h +++ b/libraries/AP_HAL/board/chibios.h @@ -111,14 +111,6 @@ #define HAL_SUPPORT_RCOUT_SERIAL !defined(HAL_BUILD_AP_PERIPH) #endif -#ifndef HAL_DSHOT_ALARM -#if !defined(HAL_BUILD_AP_PERIPH) && !defined(HAL_BOOTLOADER_BUILD) && HAL_PWM_COUNT > 0 -#define HAL_DSHOT_ALARM 1 -#else -#define HAL_DSHOT_ALARM 0 -#endif -#endif - // by default assume first I2C bus is internal #ifndef HAL_I2C_INTERNAL_MASK #define HAL_I2C_INTERNAL_MASK 1 diff --git a/libraries/AP_HAL/board/linux.h b/libraries/AP_HAL/board/linux.h index 9a83d781e7..1bbdcddd5f 100644 --- a/libraries/AP_HAL/board/linux.h +++ b/libraries/AP_HAL/board/linux.h @@ -7,7 +7,6 @@ #define HAL_OS_SOCKETS 1 #define HAL_STORAGE_SIZE 16384 #define HAL_STORAGE_SIZE_AVAILABLE HAL_STORAGE_SIZE -#define HAL_DSHOT_ALARM 0 // make sensor selection clearer #define PROBE_IMU_I2C(driver, bus, addr, args ...) ADD_BACKEND(AP_InertialSensor_ ## driver::probe(*this,GET_I2C_DEVICE(bus, addr),##args)) diff --git a/libraries/AP_HAL/board/sitl.h b/libraries/AP_HAL/board/sitl.h index 090aea7cfa..f55e3ba520 100644 --- a/libraries/AP_HAL/board/sitl.h +++ b/libraries/AP_HAL/board/sitl.h @@ -5,7 +5,6 @@ #define HAL_MEM_CLASS HAL_MEM_CLASS_1000 #define HAL_OS_POSIX_IO 1 #define HAL_OS_SOCKETS 1 -#define HAL_DSHOT_ALARM 0 #define HAL_WITH_ESC_TELEM 1 #define AP_FLASHSTORAGE_TYPE 3