From 309500c84fb17dc9611914c0c3e9670344b22627 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 4 May 2021 21:12:23 +1000 Subject: [PATCH] AP_HAL: allow for double EKF build --- libraries/AP_HAL/AP_HAL_Macros.h | 2 +- libraries/AP_HAL/board/chibios.h | 4 ++++ libraries/AP_HAL/board/linux.h | 8 ++++++++ libraries/AP_HAL/board/sitl.h | 7 +++++++ 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/libraries/AP_HAL/AP_HAL_Macros.h b/libraries/AP_HAL/AP_HAL_Macros.h index e16d26714d..5c198fed06 100644 --- a/libraries/AP_HAL/AP_HAL_Macros.h +++ b/libraries/AP_HAL/AP_HAL_Macros.h @@ -6,7 +6,7 @@ macros to allow code to build on multiple platforms more easily */ -#if CONFIG_HAL_BOARD == HAL_BOARD_SITL || CONFIG_HAL_BOARD == HAL_BOARD_LINUX +#if CONFIG_HAL_BOARD == HAL_BOARD_SITL || CONFIG_HAL_BOARD == HAL_BOARD_LINUX || HAL_WITH_EKF_DOUBLE /* allow double maths on Linux and SITL to avoid problems with system headers */ diff --git a/libraries/AP_HAL/board/chibios.h b/libraries/AP_HAL/board/chibios.h index 3993b2c2a9..fdca5eb609 100644 --- a/libraries/AP_HAL/board/chibios.h +++ b/libraries/AP_HAL/board/chibios.h @@ -56,6 +56,10 @@ #define HAL_WITH_RAMTRON 0 #endif +#ifndef HAL_WITH_EKF_DOUBLE +#define HAL_WITH_EKF_DOUBLE HAL_HAVE_HARDWARE_DOUBLE +#endif + // allow for static semaphores #include #define HAL_Semaphore ChibiOS::Semaphore diff --git a/libraries/AP_HAL/board/linux.h b/libraries/AP_HAL/board/linux.h index af2e1ad352..74847f28d8 100644 --- a/libraries/AP_HAL/board/linux.h +++ b/libraries/AP_HAL/board/linux.h @@ -355,3 +355,11 @@ #define HAL_Semaphore Linux::Semaphore #include #define HAL_EventHandle AP_HAL::EventHandle + +#ifndef HAL_HAVE_HARDWARE_DOUBLE +#define HAL_HAVE_HARDWARE_DOUBLE 1 +#endif + +#ifndef HAL_WITH_EKF_DOUBLE +#define HAL_WITH_EKF_DOUBLE HAL_HAVE_HARDWARE_DOUBLE +#endif diff --git a/libraries/AP_HAL/board/sitl.h b/libraries/AP_HAL/board/sitl.h index 54764e2fc1..075a3dc32c 100644 --- a/libraries/AP_HAL/board/sitl.h +++ b/libraries/AP_HAL/board/sitl.h @@ -71,3 +71,10 @@ #define HAL_BOARD_STORAGE_DIRECTORY "." #endif +#ifndef HAL_HAVE_HARDWARE_DOUBLE +#define HAL_HAVE_HARDWARE_DOUBLE 1 +#endif + +#ifndef HAL_WITH_EKF_DOUBLE +#define HAL_WITH_EKF_DOUBLE HAL_HAVE_HARDWARE_DOUBLE +#endif