From 87e79f4a60be4211ac476591f41c7b0da6bb4c9a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 4 Aug 2022 14:11:34 -0500 Subject: [PATCH] misc cleanup --- .../PlatformIO/scripts/common-cxxflags.py | 15 +++------------ .../share/PlatformIO/scripts/simulator.py | 18 +++++------------- 2 files changed, 8 insertions(+), 25 deletions(-) diff --git a/buildroot/share/PlatformIO/scripts/common-cxxflags.py b/buildroot/share/PlatformIO/scripts/common-cxxflags.py index 2a14535f102f..22a0665e05d5 100644 --- a/buildroot/share/PlatformIO/scripts/common-cxxflags.py +++ b/buildroot/share/PlatformIO/scripts/common-cxxflags.py @@ -3,11 +3,7 @@ # Convenience script to apply customizations to CPP flags # -import shutil - import pioutil - - if pioutil.is_pio_build(): Import("env") @@ -34,17 +30,12 @@ def add_cpu_freq(): # It useful to keep two live versions: a debug version for debugging and another for # release, for flashing when upload is not done automatically by jlink/stlink. # Without this, PIO needs to recompile everything twice for any small change. - if env.GetBuildType() == "debug" and env.get("UPLOAD_PROTOCOL") not in [ - "jlink", - "stlink", - "custom", - ]: + if env.GetBuildType() == "debug" and env.get("UPLOAD_PROTOCOL") not in ["jlink", "stlink", "custom"]: env["BUILD_DIR"] = "$PROJECT_BUILD_DIR/$PIOENV/debug" def on_program_ready(source, target, env): - shutil.copy( - target[0].get_abspath(), env.subst("$PROJECT_BUILD_DIR/$PIOENV") - ) + import shutil + shutil.copy(target[0].get_abspath(), env.subst("$PROJECT_BUILD_DIR/$PIOENV")) env.AddPostAction("$PROGPATH", on_program_ready) diff --git a/buildroot/share/PlatformIO/scripts/simulator.py b/buildroot/share/PlatformIO/scripts/simulator.py index af70d8b105d4..1767f83d32da 100644 --- a/buildroot/share/PlatformIO/scripts/simulator.py +++ b/buildroot/share/PlatformIO/scripts/simulator.py @@ -3,13 +3,13 @@ # PlatformIO pre: script for simulator builds # -# Get the environment thus far for the build -Import("env") - -#print(env.Dump()) - import pioutil if pioutil.is_pio_build(): + # Get the environment thus far for the build + Import("env") + + #print(env.Dump()) + # # Give the binary a distinctive name # @@ -51,11 +51,3 @@ # Break out of the PIO build immediately sys.exit(1) - -from marlin import copytree -def debug_mv(*args, **kwargs): - from pathlib import Path - bpath = Path(env['PROJECT_BUILD_DIR'], env['PIOENV']) - copytree(bpath / "debug", bpath) - -env.AddCustomTarget("fastdebug", "$BUILD_DIR/${PROGNAME}", debug_mv, "Fast Debug")