From b1a7797c09ffd3f96e0073285b1a51fd18776bd7 Mon Sep 17 00:00:00 2001 From: rusefillc <48498823+rusefillc@users.noreply.github.com> Date: Fri, 4 Feb 2022 21:50:21 -0500 Subject: [PATCH] Wider usage of contrib (#3892) * I2C EEPROM support #3860 let's use contrib on all F4 * I2C EEPROM support #3860 let's use contrib on all F4, step 2 * I2C EEPROM support #3860 let's use contrib on all F4, step 3 * I2C EEPROM support #3860 let's use contrib on all F4, step 4 * I2C EEPROM support #3860 huh * I2C EEPROM support #3860 all the way Co-authored-by: rusefillc --- .../config/boards/f429-discovery/board.mk | 5 ++++ .../config/boards/f429-discovery/halconf.h | 22 ----------------- .../boards/f429-discovery/halconf_community.h | 20 ---------------- .../config/boards/f429-discovery/mcuconf.h | 24 ------------------- .../ports/stm32/mcuconf_common_f4_f7.h | 6 +++++ .../ports/stm32/stm32f4/cfg/halconf.h | 2 ++ 6 files changed, 13 insertions(+), 66 deletions(-) delete mode 100644 firmware/config/boards/f429-discovery/halconf.h delete mode 100644 firmware/config/boards/f429-discovery/halconf_community.h delete mode 100644 firmware/config/boards/f429-discovery/mcuconf.h diff --git a/firmware/config/boards/f429-discovery/board.mk b/firmware/config/boards/f429-discovery/board.mk index 0a9540beca..440fe94a89 100644 --- a/firmware/config/boards/f429-discovery/board.mk +++ b/firmware/config/boards/f429-discovery/board.mk @@ -20,5 +20,10 @@ DDEFS += -DLED_CRITICAL_ERROR_BRAIN_PIN=GPIOG_14 DDEFS += -DSTM32_FSMC_USE_FSMC1=TRUE -DSTM32_SDRAM_USE_SDRAM2=TRUE +DDEFS += -DSTM32_USB_USE_OTG1=FALSE +DDEFS += -DSTM32_USB_USE_OTG2=TRUE +DDEFS += -DHAL_USE_SDRAM=TRUE +DDEFS += -DHAL_USE_FSMC=TRUE + # Shared variables ALLINC += $(BOARDINC) diff --git a/firmware/config/boards/f429-discovery/halconf.h b/firmware/config/boards/f429-discovery/halconf.h deleted file mode 100644 index 0cc3e39e9e..0000000000 --- a/firmware/config/boards/f429-discovery/halconf.h +++ /dev/null @@ -1,22 +0,0 @@ -/** - * @file boards/f429-discovery/halconf.h - * - * @brief In this header we can override halconf.h. - * - * @date Jan 08, 2022 - * @author Andrey Gusakov, 2022 - */ - -#ifndef _HALCONF_F429_H_ -#define _HALCONF_F429_H_ - -/* this line exists just to include mcuconf.h from THIS directory */ -#include "mcuconf.h" - -/* you can override some halconf defaults here */ - -#include "../../../hw_layer/ports/stm32/stm32f4/cfg/halconf.h" - -#include "halconf_community.h" - -#endif /* _HALCONF_F429_ */ diff --git a/firmware/config/boards/f429-discovery/halconf_community.h b/firmware/config/boards/f429-discovery/halconf_community.h deleted file mode 100644 index fb0e159993..0000000000 --- a/firmware/config/boards/f429-discovery/halconf_community.h +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @file boards/f429-discovery/halconf_community.h - * - * @brief In this header we can override defaults from halconf_community.h. - * - * @date Jan 08, 2022 - * @author Andrey Gusakov, 2022 - */ - -#ifndef HALCONF_COMMUNITY_F429_H -#define HALCONF_COMMUNITY_F429_H - -/* Enable SDRAM support */ -#define HAL_USE_FSMC TRUE -#define HAL_USE_SDRAM TRUE - -/* all other options are default */ -#include "../../../hw_layer/ports/stm32/cfg/halconf_community.h" - -#endif /* HALCONF_COMMUNITY_F429_H */ diff --git a/firmware/config/boards/f429-discovery/mcuconf.h b/firmware/config/boards/f429-discovery/mcuconf.h deleted file mode 100644 index d4b92b0477..0000000000 --- a/firmware/config/boards/f429-discovery/mcuconf.h +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @file boards/f429-discovery/mcuconf.h - * - * @brief In this header we can override mcuconf.h. - * - * @date Jan 08, 2022 - * @author Andrey Gusakov, 2022 - */ - -#ifndef MCUCONF_F429_H -#define MCUCONF_F429_H - -#include "../../../hw_layer/ports/stm32/stm32f4/cfg/mcuconf.h" - -/* - * USB driver system settings. - */ -#undef STM32_USB_USE_OTG1 -#define STM32_USB_USE_OTG1 FALSE - -#undef STM32_USB_USE_OTG2 -#define STM32_USB_USE_OTG2 TRUE - -#endif /* MCUCONF_F429_H */ diff --git a/firmware/hw_layer/ports/stm32/mcuconf_common_f4_f7.h b/firmware/hw_layer/ports/stm32/mcuconf_common_f4_f7.h index dc92478a55..cc21adcb33 100644 --- a/firmware/hw_layer/ports/stm32/mcuconf_common_f4_f7.h +++ b/firmware/hw_layer/ports/stm32/mcuconf_common_f4_f7.h @@ -322,8 +322,14 @@ /* * USB driver system settings. */ +#ifndef STM32_USB_USE_OTG1 #define STM32_USB_USE_OTG1 TRUE +#endif + +#ifndef STM32_USB_USE_OTG2 #define STM32_USB_USE_OTG2 FALSE +#endif + #define STM32_USB_OTG1_IRQ_PRIORITY 14 #define STM32_USB_OTG2_IRQ_PRIORITY 14 #define STM32_USB_OTG1_RX_FIFO_SIZE 512 diff --git a/firmware/hw_layer/ports/stm32/stm32f4/cfg/halconf.h b/firmware/hw_layer/ports/stm32/stm32f4/cfg/halconf.h index 3f4eb8e9d8..f85ec85c35 100644 --- a/firmware/hw_layer/ports/stm32/stm32f4/cfg/halconf.h +++ b/firmware/hw_layer/ports/stm32/stm32f4/cfg/halconf.h @@ -35,6 +35,8 @@ #include "rusefi_halconf.h" +#include "../../cfg/halconf_community.h" + /** * @brief Enables the FLASH subsystem. */