From 73aa8fc724ebab6fa9ed275e6e2de70e5cb0ec34 Mon Sep 17 00:00:00 2001 From: Frederic Pillon Date: Tue, 28 May 2024 09:26:53 +0200 Subject: [PATCH] chore(system): define USE_HAL_DRIVER on command line this ensure to have the same behavior each time stm32yyxx.h is included. Signed-off-by: Frederic Pillon --- CI/update/templates/system_stm32yyxx.c | 2 -- cmake/set_base_arduino_config.cmake | 1 + cores/arduino/stm32/stm32_def.h | 2 -- libraries/SrcWrapper/src/stm32/system_stm32yyxx.c | 2 -- platform.txt | 2 +- tools/platformio/platformio-build.py | 1 + 6 files changed, 3 insertions(+), 7 deletions(-) diff --git a/CI/update/templates/system_stm32yyxx.c b/CI/update/templates/system_stm32yyxx.c index 7fc841f8ac..10fcaf9a2a 100644 --- a/CI/update/templates/system_stm32yyxx.c +++ b/CI/update/templates/system_stm32yyxx.c @@ -1,5 +1,3 @@ -#define USE_HAL_DRIVER - {% for system in system_list %} {% if loop.first %} #ifdef {{system.serie}} diff --git a/cmake/set_base_arduino_config.cmake b/cmake/set_base_arduino_config.cmake index cec1d09c39..ece885aeaf 100644 --- a/cmake/set_base_arduino_config.cmake +++ b/cmake/set_base_arduino_config.cmake @@ -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 ) diff --git a/cores/arduino/stm32/stm32_def.h b/cores/arduino/stm32/stm32_def.h index 8b193a8c87..00113faa89 100644 --- a/cores/arduino/stm32/stm32_def.h +++ b/cores/arduino/stm32/stm32_def.h @@ -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) diff --git a/libraries/SrcWrapper/src/stm32/system_stm32yyxx.c b/libraries/SrcWrapper/src/stm32/system_stm32yyxx.c index 1a04669fb4..4019fbe230 100644 --- a/libraries/SrcWrapper/src/stm32/system_stm32yyxx.c +++ b/libraries/SrcWrapper/src/stm32/system_stm32yyxx.c @@ -1,5 +1,3 @@ -#define USE_HAL_DRIVER - #ifdef STM32C0xx #include "system_stm32c0xx.c" #elif STM32F0xx diff --git a/platform.txt b/platform.txt index d7ed5acb0d..4df3db3de5 100644 --- a/platform.txt +++ b/platform.txt @@ -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} diff --git a/tools/platformio/platformio-build.py b/tools/platformio/platformio-build.py index 19a16715c8..89336ca215 100644 --- a/tools/platformio/platformio-build.py +++ b/tools/platformio/platformio-build.py @@ -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", pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy