From 9d5d8ff0e6352caafa97e99d293c66e2d06d5347 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 14 Jun 2024 15:37:40 -0500 Subject: [PATCH] fix cli exec --- .../PlatformIO/scripts/STM32F1_build_flags.py | 91 ++++++++++--------- ini/stm32f1-maple.ini | 2 +- 2 files changed, 50 insertions(+), 43 deletions(-) diff --git a/buildroot/share/PlatformIO/scripts/STM32F1_build_flags.py b/buildroot/share/PlatformIO/scripts/STM32F1_build_flags.py index 5dbfc8774eec..dfce215348d9 100755 --- a/buildroot/share/PlatformIO/scripts/STM32F1_build_flags.py +++ b/buildroot/share/PlatformIO/scripts/STM32F1_build_flags.py @@ -1,56 +1,63 @@ +#!/usr/bin/env python +# +# STM32F1_build_flags.py +# Add build_flags for the base STM32F1_maple environment (stm32f1-maple.ini) +# from __future__ import print_function import sys # Dynamic build flags for generic compile options if __name__ == "__main__": - args = " ".join([ "-std=gnu++14", - "-Os", - "-mcpu=cortex-m3", - "-mthumb", - "-fsigned-char", - "-fno-move-loop-invariants", - "-fno-strict-aliasing", - "-fsingle-precision-constant", - - "--specs=nano.specs", - "--specs=nosys.specs", - - "-IMarlin/src/HAL/STM32F1", + # Print these plus the given args when running directly on the command-line + args = [ + "-std=gnu++14", + "-Os", + "-mcpu=cortex-m3", + "-mthumb", - "-MMD", - "-MP", - "-DTARGET_STM32F1" - ]) + "-fsigned-char", + "-fno-move-loop-invariants", + "-fno-strict-aliasing", + "-fsingle-precision-constant", - for i in range(1, len(sys.argv)): - args += " " + sys.argv[i] + "--specs=nano.specs", + "--specs=nosys.specs", - print(args) + "-MMD", "-MP", -else: + "-IMarlin/src/HAL/STM32F1", - # Extra script for stm32f1-maple.ini build_flags + "-DTARGET_STM32F1", + "-DARDUINO_ARCH_STM32", + "-DPLATFORM_M997_SUPPORT" + ] + sys.argv[1:] - import pioutil - if pioutil.is_pio_build(): - pioutil.env.Append( - ARFLAGS=["rcs"], + print(" ".join(args)) - ASFLAGS=["-x", "assembler-with-cpp"], +else: - CXXFLAGS=[ - "-fabi-version=0", - "-fno-use-cxa-atexit", - "-fno-threadsafe-statics" - ], - LINKFLAGS=[ - "-Os", - "-mcpu=cortex-m3", - "-ffreestanding", - "-mthumb", - "--specs=nano.specs", - "--specs=nosys.specs", - "-u_printf_float", - ], - ) + # Extra script for stm32f1-maple.ini build_flags + + import pioutil + if pioutil.is_pio_build(): + pioutil.env.Append( + ARFLAGS=["rcs"], + + ASFLAGS=["-x", "assembler-with-cpp"], + + CXXFLAGS=[ + "-fabi-version=0", + "-fno-use-cxa-atexit", + "-fno-threadsafe-statics" + ], + LINKFLAGS=[ + "-Os", + "-mcpu=cortex-m3", + "-ffreestanding", + "-mthumb", + "--specs=nano.specs", + "--specs=nosys.specs", + "-u_printf_float", + ], + ) diff --git a/ini/stm32f1-maple.ini b/ini/stm32f1-maple.ini index 0849305faad4..94b7ebb585dc 100644 --- a/ini/stm32f1-maple.ini +++ b/ini/stm32f1-maple.ini @@ -31,7 +31,7 @@ build_unflags = -std=gnu11 -std=gnu++11 build_src_filter = ${common.default_src_filter} + - lib_ignore = SPI, FreeRTOS701, FreeRTOS821 lib_deps = ${common.lib_deps} - SoftwareSerialM + SoftwareSerialM platform_packages = tool-stm32duino extra_scripts = ${common.extra_scripts} pre:buildroot/share/PlatformIO/scripts/fix_framework_weakness.py