From e788941f7094c72ecbe991f808b0c53f5784e086 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Sun, 10 Apr 2022 09:17:23 +1000 Subject: [PATCH] hwdef: turn off various GPS backends on on AP_Periph --- .../AP_HAL_ChibiOS/hwdef/f103-GPS/hwdef.dat | 8 +++- .../hwdef/scripts/chibios_hwdef.py | 46 +++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/libraries/AP_HAL_ChibiOS/hwdef/f103-GPS/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/f103-GPS/hwdef.dat index 7348b44ce4..97f3199056 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/f103-GPS/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/f103-GPS/hwdef.dat @@ -10,8 +10,14 @@ define HAL_PROBE_EXTERNAL_I2C_COMPASSES undef HAL_UART_MIN_TX_SIZE define HAL_UART_MIN_TX_SIZE 256 -# GPS+MAG +# GPS define HAL_PERIPH_ENABLE_GPS +# restrict backends available on f103: +define AP_GPS_NOVA_ENABLED 0 +define AP_GPS_SBF_ENABLED 0 +define AP_GPS_GSOF_ENABLED 0 + +# MAG define HAL_PERIPH_ENABLE_MAG #define HAL_PERIPH_ENABLE_NCP5623_LED_WITHOUT_NOTIFY define HAL_PERIPH_ENABLE_TOSHIBA_LED_WITHOUT_NOTIFY diff --git a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py index 7fa212f6e4..171a23f137 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py +++ b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py @@ -2782,6 +2782,52 @@ def add_apperiph_defaults(f): #define AP_ROBOTISSERVO_ENABLED 0 #endif +/* + * GPS Backends - we selectively turn backends on. + * Note also that f103-GPS explicitly disables some of these backends. + */ +#define AP_GPS_BACKEND_DEFAULT_ENABLED 0 + +#ifndef AP_GPS_ERB_ENABLED +#define AP_GPS_ERB_ENABLED 0 +#endif + +#ifndef AP_GPS_GSOF_ENABLED +#define AP_GPS_GSOF_ENABLED defined(HAL_PERIPH_ENABLE_GPS) +#endif + +#ifndef AP_GPS_NMEA_ENABLED +#define AP_GPS_NMEA_ENABLED 0 +#endif + +#ifndef AP_GPS_SBF_ENABLED +#define AP_GPS_SBF_ENABLED defined(HAL_PERIPH_ENABLE_GPS) +#endif + +#ifndef AP_GPS_SBP_ENABLED +#define AP_GPS_SBP_ENABLED 0 +#endif + +#ifndef AP_GPS_SBP2_ENABLED +#define AP_GPS_SBP2_ENABLED 0 +#endif + +#ifndef AP_GPS_SIRF_ENABLED +#define AP_GPS_SIRF_ENABLED 0 +#endif + +#ifndef AP_GPS_MAV_ENABLED +#define AP_GPS_MAV_ENABLED 0 +#endif + +#ifndef AP_GPS_NOVA_ENABLED +#define AP_GPS_NOVA_ENABLED defined(HAL_PERIPH_ENABLE_GPS) +#endif + +#ifndef HAL_SIM_GPS_ENABLED +#define HAL_SIM_GPS_ENABLED (AP_SIM_ENABLED && defined(HAL_PERIPH_ENABLE_GPS)) +#endif + ''')