Skip to content

Commit

Permalink
misc cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Aug 4, 2022
1 parent fc67cc8 commit 87e79f4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 25 deletions.
15 changes: 3 additions & 12 deletions buildroot/share/PlatformIO/scripts/common-cxxflags.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
# Convenience script to apply customizations to CPP flags
#

import shutil

import pioutil


if pioutil.is_pio_build():
Import("env")

Expand All @@ -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)

Expand Down
18 changes: 5 additions & 13 deletions buildroot/share/PlatformIO/scripts/simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand Down Expand Up @@ -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")

0 comments on commit 87e79f4

Please sign in to comment.