Skip to content

Commit

Permalink
πŸ§‘β€πŸ’» Use spaces indent for Python
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Dec 16, 2022
1 parent 5eb39d5 commit 51c1645
Show file tree
Hide file tree
Showing 7 changed files with 539 additions and 539 deletions.
16 changes: 8 additions & 8 deletions Marlin/src/HAL/DUE/upload_extra_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
#
import pioutil
if pioutil.is_pio_build():
import platform
current_OS = platform.system()
import platform
current_OS = platform.system()

if current_OS == 'Windows':
if current_OS == 'Windows':

Import("env")
Import("env")

# Use bossac.exe on Windows
env.Replace(
UPLOADCMD="bossac --info --unlock --write --verify --reset --erase -U false --boot $SOURCE"
)
# Use bossac.exe on Windows
env.Replace(
UPLOADCMD="bossac --info --unlock --write --verify --reset --erase -U false --boot $SOURCE"
)
20 changes: 10 additions & 10 deletions buildroot/share/PlatformIO/scripts/STM32F103RC_MEEB_3DP.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
import pioutil
if pioutil.is_pio_build():

Import("env", "projenv")
Import("env", "projenv")

flash_size = 0
vect_tab_addr = 0
flash_size = 0
vect_tab_addr = 0

for define in env['CPPDEFINES']:
if define[0] == "VECT_TAB_ADDR":
vect_tab_addr = define[1]
if define[0] == "STM32_FLASH_SIZE":
flash_size = define[1]
for define in env['CPPDEFINES']:
if define[0] == "VECT_TAB_ADDR":
vect_tab_addr = define[1]
if define[0] == "STM32_FLASH_SIZE":
flash_size = define[1]

print('Use the {0:s} address as the marlin app entry point.'.format(vect_tab_addr))
print('Use the {0:d}KB flash version of stm32f103rct6 chip.'.format(flash_size))
print('Use the {0:s} address as the marlin app entry point.'.format(vect_tab_addr))
print('Use the {0:d}KB flash version of stm32f103rct6 chip.'.format(flash_size))
38 changes: 19 additions & 19 deletions buildroot/share/PlatformIO/scripts/STM32F103RC_fysetc.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
#
import pioutil
if pioutil.is_pio_build():
from os.path import join
from os.path import expandvars
Import("env")
from os.path import join
from os.path import expandvars
Import("env")

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

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

env.Replace(
UPLOADER=UPLOAD_TOOL,
UPLOADCMD=expandvars(UPLOAD_TOOL + " -v -i rts,-dtr,dtr -R -b 115200 -g 0x8000000 -w \"" + join("$BUILD_DIR","${PROGNAME}.hex")+"\"" + " $UPLOAD_PORT")
)
env.Replace(
UPLOADER=UPLOAD_TOOL,
UPLOADCMD=expandvars(UPLOAD_TOOL + " -v -i rts,-dtr,dtr -R -b 115200 -g 0x8000000 -w \"" + join("$BUILD_DIR","${PROGNAME}.hex")+"\"" + " $UPLOAD_PORT")
)
36 changes: 18 additions & 18 deletions buildroot/share/PlatformIO/scripts/STM32F1_create_variant.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@
#
import pioutil
if pioutil.is_pio_build():
import shutil,marlin
from pathlib import Path
import shutil,marlin
from pathlib import Path

Import("env")
platform = env.PioPlatform()
board = env.BoardConfig()
Import("env")
platform = env.PioPlatform()
board = env.BoardConfig()

FRAMEWORK_DIR = Path(platform.get_package_dir("framework-arduinoststm32-maple"))
assert FRAMEWORK_DIR.is_dir()
FRAMEWORK_DIR = Path(platform.get_package_dir("framework-arduinoststm32-maple"))
assert FRAMEWORK_DIR.is_dir()

source_root = Path("buildroot/share/PlatformIO/variants")
assert source_root.is_dir()
source_root = Path("buildroot/share/PlatformIO/variants")
assert source_root.is_dir()

variant = board.get("build.variant")
variant_dir = FRAMEWORK_DIR / "STM32F1/variants" / variant
variant = board.get("build.variant")
variant_dir = FRAMEWORK_DIR / "STM32F1/variants" / variant

source_dir = source_root / variant
assert source_dir.is_dir()
source_dir = source_root / variant
assert source_dir.is_dir()

if variant_dir.is_dir():
shutil.rmtree(variant_dir)
if variant_dir.is_dir():
shutil.rmtree(variant_dir)

if not variant_dir.is_dir():
variant_dir.mkdir()
if not variant_dir.is_dir():
variant_dir.mkdir()

marlin.copytree(source_dir, variant_dir)
marlin.copytree(source_dir, variant_dir)
Loading

0 comments on commit 51c1645

Please sign in to comment.