Skip to content

Commit

Permalink
Use automatic module definitions in blinky
Browse files Browse the repository at this point in the history
  • Loading branch information
shoftmadder committed Mar 11, 2023
1 parent 959eceb commit 23d1996
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 17 deletions.
5 changes: 4 additions & 1 deletion examples/blinky/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ endif()
set(CMAKE_INCLUDE_CURRENT_DIR TRUE)


set(HAL_COMP_LIST RCC GPIO CORTEX)
set(HAL_COMP_LIST RCC GPIO CORTEX FLASH)
set(CMSIS_COMP_LIST "")

if(BLINKY_F4_EXAMPLE)
Expand Down Expand Up @@ -55,6 +55,7 @@ if(BLINKY_F4_EXAMPLE)
target_link_libraries(stm32-blinky-f4
HAL::STM32::F4::RCC
HAL::STM32::F4::GPIO
HAL::STM32::F4::FLASH
HAL::STM32::F4::CORTEX
CMSIS::STM32::F407VG
STM32::NoSys
Expand All @@ -68,6 +69,7 @@ if(BLINKY_F1_EXAMPLE)
target_link_libraries(stm32-blinky-f1
HAL::STM32::F1::RCC
HAL::STM32::F1::GPIO
HAL::STM32::F1::FLASH
HAL::STM32::F1::CORTEX
CMSIS::STM32::F100RB
STM32::NoSys
Expand All @@ -81,6 +83,7 @@ if(BLINKY_L0_EXAMPLE)
target_link_libraries(stm32-blinky-l0
HAL::STM32::L0::RCC
HAL::STM32::L0::GPIO
HAL::STM32::L0::FLASH
HAL::STM32::L0::CORTEX
CMSIS::STM32::L053C8
STM32::NoSys
Expand Down
15 changes: 10 additions & 5 deletions examples/blinky/stm32f1xx_hal_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,25 @@ extern "C" {
/* ########################## Module Selection ############################## */
/**
* @brief This is the list of modules to be used in the HAL driver
*
* `stm32-cmake` automatically defines the `HAL_*_MODULE_ENABLED` variables
* when a driver is added to a project using `target_link_libraries`, so they
* don't need to be defined here
*
*/
#define HAL_MODULE_ENABLED
// #define HAL_ADC_MODULE_ENABLED
// #define HAL_CAN_MODULE_ENABLED
// #define HAL_CAN_LEGACY_MODULE_ENABLED
// #define HAL_CEC_MODULE_ENABLED
#define HAL_CORTEX_MODULE_ENABLED
// #define HAL_CORTEX_MODULE_ENABLED
// #define HAL_CRC_MODULE_ENABLED
// #define HAL_DAC_MODULE_ENABLED
#define HAL_DMA_MODULE_ENABLED
// #define HAL_DMA_MODULE_ENABLED
// #define HAL_ETH_MODULE_ENABLED
// #define HAL_EXTI_MODULE_ENABLED
#define HAL_FLASH_MODULE_ENABLED
#define HAL_GPIO_MODULE_ENABLED
// #define HAL_FLASH_MODULE_ENABLED
// #define HAL_GPIO_MODULE_ENABLED
// #define HAL_HCD_MODULE_ENABLED
// #define HAL_I2C_MODULE_ENABLED
// #define HAL_I2S_MODULE_ENABLED
Expand All @@ -57,7 +62,7 @@ extern "C" {
// #define HAL_PCCARD_MODULE_ENABLED
// #define HAL_PCD_MODULE_ENABLED
// #define HAL_PWR_MODULE_ENABLED
#define HAL_RCC_MODULE_ENABLED
// #define HAL_RCC_MODULE_ENABLED
// #define HAL_RTC_MODULE_ENABLED
// #define HAL_SD_MODULE_ENABLED
// #define HAL_SMARTCARD_MODULE_ENABLED
Expand Down
17 changes: 11 additions & 6 deletions examples/blinky/stm32f4xx_hal_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
/* ########################## Module Selection ############################## */
/**
* @brief This is the list of modules to be used in the HAL driver
*
* `stm32-cmake` automatically defines the `HAL_*_MODULE_ENABLED` variables
* when a driver is added to a project using `target_link_libraries`, so they
* don't need to be defined here
*
*/
#define HAL_MODULE_ENABLED
// #define HAL_ADC_MODULE_ENABLED
Expand All @@ -43,27 +48,27 @@
// #define HAL_CRYP_MODULE_ENABLED
// #define HAL_DAC_MODULE_ENABLED
// #define HAL_DCMI_MODULE_ENABLED
#define HAL_DMA_MODULE_ENABLED
// #define HAL_DMA_MODULE_ENABLED
// #define HAL_DMA2D_MODULE_ENABLED
// #define HAL_ETH_MODULE_ENABLED
#define HAL_FLASH_MODULE_ENABLED
// #define HAL_FLASH_MODULE_ENABLED
// #define HAL_NAND_MODULE_ENABLED
// #define HAL_NOR_MODULE_ENABLED
// #define HAL_PCCARD_MODULE_ENABLED
// #define HAL_SRAM_MODULE_ENABLED
// #define HAL_SDRAM_MODULE_ENABLED
// #define HAL_HASH_MODULE_ENABLED
#define HAL_GPIO_MODULE_ENABLED
// #define HAL_GPIO_MODULE_ENABLED
// #define HAL_EXTI_MODULE_ENABLED
// #define HAL_I2C_MODULE_ENABLED
// #define HAL_SMBUS_MODULE_ENABLED
// #define HAL_I2S_MODULE_ENABLED
// #define HAL_IWDG_MODULE_ENABLED
// #define HAL_LTDC_MODULE_ENABLED
// #define HAL_DSI_MODULE_ENABLED
#define HAL_PWR_MODULE_ENABLED
// #define HAL_PWR_MODULE_ENABLED
// #define HAL_QSPI_MODULE_ENABLED
#define HAL_RCC_MODULE_ENABLED
// #define HAL_RCC_MODULE_ENABLED
// #define HAL_RNG_MODULE_ENABLED
// #define HAL_RTC_MODULE_ENABLED
// #define HAL_SAI_MODULE_ENABLED
Expand All @@ -75,7 +80,7 @@
// #define HAL_IRDA_MODULE_ENABLED
// #define HAL_SMARTCARD_MODULE_ENABLED
// #define HAL_WWDG_MODULE_ENABLED
#define HAL_CORTEX_MODULE_ENABLED
// #define HAL_CORTEX_MODULE_ENABLED
// #define HAL_PCD_MODULE_ENABLED
// #define HAL_HCD_MODULE_ENABLED
// #define HAL_FMPI2C_MODULE_ENABLED
Expand Down
15 changes: 10 additions & 5 deletions examples/blinky/stm32l0xx_hal_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,30 @@
/* ########################## Module Selection ############################## */
/**
* @brief This is the list of modules to be used in the HAL driver
*
* `stm32-cmake` automatically defines the `HAL_*_MODULE_ENABLED` variables
* when a driver is added to a project using `target_link_libraries`, so they
* don't need to be defined here
*
*/
#define HAL_MODULE_ENABLED
// #define HAL_ADC_MODULE_ENABLED
// #define HAL_COMP_MODULE_ENABLED
// #define HAL_CRC_MODULE_ENABLED
// #define HAL_CRYP_MODULE_ENABLED
// #define HAL_DAC_MODULE_ENABLED
#define HAL_DMA_MODULE_ENABLED
// #define HAL_DMA_MODULE_ENABLED
// #define HAL_EXTI_MODULE_ENABLED
// #define HAL_FIREWALL_MODULE_ENABLED
#define HAL_FLASH_MODULE_ENABLED
#define HAL_GPIO_MODULE_ENABLED
// #define HAL_FLASH_MODULE_ENABLED
// #define HAL_GPIO_MODULE_ENABLED
// #define HAL_I2C_MODULE_ENABLED
// #define HAL_I2S_MODULE_ENABLED
// #define HAL_IWDG_MODULE_ENABLED
// #define HAL_LCD_MODULE_ENABLED
// #define HAL_LPTIM_MODULE_ENABLED
// #define HAL_PWR_MODULE_ENABLED
#define HAL_RCC_MODULE_ENABLED
// #define HAL_RCC_MODULE_ENABLED
// #define HAL_RNG_MODULE_ENABLED
// #define HAL_RTC_MODULE_ENABLED
// #define HAL_SPI_MODULE_ENABLED
Expand All @@ -63,7 +68,7 @@
// #define HAL_SMARTCARD_MODULE_ENABLED
// #define HAL_SMBUS_MODULE_ENABLED
// #define HAL_WWDG_MODULE_ENABLED
#define HAL_CORTEX_MODULE_ENABLED
// #define HAL_CORTEX_MODULE_ENABLED
// #define HAL_PCD_MODULE_ENABLED

/* ########################## Oscillator Values adaptation ####################*/
Expand Down

0 comments on commit 23d1996

Please sign in to comment.