From d07419e3da1d574c001184fee3ee8a74b93b0361 Mon Sep 17 00:00:00 2001 From: Henry Wurzburg Date: Wed, 18 Oct 2023 09:17:06 -0500 Subject: [PATCH] hwdef:free flash for space critical bds --- libraries/AP_HAL_ChibiOS/hwdef/F4BY/hwdef.dat | 2 ++ libraries/AP_HAL_ChibiOS/hwdef/FlyingMoonF407/hwdef.dat | 2 ++ libraries/AP_HAL_ChibiOS/hwdef/FlywooF405S-AIO/hwdef.dat | 2 ++ libraries/AP_HAL_ChibiOS/hwdef/JHEMCU-GSF405A-RX2/hwdef.dat | 4 +++- libraries/AP_HAL_ChibiOS/hwdef/JHEMCU-GSF405A/hwdef.dat | 2 ++ libraries/AP_HAL_ChibiOS/hwdef/KakuteF7/hwdef.dat | 1 + libraries/AP_HAL_ChibiOS/hwdef/MatekF405/hwdef.dat | 6 +----- libraries/AP_HAL_ChibiOS/hwdef/SuccexF4/hwdef.dat | 4 +++- libraries/AP_HAL_ChibiOS/hwdef/crazyflie2/hwdef.dat | 4 ++++ libraries/AP_HAL_ChibiOS/hwdef/mini-pix/hwdef.dat | 2 ++ libraries/AP_HAL_ChibiOS/hwdef/speedybeef4/hwdef.dat | 5 +++-- libraries/AP_HAL_ChibiOS/hwdef/speedybeef4v3/hwdef.dat | 5 +++-- 12 files changed, 28 insertions(+), 11 deletions(-) diff --git a/libraries/AP_HAL_ChibiOS/hwdef/F4BY/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/F4BY/hwdef.dat index 0f484d47451cf0..f966f1308f9f01 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/F4BY/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/F4BY/hwdef.dat @@ -162,3 +162,5 @@ PC9 EXTERN_GPIO5 OUTPUT GPIO(5) # IRQ for MPU6000 PB0 EXTI_MPU6000 INPUT PULLUP PB1 DRDY_HMC5883 INPUT PULLUP + +AUTOBUILD_TARGETS Copter diff --git a/libraries/AP_HAL_ChibiOS/hwdef/FlyingMoonF407/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/FlyingMoonF407/hwdef.dat index b21c3ec1dd3ea5..fe19cec968e3b0 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/FlyingMoonF407/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/FlyingMoonF407/hwdef.dat @@ -175,3 +175,5 @@ PE5 TIM9_CH1 TIM9 ALARM # IRQ for MPU6000 PB0 DRDY_ICM20689 INPUT PULLUP PB1 DRDY_IST8310 INPUT PULLUP + +include ../include/minimize_common.inc diff --git a/libraries/AP_HAL_ChibiOS/hwdef/FlywooF405S-AIO/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/FlywooF405S-AIO/hwdef.dat index d159f6b2f65157..de334979da0cd3 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/FlywooF405S-AIO/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/FlywooF405S-AIO/hwdef.dat @@ -152,3 +152,5 @@ define DEFAULT_NTF_LED_TYPES 257 # save some flash space include ../include/no_bootloader_DFU.inc + +AUTOBUILD_TARGETS Copter diff --git a/libraries/AP_HAL_ChibiOS/hwdef/JHEMCU-GSF405A-RX2/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/JHEMCU-GSF405A-RX2/hwdef.dat index f4b81633c89cdb..5df908756f41d8 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/JHEMCU-GSF405A-RX2/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/JHEMCU-GSF405A-RX2/hwdef.dat @@ -25,4 +25,6 @@ PA3 TIM2_CH4 TIM2 PWM(3) GPIO(52) PA2 TIM2_CH3 TIM2 PWM(4) GPIO(53) BIDIR DMA_PRIORITY SPI1* SPI3* TIM1_CH2 TIM2_UP TIM3_UP -DMA_NOSHARE USART2* \ No newline at end of file +DMA_NOSHARE USART2* + +AUTOBUILD_TARGETS Copter diff --git a/libraries/AP_HAL_ChibiOS/hwdef/JHEMCU-GSF405A/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/JHEMCU-GSF405A/hwdef.dat index 9a5766c43e103a..85ee746142daea 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/JHEMCU-GSF405A/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/JHEMCU-GSF405A/hwdef.dat @@ -169,3 +169,5 @@ define HAL_BUTTON_ENABLED 0 define AP_NOTIFY_OREOLED_ENABLED 0 define HAL_PICCOLO_CAN_ENABLE 0 define BARO_MAX_INSTANCES 1 + +AUTOBUILD_TARGETS Copter diff --git a/libraries/AP_HAL_ChibiOS/hwdef/KakuteF7/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/KakuteF7/hwdef.dat index 5ae33ca8d5f2c9..4c8b7c627e6643 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/KakuteF7/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/KakuteF7/hwdef.dat @@ -145,6 +145,7 @@ define HAL_PARACHUTE_ENABLED 0 # save FLASH, but leave above when flash issue is fixed include ../include/minimize_fpv_osd.inc +include ../include/no_bootloader_DFU.inc # disable SMBUS battery monitors to save flash undef AP_BATTERY_SMBUS_ENABLED diff --git a/libraries/AP_HAL_ChibiOS/hwdef/MatekF405/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/MatekF405/hwdef.dat index ddcd61dd36176e..effd88691850e2 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/MatekF405/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/MatekF405/hwdef.dat @@ -156,9 +156,6 @@ define OSD_ENABLED 1 define HAL_OSD_TYPE_DEFAULT 1 ROMFS_WILDCARD libraries/AP_OSD/fonts/font0.bin -# disable SMBUS battery monitors to save flash -define AP_BATTERY_SMBUS_ENABLED 0 - # disable parachute and sprayer to save flash define HAL_PARACHUTE_ENABLED 0 define HAL_SPRAYER_ENABLED 0 @@ -168,6 +165,5 @@ define AP_PARAM_MAX_EMBEDDED_PARAM 1024 # save some flash include ../include/save_some_flash.inc +include ../include/minimize_fpv_osd.inc -# only include ublox GPS driver -include ../include/minimal_GPS.inc diff --git a/libraries/AP_HAL_ChibiOS/hwdef/SuccexF4/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/SuccexF4/hwdef.dat index c4344984d60876..e5a1777c032cca 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/SuccexF4/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/SuccexF4/hwdef.dat @@ -132,5 +132,7 @@ define HAL_SPRAYER_ENABLED 0 define AP_PARAM_MAX_EMBEDDED_PARAM 1024 # minimal drivers to reduce flash usage -include ../include/minimal.inc +include ../include/minimize_fpv_osd.inc include ../include/no_bootloader_DFU.inc + +AUTOBUILD_TARGETS Copter diff --git a/libraries/AP_HAL_ChibiOS/hwdef/crazyflie2/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/crazyflie2/hwdef.dat index 14c118e2f05971..9a61fcd0f21031 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/crazyflie2/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/crazyflie2/hwdef.dat @@ -121,3 +121,7 @@ define MAG_BOARD_ORIENTATION ROTATION_YAW_180 # no ADC pins define HAL_USE_ADC FALSE + +include ../include/minimize_fpv_osd.inc + +AUTOBUILD_TARGETS Copter diff --git a/libraries/AP_HAL_ChibiOS/hwdef/mini-pix/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/mini-pix/hwdef.dat index 33965ca5ddddc6..039bc03f3f30e3 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/mini-pix/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/mini-pix/hwdef.dat @@ -148,3 +148,5 @@ define HAL_GPIO_C_LED_PIN 2 define HAL_GPIO_LED_ON 0 define HAL_GPIO_LED_OFF 1 +include ../include/minimize_common.inc + diff --git a/libraries/AP_HAL_ChibiOS/hwdef/speedybeef4/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/speedybeef4/hwdef.dat index c12a957b663019..a501a6ce3c703b 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/speedybeef4/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/speedybeef4/hwdef.dat @@ -145,6 +145,7 @@ define HAL_OSD_TYPE_DEFAULT 1 ROMFS_WILDCARD libraries/AP_OSD/fonts/font*.bin # minimal drivers to reduce flash usage -include ../include/minimal.inc +include ../include/minimize_fpv_osd.inc include ../include/no_bootloader_DFU.inc -define AP_BATTERY_SYNTHETIC_CURRENT_ENABLED 0 + +AUTOBUILD_TARGETS Copter diff --git a/libraries/AP_HAL_ChibiOS/hwdef/speedybeef4v3/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/speedybeef4v3/hwdef.dat index e5a5dca8a7414d..51dc009ca4ca0a 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/speedybeef4v3/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/speedybeef4v3/hwdef.dat @@ -152,8 +152,9 @@ define HAL_OSD_TYPE_DEFAULT 1 ROMFS_WILDCARD libraries/AP_OSD/fonts/font*.bin # minimal drivers to reduce flash usage -include ../include/minimal.inc +include ../include/minimize_fpv_osd.inc include ../include/no_bootloader_DFU.inc -define AP_BATTERY_SYNTHETIC_CURRENT_ENABLED 0 define DEFAULT_NTF_LED_TYPES 257 + +AUTOBUILD_TARGETS Copter