Skip to content

Commit

Permalink
chore(system): define USE_HAL_DRIVER on command line
Browse files Browse the repository at this point in the history
this ensure to have the same behavior each time stm32yyxx.h
is included.

Signed-off-by: Frederic Pillon <[email protected]>
  • Loading branch information
fpistm committed May 28, 2024
1 parent 91671d4 commit 73f7d29
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 7 deletions.
2 changes: 0 additions & 2 deletions CI/update/templates/system_stm32yyxx.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#define USE_HAL_DRIVER

{% for system in system_list %}
{% if loop.first %}
#ifdef {{system.serie}}
Expand Down
1 change: 1 addition & 0 deletions cmake/set_base_arduino_config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ target_link_libraries(base_config INTERFACE
gcc
)
target_compile_definitions(base_config INTERFACE
USE_HAL_DRIVER
USE_FULL_LL_DRIVER
ARDUINO_ARCH_STM32
)
Expand Down
2 changes: 0 additions & 2 deletions cores/arduino/stm32/stm32_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
|(STM32_CORE_VERSION_PATCH << 8U )\
|(STM32_CORE_VERSION_EXTRA))

#define USE_HAL_DRIVER

#if defined(STM32C0xx)
#include "stm32c0xx.h"
#elif defined(STM32F0xx)
Expand Down
2 changes: 0 additions & 2 deletions libraries/SrcWrapper/src/stm32/system_stm32yyxx.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#define USE_HAL_DRIVER

#ifdef STM32C0xx
#include "system_stm32c0xx.c"
#elif STM32F0xx
Expand Down
2 changes: 1 addition & 1 deletion platform.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ compiler.objcopy.cmd=arm-none-eabi-objcopy
compiler.elf2hex.cmd=arm-none-eabi-objcopy
compiler.libraries.ldflags=

compiler.extra_flags=-mcpu={build.mcu} {build.fpu} {build.float-abi} -DVECT_TAB_OFFSET={build.flash_offset} -DUSE_FULL_LL_DRIVER -mthumb "@{build.opt.path}"
compiler.extra_flags=-mcpu={build.mcu} {build.fpu} {build.float-abi} -DVECT_TAB_OFFSET={build.flash_offset} -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER -mthumb "@{build.opt.path}"

compiler.S.flags={compiler.extra_flags} -c -x assembler-with-cpp {compiler.stm.extra_include}

Expand Down
1 change: 1 addition & 0 deletions tools/platformio/platformio-build.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ def get_arduino_board_id(board_config, mcu):
"ARDUINO_%s" % board_id,
("BOARD_NAME", '\\"%s\\"' % board_id),
"HAL_UART_MODULE_ENABLED",
"USE_HAL_DRIVER",
"USE_FULL_LL_DRIVER",
(
"VARIANT_H",
Expand Down

0 comments on commit 73f7d29

Please sign in to comment.