From 680172a084caba61ebb0524e407f2c476eaa6e63 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 27 Feb 2021 23:51:56 -0600 Subject: [PATCH] Tweaks to build scripts --- .../share/PlatformIO/scripts/SAMD51_grandcentral_m4.py | 5 +++-- buildroot/share/PlatformIO/scripts/common-cxxflags.py | 4 ++-- .../share/PlatformIO/scripts/fix_framework_weakness.py | 6 +++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/buildroot/share/PlatformIO/scripts/SAMD51_grandcentral_m4.py b/buildroot/share/PlatformIO/scripts/SAMD51_grandcentral_m4.py index 05dc444bda..9e37024d11 100644 --- a/buildroot/share/PlatformIO/scripts/SAMD51_grandcentral_m4.py +++ b/buildroot/share/PlatformIO/scripts/SAMD51_grandcentral_m4.py @@ -8,8 +8,9 @@ from pprint import pprint Import("env") -rxBuf = env["MARLIN_FEATURES"]["RX_BUFFER_SIZE"] if "RX_BUFFER_SIZE" in env["MARLIN_FEATURES"] else "0" -txBuf = env["MARLIN_FEATURES"]["TX_BUFFER_SIZE"] if "TX_BUFFER_SIZE" in env["MARLIN_FEATURES"] else "0" +mf = env["MARLIN_FEATURES"] +rxBuf = mf["RX_BUFFER_SIZE"] if "RX_BUFFER_SIZE" in mf else "0" +txBuf = mf["TX_BUFFER_SIZE"] if "TX_BUFFER_SIZE" in mf else "0" serialBuf = str(max(int(rxBuf), int(txBuf), 350)) diff --git a/buildroot/share/PlatformIO/scripts/common-cxxflags.py b/buildroot/share/PlatformIO/scripts/common-cxxflags.py index ed863a917a..5c2bde7700 100644 --- a/buildroot/share/PlatformIO/scripts/common-cxxflags.py +++ b/buildroot/share/PlatformIO/scripts/common-cxxflags.py @@ -28,8 +28,8 @@ def add_cpu_freq(): if env.GetBuildType() == "debug": env['BUILD_DIR'] = '$PROJECT_BUILD_DIR/$PIOENV/debug' -# On some platform, F_CPU is a runtime variable. Since it's used to convert from ns -# to CPU cycles, this adds overhead preventing small delay (in the order of less than +# On some platform, F_CPU is a runtime variable. Since it's used to convert from ns +# to CPU cycles, this adds overhead preventing small delay (in the order of less than # 30 cycles) to be generated correctly. By using a compile time constant instead # the compiler will perform the computation and this overhead will be avoided add_cpu_freq() diff --git a/buildroot/share/PlatformIO/scripts/fix_framework_weakness.py b/buildroot/share/PlatformIO/scripts/fix_framework_weakness.py index c7bc45aba9..29705de442 100644 --- a/buildroot/share/PlatformIO/scripts/fix_framework_weakness.py +++ b/buildroot/share/PlatformIO/scripts/fix_framework_weakness.py @@ -31,11 +31,11 @@ if env.MarlinFeatureIsEnabled("POSTMORTEM_DEBUGGING"): print("Libmaple modified and ready for post mortem debugging") -rxBuf = env["MARLIN_FEATURES"]["RX_BUFFER_SIZE"] if "RX_BUFFER_SIZE" in env["MARLIN_FEATURES"] else "0" -txBuf = env["MARLIN_FEATURES"]["TX_BUFFER_SIZE"] if "TX_BUFFER_SIZE" in env["MARLIN_FEATURES"] else "0" +mf = env["MARLIN_FEATURES"] +rxBuf = mf["RX_BUFFER_SIZE"] if "RX_BUFFER_SIZE" in mf else "0" +txBuf = mf["TX_BUFFER_SIZE"] if "TX_BUFFER_SIZE" in mf else "0" if int(rxBuf) < 64: rxBuf = "64" - if int(txBuf) < 64: txBuf = "64"