Skip to content

Commit 154924c

Browse files
committed
revert most
1 parent f611f77 commit 154924c

31 files changed

+775
-1459
lines changed

buildroot/share/PlatformIO/scripts/SAMD21_minitronics20.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414

1515
serialBuf = str(max(int(rxBuf), int(txBuf), 350))
1616

17-
build_flags = env.get("BUILD_FLAGS")
17+
build_flags = env.get('BUILD_FLAGS')
1818
env.Replace(BUILD_FLAGS=build_flags)

buildroot/share/PlatformIO/scripts/SAMD51_grandcentral_m4.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414

1515
serialBuf = str(max(int(rxBuf), int(txBuf), 350))
1616

17-
build_flags = env.get("BUILD_FLAGS")
17+
build_flags = env.get('BUILD_FLAGS')
1818
build_flags.append("-DSERIAL_BUFFER_SIZE=" + serialBuf)
1919
env.Replace(BUILD_FLAGS=build_flags)

buildroot/share/PlatformIO/scripts/STM32F103RC_MEEB_3DP.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
flash_size = 0
99
vect_tab_addr = 0
1010

11-
for define in env["CPPDEFINES"]:
11+
for define in env['CPPDEFINES']:
1212
if define[0] == "VECT_TAB_ADDR":
1313
vect_tab_addr = define[1]
1414
if define[0] == "STM32_FLASH_SIZE":
1515
flash_size = define[1]
1616

17-
print("Use the {0:s} address as the marlin app entry point.".format(vect_tab_addr))
18-
print("Use the {0:d}KB flash version of stm32f103rct6 chip.".format(flash_size))
17+
print('Use the {0:s} address as the marlin app entry point.'.format(vect_tab_addr))
18+
print('Use the {0:d}KB flash version of stm32f103rct6 chip.'.format(flash_size))

buildroot/share/PlatformIO/scripts/STM32F103RC_fysetc.py

+7-29
Original file line numberDiff line numberDiff line change
@@ -9,40 +9,18 @@
99
# Custom HEX from ELF
1010
env.AddPostAction(
1111
join("$BUILD_DIR", "${PROGNAME}.elf"),
12-
env.VerboseAction(
13-
" ".join(
14-
[
15-
"$OBJCOPY",
16-
"-O ihex",
17-
"$TARGET",
18-
'"'
19-
+ join("$BUILD_DIR", "${PROGNAME}.hex")
20-
+ '"' # Note: $BUILD_DIR is a full path
21-
]
22-
),
23-
"Building $TARGET"
24-
)
25-
)
12+
env.VerboseAction(" ".join([
13+
"$OBJCOPY", "-O ihex", "$TARGET",
14+
"\"" + join("$BUILD_DIR", "${PROGNAME}.hex") + "\"", # Note: $BUILD_DIR is a full path
15+
]), "Building $TARGET"))
2616

2717
# In-line command with arguments
28-
UPLOAD_TOOL = "stm32flash"
18+
UPLOAD_TOOL="stm32flash"
2919
platform = env.PioPlatform()
3020
if platform.get_package_dir("tool-stm32duino") != None:
31-
UPLOAD_TOOL = expandvars(
32-
'"'
33-
+ join(
34-
platform.get_package_dir("tool-stm32duino"), "stm32flash", "stm32flash"
35-
)
36-
+ '"'
37-
)
21+
UPLOAD_TOOL=expandvars("\"" + join(platform.get_package_dir("tool-stm32duino"),"stm32flash","stm32flash") + "\"")
3822

3923
env.Replace(
4024
UPLOADER=UPLOAD_TOOL,
41-
UPLOADCMD=expandvars(
42-
UPLOAD_TOOL
43-
+ ' -v -i rts,-dtr,dtr -R -b 115200 -g 0x8000000 -w "'
44-
+ join("$BUILD_DIR", "${PROGNAME}.hex")
45-
+ '"'
46-
+ " $UPLOAD_PORT"
47-
)
25+
UPLOADCMD=expandvars(UPLOAD_TOOL + " -v -i rts,-dtr,dtr -R -b 115200 -g 0x8000000 -w \"" + join("$BUILD_DIR","${PROGNAME}.hex")+"\"" + " $UPLOAD_PORT")
4826
)

buildroot/share/PlatformIO/scripts/STM32F1_build_flags.py

+10-4
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,19 @@
1515
"-Os",
1616
"-mcpu=cortex-m3",
1717
"-mthumb",
18+
1819
"-fsigned-char",
1920
"-fno-move-loop-invariants",
2021
"-fno-strict-aliasing",
2122
"-fsingle-precision-constant",
23+
2224
"--specs=nano.specs",
2325
"--specs=nosys.specs",
24-
"-MMD",
25-
"-MP",
26+
27+
"-MMD", "-MP",
28+
2629
"-IMarlin/src/HAL/STM32F1",
30+
2731
"-DTARGET_STM32F1",
2832
"-DARDUINO_ARCH_STM32",
2933
"-DPLATFORM_M997_SUPPORT"
@@ -39,7 +43,9 @@
3943
if pioutil.is_pio_build():
4044
pioutil.env.Append(
4145
ARFLAGS=["rcs"],
46+
4247
ASFLAGS=["-x", "assembler-with-cpp"],
48+
4349
CXXFLAGS=[
4450
"-fabi-version=0",
4551
"-fno-use-cxa-atexit",
@@ -52,6 +58,6 @@
5258
"-mthumb",
5359
"--specs=nano.specs",
5460
"--specs=nosys.specs",
55-
"-u_printf_float"
56-
]
61+
"-u_printf_float",
62+
],
5763
)

