Skip to content

Commit 51c1645

Browse files
committed
πŸ§‘β€πŸ’» Use spaces indent for Python
1 parent 5eb39d5 commit 51c1645

File tree

7 files changed

+539
-539
lines changed

7 files changed

+539
-539
lines changed

β€ŽMarlin/src/HAL/DUE/upload_extra_script.pyβ€Ž

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
#
77
import pioutil
88
if pioutil.is_pio_build():
9-
import platform
10-
current_OS = platform.system()
9+
import platform
10+
current_OS = platform.system()
1111

12-
if current_OS == 'Windows':
12+
if current_OS == 'Windows':
1313

14-
Import("env")
14+
Import("env")
1515

16-
# Use bossac.exe on Windows
17-
env.Replace(
18-
UPLOADCMD="bossac --info --unlock --write --verify --reset --erase -U false --boot $SOURCE"
19-
)
16+
# Use bossac.exe on Windows
17+
env.Replace(
18+
UPLOADCMD="bossac --info --unlock --write --verify --reset --erase -U false --boot $SOURCE"
19+
)

β€Žbuildroot/share/PlatformIO/scripts/STM32F103RC_MEEB_3DP.pyβ€Ž

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
import pioutil
55
if pioutil.is_pio_build():
66

7-
Import("env", "projenv")
7+
Import("env", "projenv")
88

9-
flash_size = 0
10-
vect_tab_addr = 0
9+
flash_size = 0
10+
vect_tab_addr = 0
1111

12-
for define in env['CPPDEFINES']:
13-
if define[0] == "VECT_TAB_ADDR":
14-
vect_tab_addr = define[1]
15-
if define[0] == "STM32_FLASH_SIZE":
16-
flash_size = define[1]
12+
for define in env['CPPDEFINES']:
13+
if define[0] == "VECT_TAB_ADDR":
14+
vect_tab_addr = define[1]
15+
if define[0] == "STM32_FLASH_SIZE":
16+
flash_size = define[1]
1717

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

β€Žbuildroot/share/PlatformIO/scripts/STM32F103RC_fysetc.pyβ€Ž

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,25 @@
33
#
44
import pioutil
55
if pioutil.is_pio_build():
6-
from os.path import join
7-
from os.path import expandvars
8-
Import("env")
6+
from os.path import join
7+
from os.path import expandvars
8+
Import("env")
99

10-
# Custom HEX from ELF
11-
env.AddPostAction(
12-
join("$BUILD_DIR", "${PROGNAME}.elf"),
13-
env.VerboseAction(" ".join([
14-
"$OBJCOPY", "-O ihex", "$TARGET",
15-
"\"" + join("$BUILD_DIR", "${PROGNAME}.hex") + "\"", # Note: $BUILD_DIR is a full path
16-
]), "Building $TARGET"))
10+
# Custom HEX from ELF
11+
env.AddPostAction(
12+
join("$BUILD_DIR", "${PROGNAME}.elf"),
13+
env.VerboseAction(" ".join([
14+
"$OBJCOPY", "-O ihex", "$TARGET",
15+
"\"" + join("$BUILD_DIR", "${PROGNAME}.hex") + "\"", # Note: $BUILD_DIR is a full path
16+
]), "Building $TARGET"))
1717

18-
# In-line command with arguments
19-
UPLOAD_TOOL="stm32flash"
20-
platform = env.PioPlatform()
21-
if platform.get_package_dir("tool-stm32duino") != None:
22-
UPLOAD_TOOL=expandvars("\"" + join(platform.get_package_dir("tool-stm32duino"),"stm32flash","stm32flash") + "\"")
18+
# In-line command with arguments
19+
UPLOAD_TOOL="stm32flash"
20+
platform = env.PioPlatform()
21+
if platform.get_package_dir("tool-stm32duino") != None:
22+
UPLOAD_TOOL=expandvars("\"" + join(platform.get_package_dir("tool-stm32duino"),"stm32flash","stm32flash") + "\"")
2323

24-
env.Replace(
25-
UPLOADER=UPLOAD_TOOL,
26-
UPLOADCMD=expandvars(UPLOAD_TOOL + " -v -i rts,-dtr,dtr -R -b 115200 -g 0x8000000 -w \"" + join("$BUILD_DIR","${PROGNAME}.hex")+"\"" + " $UPLOAD_PORT")
27-
)
24+
env.Replace(
25+
UPLOADER=UPLOAD_TOOL,
26+
UPLOADCMD=expandvars(UPLOAD_TOOL + " -v -i rts,-dtr,dtr -R -b 115200 -g 0x8000000 -w \"" + join("$BUILD_DIR","${PROGNAME}.hex")+"\"" + " $UPLOAD_PORT")
27+
)

β€Žbuildroot/share/PlatformIO/scripts/STM32F1_create_variant.pyβ€Ž

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,29 @@
33
#
44
import pioutil
55
if pioutil.is_pio_build():
6-
import shutil,marlin
7-
from pathlib import Path
6+
import shutil,marlin
7+
from pathlib import Path
88

9-
Import("env")
10-
platform = env.PioPlatform()
11-
board = env.BoardConfig()
9+
Import("env")
10+
platform = env.PioPlatform()
11+
board = env.BoardConfig()
1212

13-
FRAMEWORK_DIR = Path(platform.get_package_dir("framework-arduinoststm32-maple"))
14-
assert FRAMEWORK_DIR.is_dir()
13+
FRAMEWORK_DIR = Path(platform.get_package_dir("framework-arduinoststm32-maple"))
14+
assert FRAMEWORK_DIR.is_dir()
1515

16-
source_root = Path("buildroot/share/PlatformIO/variants")
17-
assert source_root.is_dir()
16+
source_root = Path("buildroot/share/PlatformIO/variants")
17+
assert source_root.is_dir()
1818

19-
variant = board.get("build.variant")
20-
variant_dir = FRAMEWORK_DIR / "STM32F1/variants" / variant
19+
variant = board.get("build.variant")
20+
variant_dir = FRAMEWORK_DIR / "STM32F1/variants" / variant
2121

22-
source_dir = source_root / variant
23-
assert source_dir.is_dir()
22+
source_dir = source_root / variant
23+
assert source_dir.is_dir()
2424

25-
if variant_dir.is_dir():
26-
shutil.rmtree(variant_dir)
25+
if variant_dir.is_dir():
26+
shutil.rmtree(variant_dir)
2727

28-
if not variant_dir.is_dir():
29-
variant_dir.mkdir()
28+
if not variant_dir.is_dir():
29+
variant_dir.mkdir()
3030

31-
marlin.copytree(source_dir, variant_dir)
31+
marlin.copytree(source_dir, variant_dir)

0 commit comments

Comments
Β (0)