From f47e60d1eacc5b201675863dd583859dbf9bdaa4 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Fri, 3 Mar 2023 11:48:38 +1100 Subject: [PATCH] AP_HAL_ChibiOS: add and use AP_WINCH_ENABLED --- ArduCopter/Copter.h | 1 + ArduCopter/config.h | 2 +- libraries/AP_HAL_ChibiOS/hwdef/include/minimize_features.inc | 3 +++ libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py | 4 ++++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ArduCopter/Copter.h b/ArduCopter/Copter.h index bbd39eec77..12ece2d13e 100644 --- a/ArduCopter/Copter.h +++ b/ArduCopter/Copter.h @@ -70,6 +70,7 @@ #include // ADS-B RF based collision avoidance module library #include // ArduPilot proximity sensor library #include +#include // Configuration #include "defines.h" diff --git a/ArduCopter/config.h b/ArduCopter/config.h index 222a2355b3..d31cc0a71b 100644 --- a/ArduCopter/config.h +++ b/ArduCopter/config.h @@ -147,7 +147,7 @@ ////////////////////////////////////////////////////////////////////////////// // winch support #ifndef WINCH_ENABLED -# define WINCH_ENABLED !HAL_MINIMIZE_FEATURES +# define WINCH_ENABLED AP_WINCH_ENABLED #endif ////////////////////////////////////////////////////////////////////////////// diff --git a/libraries/AP_HAL_ChibiOS/hwdef/include/minimize_features.inc b/libraries/AP_HAL_ChibiOS/hwdef/include/minimize_features.inc index 39da1694d1..19088c6c64 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/include/minimize_features.inc +++ b/libraries/AP_HAL_ChibiOS/hwdef/include/minimize_features.inc @@ -49,3 +49,6 @@ define NUM_SERVO_CHANNELS 16 define HAL_PLUSCODE_ENABLE 0 define HAL_OSD_SIDEBAR_ENABLE 0 define OSD_PARAM_ENABLED 0 + +# no Winch if minimized: +define AP_WINCH_ENABLED 0 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py index 23eb54dcf2..2df4ac1f80 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py +++ b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py @@ -3019,6 +3019,10 @@ def add_apperiph_defaults(f): #define HAL_ENABLE_SAVE_PERSISTENT_PARAMS 0 #endif +#ifndef AP_WINCH_ENABLED +#define AP_WINCH_ENABLED 0 +#endif + // end AP_Periph defaults ''')