buildroot/share/PlatformIO/scripts/STM32F1_create_variant.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@
3838
else:
3939

4040
# The following almost works, but __start__ (from wirish/start.S) is not seen by common.inc
41-
board.update("build.variants_dir", source_root_str)
41+
board.update("build.variants_dir", source_root_str);
4242
src = str(source_dir)
43-
env.Append( # Add include path for variant
44-
BUILD_FLAGS=[f"-I{src}", f"-L{src}/ld"]
45-
)
43+
env.Append(BUILD_FLAGS=[f"-I{src}", f"-L{src}/ld"]) # Add include path for variant

buildroot/share/PlatformIO/scripts/collect-code-tests.py

+15-13
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import os, re
1010
env = pioutil.env
1111

12-
os.environ["PATH"] = f"./buildroot/bin/:./buildroot/tests/:{os.environ['PATH']}"
12+
os.environ['PATH'] = f"./buildroot/bin/:./buildroot/tests/:{os.environ['PATH']}"
1313

1414
def collect_test_suites():
1515
"""Get all the test suites"""
@@ -21,36 +21,38 @@ def register_test_suites():
2121
targets = []
2222
test_suites = collect_test_suites()
2323
for path in test_suites:
24-
name = re.sub(r"^\d+-|\.ini$", "", path.name)
25-
targets += [name]
24+
name = re.sub(r'^\d+-|\.ini$', '', path.name)
25+
targets += [name];
2626

2727
env.AddCustomTarget(
28-
name=f"marlin_{name}",
29-
dependencies=None,
30-
actions=[
28+
name = f"marlin_{name}",
29+
dependencies = None,
30+
actions = [
3131
f"echo ====== Configuring for marlin_{name} ======",
3232
"restore_configs",
3333
f"cp -f {path} ./Marlin/config.ini",
3434
"python ./buildroot/share/PlatformIO/scripts/configuration.py",
3535
f"platformio test -e linux_native_test -f {name}",
3636
"restore_configs",
3737
],
38-
title="Marlin: {}".format(name.lower().title().replace("_", " ")),
39-
description=(
38+
title = "Marlin: {}".format(name.lower().title().replace("_", " ")),
39+
description = (
4040
f"Run a Marlin test suite, with the appropriate configuration, "
4141
f"that sits in {path}"
4242
)
4343
)
4444

4545
env.AddCustomTarget(
46-
name="test-marlin",
47-
dependencies=None,
48-
actions=[
46+
name = "test-marlin",
47+
dependencies = None,
48+
actions = [
4949
f"platformio run -t marlin_{name} -e linux_native_test"
5050
for name in targets
5151
],
52-
title="Marlin: Test all code test suites",
53-
description=(f"Run all Marlin code test suites ({len(targets)} found).")
52+
title = "Marlin: Test all code test suites",
53+
description = (
54+
f"Run all Marlin code test suites ({len(targets)} found)."
55+
),
5456
)
5557

5658
register_test_suites()

buildroot/share/PlatformIO/scripts/common-cxxflags.py

+2-8
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,12 @@ def add_cpu_freq():
3030
# It useful to keep two live versions: a debug version for debugging and another for
3131
# release, for flashing when upload is not done automatically by jlink/stlink.
3232
# Without this, PIO needs to recompile everything twice for any small change.
33-
if env.GetBuildType() == "debug" and env.get("UPLOAD_PROTOCOL") not in [
34-
"jlink",
35-
"stlink",
36-
"custom"
37-
]:
33+
if env.GetBuildType() == "debug" and env.get("UPLOAD_PROTOCOL") not in ["jlink", "stlink", "custom"]:
3834
env["BUILD_DIR"] = "$PROJECT_BUILD_DIR/$PIOENV/debug"
3935

4036
def on_program_ready(source, target, env):
4137
import shutil
42-
shutil.copy(
43-
target[0].get_abspath(), env.subst("$PROJECT_BUILD_DIR/$PIOENV")
44-
)
38+
shutil.copy(target[0].get_abspath(), env.subst("$PROJECT_BUILD_DIR/$PIOENV"))
4539

4640
env.AddPostAction("$PROGPATH", on_program_ready)
4741

buildroot/share/PlatformIO/scripts/common-dependencies-post.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@
99
Import("projenv") # src_dir environment. Only for post: scripts!
1010

1111
def apply_board_build_flags():
12-
if not "BOARD_CUSTOM_BUILD_FLAGS" in env["MARLIN_FEATURES"]:
12+
if not 'BOARD_CUSTOM_BUILD_FLAGS' in env['MARLIN_FEATURES']:
1313
return
14-
projenv.Append(
15-
CCFLAGS=env["MARLIN_FEATURES"]["BOARD_CUSTOM_BUILD_FLAGS"].split()
16-
)
14+
projenv.Append(CCFLAGS=env['MARLIN_FEATURES']['BOARD_CUSTOM_BUILD_FLAGS'].split())
1715

1816
# We need to add the board build flags in a post script
1917
# so the platform build script doesn't overwrite the custom CCFLAGS

0 commit comments

Comments
 (0)