mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2025-07-14 18:27:50 -06:00
🔨 Build scripts cleanup (#27157)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
parent
ae2843940f
commit
959be66cc2
41 changed files with 130 additions and 151 deletions
|
@ -11,7 +11,7 @@ if pioutil.is_pio_build():
|
||||||
|
|
||||||
if current_OS == 'Windows':
|
if current_OS == 'Windows':
|
||||||
|
|
||||||
Import("env")
|
env = pioutil.env
|
||||||
|
|
||||||
# Use bossac.exe on Windows
|
# Use bossac.exe on Windows
|
||||||
env.Replace(
|
env.Replace(
|
||||||
|
|
|
@ -13,9 +13,9 @@ if pioutil.is_pio_build():
|
||||||
target_drive = "REARM"
|
target_drive = "REARM"
|
||||||
|
|
||||||
import platform
|
import platform
|
||||||
|
|
||||||
current_OS = platform.system()
|
current_OS = platform.system()
|
||||||
Import("env")
|
|
||||||
|
env = pioutil.env
|
||||||
|
|
||||||
def print_error(e):
|
def print_error(e):
|
||||||
print('\nUnable to find destination disk (%s)\n' \
|
print('\nUnable to find destination disk (%s)\n' \
|
||||||
|
|
|
@ -1,56 +0,0 @@
|
||||||
from __future__ import print_function
|
|
||||||
import sys
|
|
||||||
|
|
||||||
#dynamic build flags for generic compile options
|
|
||||||
if __name__ == "__main__":
|
|
||||||
args = " ".join([ "-std=gnu++14",
|
|
||||||
"-Os",
|
|
||||||
"-mcpu=cortex-m3",
|
|
||||||
"-mthumb",
|
|
||||||
|
|
||||||
"-fsigned-char",
|
|
||||||
"-fno-move-loop-invariants",
|
|
||||||
"-fno-strict-aliasing",
|
|
||||||
"-fsingle-precision-constant",
|
|
||||||
|
|
||||||
"--specs=nano.specs",
|
|
||||||
"--specs=nosys.specs",
|
|
||||||
|
|
||||||
"-IMarlin/src/HAL/STM32F1",
|
|
||||||
|
|
||||||
"-MMD",
|
|
||||||
"-MP",
|
|
||||||
"-DTARGET_STM32F1"
|
|
||||||
])
|
|
||||||
|
|
||||||
for i in range(1, len(sys.argv)):
|
|
||||||
args += " " + sys.argv[i]
|
|
||||||
|
|
||||||
print(args)
|
|
||||||
|
|
||||||
# extra script for linker options
|
|
||||||
else:
|
|
||||||
import pioutil
|
|
||||||
if pioutil.is_pio_build():
|
|
||||||
from SCons.Script import DefaultEnvironment
|
|
||||||
env = DefaultEnvironment()
|
|
||||||
env.Append(
|
|
||||||
ARFLAGS=["rcs"],
|
|
||||||
|
|
||||||
ASFLAGS=["-x", "assembler-with-cpp"],
|
|
||||||
|
|
||||||
CXXFLAGS=[
|
|
||||||
"-fabi-version=0",
|
|
||||||
"-fno-use-cxa-atexit",
|
|
||||||
"-fno-threadsafe-statics"
|
|
||||||
],
|
|
||||||
LINKFLAGS=[
|
|
||||||
"-Os",
|
|
||||||
"-mcpu=cortex-m3",
|
|
||||||
"-ffreestanding",
|
|
||||||
"-mthumb",
|
|
||||||
"--specs=nano.specs",
|
|
||||||
"--specs=nosys.specs",
|
|
||||||
"-u_printf_float",
|
|
||||||
],
|
|
||||||
)
|
|
|
@ -6,8 +6,7 @@ import pioutil
|
||||||
if pioutil.is_pio_build():
|
if pioutil.is_pio_build():
|
||||||
from os.path import join, isfile
|
from os.path import join, isfile
|
||||||
import shutil
|
import shutil
|
||||||
|
env = pioutil.env
|
||||||
Import("env")
|
|
||||||
|
|
||||||
mf = env["MARLIN_FEATURES"]
|
mf = env["MARLIN_FEATURES"]
|
||||||
rxBuf = mf["RX_BUFFER_SIZE"] if "RX_BUFFER_SIZE" in mf else "0"
|
rxBuf = mf["RX_BUFFER_SIZE"] if "RX_BUFFER_SIZE" in mf else "0"
|
||||||
|
|
|
@ -6,8 +6,7 @@ import pioutil
|
||||||
if pioutil.is_pio_build():
|
if pioutil.is_pio_build():
|
||||||
from os.path import join, isfile
|
from os.path import join, isfile
|
||||||
import shutil
|
import shutil
|
||||||
|
env = pioutil.env
|
||||||
Import("env")
|
|
||||||
|
|
||||||
mf = env["MARLIN_FEATURES"]
|
mf = env["MARLIN_FEATURES"]
|
||||||
rxBuf = mf["RX_BUFFER_SIZE"] if "RX_BUFFER_SIZE" in mf else "0"
|
rxBuf = mf["RX_BUFFER_SIZE"] if "RX_BUFFER_SIZE" in mf else "0"
|
||||||
|
|
|
@ -3,8 +3,7 @@
|
||||||
#
|
#
|
||||||
import pioutil
|
import pioutil
|
||||||
if pioutil.is_pio_build():
|
if pioutil.is_pio_build():
|
||||||
|
env = pioutil.env
|
||||||
Import("env", "projenv")
|
|
||||||
|
|
||||||
flash_size = 0
|
flash_size = 0
|
||||||
vect_tab_addr = 0
|
vect_tab_addr = 0
|
||||||
|
|
|
@ -3,9 +3,8 @@
|
||||||
#
|
#
|
||||||
import pioutil
|
import pioutil
|
||||||
if pioutil.is_pio_build():
|
if pioutil.is_pio_build():
|
||||||
from os.path import join
|
from os.path import join, expandvars
|
||||||
from os.path import expandvars
|
env = pioutil.env
|
||||||
Import("env")
|
|
||||||
|
|
||||||
# Custom HEX from ELF
|
# Custom HEX from ELF
|
||||||
env.AddPostAction(
|
env.AddPostAction(
|
||||||
|
|
63
buildroot/share/PlatformIO/scripts/STM32F1_build_flags.py
Executable file
63
buildroot/share/PlatformIO/scripts/STM32F1_build_flags.py
Executable file
|
@ -0,0 +1,63 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
#
|
||||||
|
# STM32F1_build_flags.py
|
||||||
|
# Add build_flags for the base STM32F1_maple environment (stm32f1-maple.ini)
|
||||||
|
#
|
||||||
|
from __future__ import print_function
|
||||||
|
import sys
|
||||||
|
|
||||||
|
# Dynamic build flags for generic compile options
|
||||||
|
if __name__ == "__main__":
|
||||||
|
|
||||||
|
# Print these plus the given args when running directly on the command-line
|
||||||
|
args = [
|
||||||
|
"-std=gnu++14",
|
||||||
|
"-Os",
|
||||||
|
"-mcpu=cortex-m3",
|
||||||
|
"-mthumb",
|
||||||
|
|
||||||
|
"-fsigned-char",
|
||||||
|
"-fno-move-loop-invariants",
|
||||||
|
"-fno-strict-aliasing",
|
||||||
|
"-fsingle-precision-constant",
|
||||||
|
|
||||||
|
"--specs=nano.specs",
|
||||||
|
"--specs=nosys.specs",
|
||||||
|
|
||||||
|
"-MMD", "-MP",
|
||||||
|
|
||||||
|
"-IMarlin/src/HAL/STM32F1",
|
||||||
|
|
||||||
|
"-DTARGET_STM32F1",
|
||||||
|
"-DARDUINO_ARCH_STM32",
|
||||||
|
"-DPLATFORM_M997_SUPPORT"
|
||||||
|
] + sys.argv[1:]
|
||||||
|
|
||||||
|
print(" ".join(args))
|
||||||
|
|
||||||
|
else:
|
||||||
|
|
||||||
|
# Extra script for stm32f1-maple.ini build_flags
|
||||||
|
|
||||||
|
import pioutil
|
||||||
|
if pioutil.is_pio_build():
|
||||||
|
pioutil.env.Append(
|
||||||
|
ARFLAGS=["rcs"],
|
||||||
|
|
||||||
|
ASFLAGS=["-x", "assembler-with-cpp"],
|
||||||
|
|
||||||
|
CXXFLAGS=[
|
||||||
|
"-fabi-version=0",
|
||||||
|
"-fno-use-cxa-atexit",
|
||||||
|
"-fno-threadsafe-statics"
|
||||||
|
],
|
||||||
|
LINKFLAGS=[
|
||||||
|
"-Os",
|
||||||
|
"-mcpu=cortex-m3",
|
||||||
|
"-ffreestanding",
|
||||||
|
"-mthumb",
|
||||||
|
"--specs=nano.specs",
|
||||||
|
"--specs=nosys.specs",
|
||||||
|
"-u_printf_float",
|
||||||
|
],
|
||||||
|
)
|
|
@ -3,10 +3,9 @@
|
||||||
#
|
#
|
||||||
import pioutil
|
import pioutil
|
||||||
if pioutil.is_pio_build():
|
if pioutil.is_pio_build():
|
||||||
import shutil,marlin
|
import shutil, marlin
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
env = pioutil.env
|
||||||
Import("env")
|
|
||||||
platform = env.PioPlatform()
|
platform = env.PioPlatform()
|
||||||
board = env.BoardConfig()
|
board = env.BoardConfig()
|
||||||
|
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
#
|
|
||||||
# add_nanolib.py
|
|
||||||
#
|
|
||||||
Import("env")
|
|
||||||
|
|
||||||
env.Append(LINKFLAGS=["--specs=nano.specs"])
|
|
|
@ -4,9 +4,9 @@
|
||||||
#
|
#
|
||||||
import pioutil
|
import pioutil
|
||||||
if pioutil.is_pio_build():
|
if pioutil.is_pio_build():
|
||||||
import struct,uuid,marlin
|
import struct, uuid, marlin
|
||||||
|
|
||||||
board = marlin.env.BoardConfig()
|
board = pioutil.env.BoardConfig()
|
||||||
|
|
||||||
def calculate_crc(contents, seed):
|
def calculate_crc(contents, seed):
|
||||||
accumulating_xor_value = seed
|
accumulating_xor_value = seed
|
||||||
|
|
|
@ -7,8 +7,7 @@ import pioutil
|
||||||
if pioutil.is_pio_build():
|
if pioutil.is_pio_build():
|
||||||
|
|
||||||
import os, re
|
import os, re
|
||||||
Import("env")
|
env = pioutil.env
|
||||||
Import("projenv")
|
|
||||||
|
|
||||||
os.environ['PATH'] = f"./buildroot/bin/:./buildroot/tests/:{os.environ['PATH']}"
|
os.environ['PATH'] = f"./buildroot/bin/:./buildroot/tests/:{os.environ['PATH']}"
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
import pioutil
|
import pioutil
|
||||||
if pioutil.is_pio_build():
|
if pioutil.is_pio_build():
|
||||||
Import("env")
|
env = pioutil.env
|
||||||
|
|
||||||
cxxflags = [
|
cxxflags = [
|
||||||
# "-Wno-incompatible-pointer-types",
|
# "-Wno-incompatible-pointer-types",
|
||||||
|
|
|
@ -4,7 +4,9 @@
|
||||||
#
|
#
|
||||||
import pioutil
|
import pioutil
|
||||||
if pioutil.is_pio_build():
|
if pioutil.is_pio_build():
|
||||||
Import("env", "projenv")
|
env = pioutil.env
|
||||||
|
projenv = env
|
||||||
|
Import("projenv") # src_dir environment. Only for post: scripts!
|
||||||
|
|
||||||
def apply_board_build_flags():
|
def apply_board_build_flags():
|
||||||
if not 'BOARD_CUSTOM_BUILD_FLAGS' in env['MARLIN_FEATURES']:
|
if not 'BOARD_CUSTOM_BUILD_FLAGS' in env['MARLIN_FEATURES']:
|
||||||
|
|
|
@ -5,10 +5,10 @@
|
||||||
import pioutil
|
import pioutil
|
||||||
if pioutil.is_pio_build():
|
if pioutil.is_pio_build():
|
||||||
|
|
||||||
import subprocess,os,re,fnmatch,glob
|
import os, re, fnmatch, glob
|
||||||
srcfilepattern = re.compile(r".*[.](cpp|c)$")
|
srcfilepattern = re.compile(r".*[.](cpp|c)$")
|
||||||
marlinbasedir = os.path.join(os.getcwd(), "Marlin/")
|
marlinbasedir = os.path.join(os.getcwd(), "Marlin/")
|
||||||
Import("env")
|
env = pioutil.env
|
||||||
|
|
||||||
from platformio.package.meta import PackageSpec
|
from platformio.package.meta import PackageSpec
|
||||||
from platformio.project.config import ProjectConfig
|
from platformio.project.config import ProjectConfig
|
||||||
|
|
|
@ -11,7 +11,7 @@ def blab(str,level=1):
|
||||||
if verbose >= level: print(f"[config] {str}")
|
if verbose >= level: print(f"[config] {str}")
|
||||||
|
|
||||||
def config_path(cpath):
|
def config_path(cpath):
|
||||||
return Path("Marlin", cpath, encoding='utf-8')
|
return Path("Marlin", cpath)
|
||||||
|
|
||||||
# Apply a single name = on/off ; name = value ; etc.
|
# Apply a single name = on/off ; name = value ; etc.
|
||||||
# TODO: Limit to the given (optional) configuration
|
# TODO: Limit to the given (optional) configuration
|
||||||
|
@ -223,7 +223,7 @@ def apply_config_ini(cp):
|
||||||
sect = 'base'
|
sect = 'base'
|
||||||
if '@' in ckey: sect, ckey = map(str.strip, ckey.split('@'))
|
if '@' in ckey: sect, ckey = map(str.strip, ckey.split('@'))
|
||||||
cp2 = configparser.ConfigParser()
|
cp2 = configparser.ConfigParser()
|
||||||
cp2.read(config_path(ckey))
|
cp2.read(config_path(ckey), encoding='utf-8')
|
||||||
apply_sections(cp2, sect)
|
apply_sections(cp2, sect)
|
||||||
ckey = 'base'
|
ckey = 'base'
|
||||||
|
|
||||||
|
@ -270,7 +270,7 @@ if __name__ == "__main__":
|
||||||
|
|
||||||
if ini_file:
|
if ini_file:
|
||||||
user_ini = configparser.ConfigParser()
|
user_ini = configparser.ConfigParser()
|
||||||
user_ini.read(ini_file)
|
user_ini.read(ini_file, encoding='utf-8')
|
||||||
apply_config_ini(user_ini)
|
apply_config_ini(user_ini)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
@ -279,11 +279,8 @@ else:
|
||||||
#
|
#
|
||||||
import pioutil
|
import pioutil
|
||||||
if pioutil.is_pio_build():
|
if pioutil.is_pio_build():
|
||||||
|
|
||||||
Import("env")
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
verbose = int(env.GetProjectOption('custom_verbose'))
|
verbose = int(pioutil.env.GetProjectOption('custom_verbose'))
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
import pioutil
|
import pioutil
|
||||||
if pioutil.is_pio_build():
|
if pioutil.is_pio_build():
|
||||||
import marlin
|
import marlin
|
||||||
board = marlin.env.BoardConfig()
|
board = pioutil.env.BoardConfig()
|
||||||
|
|
||||||
address = board.get("build.address", "")
|
address = board.get("build.address", "")
|
||||||
if address:
|
if address:
|
||||||
|
|
|
@ -4,10 +4,10 @@
|
||||||
#
|
#
|
||||||
import pioutil
|
import pioutil
|
||||||
if pioutil.is_pio_build():
|
if pioutil.is_pio_build():
|
||||||
Import("env")
|
import requests, zipfile, tempfile, shutil
|
||||||
import requests,zipfile,tempfile,shutil
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
env = pioutil.env
|
||||||
url = "https://github.com/makerbase-mks/Mks-Robin-Nano-Marlin2.0-Firmware/archive/0263cdaccf.zip"
|
url = "https://github.com/makerbase-mks/Mks-Robin-Nano-Marlin2.0-Firmware/archive/0263cdaccf.zip"
|
||||||
deps_path = Path(env.Dictionary("PROJECT_LIBDEPS_DIR"))
|
deps_path = Path(env.Dictionary("PROJECT_LIBDEPS_DIR"))
|
||||||
zip_path = deps_path / "mks-assets.zip"
|
zip_path = deps_path / "mks-assets.zip"
|
||||||
|
|
|
@ -8,8 +8,7 @@ if pioutil.is_pio_build():
|
||||||
from os.path import join, isfile
|
from os.path import join, isfile
|
||||||
from pprint import pprint
|
from pprint import pprint
|
||||||
|
|
||||||
Import("env")
|
env = pioutil.env
|
||||||
|
|
||||||
if env.MarlinHas("POSTMORTEM_DEBUGGING"):
|
if env.MarlinHas("POSTMORTEM_DEBUGGING"):
|
||||||
FRAMEWORK_DIR = env.PioPlatform().get_package_dir("framework-arduinoststm32-maple")
|
FRAMEWORK_DIR = env.PioPlatform().get_package_dir("framework-arduinoststm32-maple")
|
||||||
patchflag_path = join(FRAMEWORK_DIR, ".exc-patching-done")
|
patchflag_path = join(FRAMEWORK_DIR, ".exc-patching-done")
|
||||||
|
|
|
@ -8,14 +8,14 @@
|
||||||
import pioutil, re
|
import pioutil, re
|
||||||
marlin_variant_pattern = re.compile("marlin_.*")
|
marlin_variant_pattern = re.compile("marlin_.*")
|
||||||
if pioutil.is_pio_build():
|
if pioutil.is_pio_build():
|
||||||
import shutil,marlin
|
import shutil, marlin
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
#
|
#
|
||||||
# Get the platform name from the 'platform_packages' option,
|
# Get the platform name from the 'platform_packages' option,
|
||||||
# or look it up by the platform.class.name.
|
# or look it up by the platform.class.name.
|
||||||
#
|
#
|
||||||
env = marlin.env
|
env = pioutil.env
|
||||||
platform = env.PioPlatform()
|
platform = env.PioPlatform()
|
||||||
|
|
||||||
from platformio.package.meta import PackageSpec
|
from platformio.package.meta import PackageSpec
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
#
|
#
|
||||||
import pioutil
|
import pioutil
|
||||||
if pioutil.is_pio_build():
|
if pioutil.is_pio_build():
|
||||||
import os,marlin
|
import os, marlin
|
||||||
|
|
||||||
board = marlin.env.BoardConfig()
|
board = marlin.env.BoardConfig()
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,7 @@
|
||||||
#
|
#
|
||||||
# Create a Configuration from marlin_config.json
|
# Create a Configuration from marlin_config.json
|
||||||
#
|
#
|
||||||
import json
|
import json, sys, shutil
|
||||||
import sys
|
|
||||||
import shutil
|
|
||||||
|
|
||||||
opt_output = '--opt' in sys.argv
|
opt_output = '--opt' in sys.argv
|
||||||
output_suffix = '.sh' if opt_output else '' if '--bare-output' in sys.argv else '.gen'
|
output_suffix = '.sh' if opt_output else '' if '--bare-output' in sys.argv else '.gen'
|
||||||
|
|
|
@ -4,8 +4,7 @@
|
||||||
import pioutil
|
import pioutil
|
||||||
if pioutil.is_pio_build():
|
if pioutil.is_pio_build():
|
||||||
from os.path import join
|
from os.path import join
|
||||||
|
env = pioutil.env
|
||||||
Import("env")
|
|
||||||
|
|
||||||
board = env.BoardConfig()
|
board = env.BoardConfig()
|
||||||
board_keys = board.get("build").keys()
|
board_keys = board.get("build").keys()
|
||||||
|
|
|
@ -2,10 +2,11 @@
|
||||||
# pioutil.py
|
# pioutil.py
|
||||||
#
|
#
|
||||||
|
|
||||||
|
from SCons.Script import DefaultEnvironment
|
||||||
|
env = DefaultEnvironment()
|
||||||
|
|
||||||
# Make sure 'vscode init' is not the current command
|
# Make sure 'vscode init' is not the current command
|
||||||
def is_pio_build():
|
def is_pio_build():
|
||||||
from SCons.Script import DefaultEnvironment
|
|
||||||
env = DefaultEnvironment()
|
|
||||||
if "IsCleanTarget" in dir(env) and env.IsCleanTarget(): return False
|
if "IsCleanTarget" in dir(env) and env.IsCleanTarget(): return False
|
||||||
return not env.IsIntegrationDump()
|
return not env.IsIntegrationDump()
|
||||||
|
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
import pioutil
|
import pioutil
|
||||||
if pioutil.is_pio_build():
|
if pioutil.is_pio_build():
|
||||||
|
|
||||||
import re,sys
|
import re, sys
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
Import("env")
|
env = pioutil.env
|
||||||
|
|
||||||
def get_envs_for_board(board):
|
def get_envs_for_board(board):
|
||||||
ppath = Path("Marlin/src/pins/pins.h")
|
ppath = Path("Marlin/src/pins/pins.h")
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
import pioutil
|
import pioutil
|
||||||
if pioutil.is_pio_build():
|
if pioutil.is_pio_build():
|
||||||
# Get the environment thus far for the build
|
# Get the environment thus far for the build
|
||||||
Import("env")
|
env = pioutil.env
|
||||||
|
|
||||||
#print(env.Dump())
|
#print(env.Dump())
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
import pioutil
|
import pioutil
|
||||||
if pioutil.is_pio_build():
|
if pioutil.is_pio_build():
|
||||||
Import("env")
|
env = pioutil.env
|
||||||
|
|
||||||
# Get a build flag's value or None
|
# Get a build flag's value or None
|
||||||
def getBuildFlagValue(name):
|
def getBuildFlagValue(name):
|
||||||
|
|
|
@ -7,9 +7,7 @@ if pioutil.is_pio_build():
|
||||||
|
|
||||||
import marlin, os
|
import marlin, os
|
||||||
|
|
||||||
from SCons.Script import DefaultEnvironment
|
env = pioutil.env
|
||||||
|
|
||||||
env = DefaultEnvironment()
|
|
||||||
|
|
||||||
# Check whether the "update" folder exists
|
# Check whether the "update" folder exists
|
||||||
outpath = "update"
|
outpath = "update"
|
||||||
|
|
|
@ -206,12 +206,12 @@ class Entry():
|
||||||
'''
|
'''
|
||||||
__slots__ = ('width', 'height', 'offset', 'length', 'filename')
|
__slots__ = ('width', 'height', 'offset', 'length', 'filename')
|
||||||
|
|
||||||
def __init__(self, w=0, h=0, length=0, offset=0):
|
def __init__(self, w=0, h=0, length=0, offset=0, filename=None):
|
||||||
self.width = w
|
self.width = w
|
||||||
self.height = h
|
self.height = h
|
||||||
self.offset = offset
|
self.offset = offset
|
||||||
self.length = length
|
self.length = length
|
||||||
self.filename = None
|
self.filename = filename
|
||||||
|
|
||||||
def parseRawData(self, rawEntryBytes):
|
def parseRawData(self, rawEntryBytes):
|
||||||
if len(rawEntryBytes) != 16:
|
if len(rawEntryBytes) != 16:
|
||||||
|
|
|
@ -181,7 +181,7 @@ class Protocol(object):
|
||||||
except ReadTimeout:
|
except ReadTimeout:
|
||||||
self.errors += 1
|
self.errors += 1
|
||||||
#print("Packetloss detected..")
|
#print("Packetloss detected..")
|
||||||
except serial.serialutil.SerialException:
|
except serial.SerialException:
|
||||||
return
|
return
|
||||||
self.packet_transit = None
|
self.packet_transit = None
|
||||||
|
|
||||||
|
@ -201,7 +201,7 @@ class Protocol(object):
|
||||||
|
|
||||||
def transmit_packet(self, packet):
|
def transmit_packet(self, packet):
|
||||||
packet = bytearray(packet)
|
packet = bytearray(packet)
|
||||||
if(self.simulate_errors > 0 and random.random() > (1.0 - self.simulate_errors)):
|
if (self.simulate_errors > 0 and random.random() > (1.0 - self.simulate_errors)):
|
||||||
if random.random() > 0.9:
|
if random.random() > 0.9:
|
||||||
#random data drop
|
#random data drop
|
||||||
start = random.randint(0, len(packet))
|
start = random.randint(0, len(packet))
|
||||||
|
|
|
@ -22,7 +22,7 @@ from __future__ import print_function
|
||||||
from __future__ import division
|
from __future__ import division
|
||||||
|
|
||||||
from math import *
|
from math import *
|
||||||
import sys,getopt
|
import sys, getopt
|
||||||
|
|
||||||
"Constants"
|
"Constants"
|
||||||
ZERO = 273.15 # zero point of Kelvin scale
|
ZERO = 273.15 # zero point of Kelvin scale
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
# Generate Marlin TFT Images from bitmaps/PNG/JPG
|
# Generate Marlin TFT Images from bitmaps/PNG/JPG
|
||||||
|
|
||||||
import sys,struct
|
import sys, struct
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
|
|
||||||
def image2bin(image, output_file):
|
def image2bin(image, output_file):
|
||||||
|
|
|
@ -17,7 +17,7 @@ TODO: Use the defines and comments above the namespace from existing language fi
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import sys, re, requests, csv, datetime
|
import sys, re, requests, csv, datetime
|
||||||
from languageUtil import namebyid
|
#from languageUtil import namebyid
|
||||||
|
|
||||||
LANGHOME = "Marlin/src/lcd/language"
|
LANGHOME = "Marlin/src/lcd/language"
|
||||||
OUTDIR = 'out-language'
|
OUTDIR = 'out-language'
|
||||||
|
@ -76,10 +76,10 @@ for row in reader:
|
||||||
# Add the named string for all the included languages
|
# Add the named string for all the included languages
|
||||||
name = row[0]
|
name = row[0]
|
||||||
for i in range(1, numcols):
|
for i in range(1, numcols):
|
||||||
str = row[i]
|
str_key = row[i]
|
||||||
if str:
|
if str_key:
|
||||||
col = columns[i]
|
col = columns[i]
|
||||||
strings_per_lang[col['lang']][col['style']][name] = str
|
strings_per_lang[col['lang']][col['style']][name] = str_key
|
||||||
|
|
||||||
# Create a folder for the imported language outfiles
|
# Create a folder for the imported language outfiles
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
@ -199,11 +199,11 @@ for i in range(1, numcols):
|
||||||
comm = ''
|
comm = ''
|
||||||
if lang != 'en' and 'en' in strings_per_lang:
|
if lang != 'en' and 'en' in strings_per_lang:
|
||||||
en = strings_per_lang['en']
|
en = strings_per_lang['en']
|
||||||
if name in en[style]: str = en[style][name]
|
if name in en[style]: str_key = en[style][name]
|
||||||
elif name in en['Narrow']: str = en['Narrow'][name]
|
elif name in en['Narrow']: str_key = en['Narrow'][name]
|
||||||
if str:
|
if str_key:
|
||||||
cfmt = '%%%ss// %%s' % (50 - len(val) if len(val) < 50 else 1)
|
cfmt = '%%%ss// %%s' % (50 - len(val) if len(val) < 50 else 1)
|
||||||
comm = cfmt % (' ', str)
|
comm = cfmt % (' ', str_key)
|
||||||
|
|
||||||
# Write out the string definition
|
# Write out the string definition
|
||||||
f.write(lstr_fmt % (name, val, comm))
|
f.write(lstr_fmt % (name, val, comm))
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
#
|
#
|
||||||
# marlang.py
|
# languageUtil.py
|
||||||
#
|
#
|
||||||
|
|
||||||
# A dictionary to contain language names
|
# A dictionary to contain language names
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#
|
#
|
||||||
# Usage: rle16_compress_cpp_image_data.py INPUT_FILE.cpp OUTPUT_FILE.cpp
|
# Usage: rle16_compress_cpp_image_data.py INPUT_FILE.cpp OUTPUT_FILE.cpp
|
||||||
#
|
#
|
||||||
import sys,struct
|
import sys, struct
|
||||||
import re
|
import re
|
||||||
|
|
||||||
def addCompressedData(input_file, output_file):
|
def addCompressedData(input_file, output_file):
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#
|
#
|
||||||
# Usage: rle_compress_bitmap.py INPUT_FILE OUTPUT_FILE
|
# Usage: rle_compress_bitmap.py INPUT_FILE OUTPUT_FILE
|
||||||
#
|
#
|
||||||
import sys,struct
|
import sys, struct
|
||||||
import re
|
import re
|
||||||
|
|
||||||
def addCompressedData(input_file, output_file):
|
def addCompressedData(input_file, output_file):
|
||||||
|
|
|
@ -1,11 +1,6 @@
|
||||||
import argparse
|
import argparse, sys, os, time, random, serial
|
||||||
import sys
|
from SCons.Script import DefaultEnvironment
|
||||||
import os
|
env = DefaultEnvironment()
|
||||||
import time
|
|
||||||
import random
|
|
||||||
import serial
|
|
||||||
|
|
||||||
Import("env")
|
|
||||||
|
|
||||||
import MarlinBinaryProtocol
|
import MarlinBinaryProtocol
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,7 @@
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
from __future__ import division
|
from __future__ import division
|
||||||
|
|
||||||
import sys,os,re
|
import sys, os, re
|
||||||
|
|
||||||
pwd = os.getcwd() # make sure we're executing from the correct directory level
|
pwd = os.getcwd() # make sure we're executing from the correct directory level
|
||||||
pwd = pwd.replace('\\', '/')
|
pwd = pwd.replace('\\', '/')
|
||||||
|
@ -103,7 +103,7 @@ current_OS = platform.system()
|
||||||
target_env = ''
|
target_env = ''
|
||||||
board_name = ''
|
board_name = ''
|
||||||
|
|
||||||
from datetime import datetime, date, time
|
from datetime import datetime
|
||||||
|
|
||||||
#########
|
#########
|
||||||
# Python 2 error messages:
|
# Python 2 error messages:
|
||||||
|
@ -151,8 +151,6 @@ def get_answer(board_name, question_txt, options, default_value=1):
|
||||||
root_get_answer.protocol("WM_DELETE_WINDOW", disable_event)
|
root_get_answer.protocol("WM_DELETE_WINDOW", disable_event)
|
||||||
root_get_answer.resizable(False, False)
|
root_get_answer.resizable(False, False)
|
||||||
|
|
||||||
root_get_answer.radio_state = default_value # declare variables used by TK and enable
|
|
||||||
|
|
||||||
global get_answer_val
|
global get_answer_val
|
||||||
get_answer_val = default_value # return get_answer_val, set default to match radio_state default
|
get_answer_val = default_value # return get_answer_val, set default to match radio_state default
|
||||||
|
|
||||||
|
@ -880,7 +878,6 @@ def run_PIO(dummy):
|
||||||
print('build_type: ', build_type)
|
print('build_type: ', build_type)
|
||||||
|
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
|
||||||
|
|
||||||
print('starting platformio')
|
print('starting platformio')
|
||||||
|
|
||||||
|
@ -965,7 +962,6 @@ def run_PIO(dummy):
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
|
|
||||||
import time
|
|
||||||
import threading
|
import threading
|
||||||
if python_ver == 2:
|
if python_ver == 2:
|
||||||
import Tkinter as tk
|
import Tkinter as tk
|
||||||
|
@ -978,7 +974,6 @@ else:
|
||||||
import tkinter as tk
|
import tkinter as tk
|
||||||
import queue as queue
|
import queue as queue
|
||||||
from tkinter import ttk, Tk, Frame, Text, Menu
|
from tkinter import ttk, Tk, Frame, Text, Menu
|
||||||
import subprocess
|
|
||||||
import sys
|
import sys
|
||||||
que = queue.Queue()
|
que = queue.Queue()
|
||||||
#IO_queue = queue.Queue()
|
#IO_queue = queue.Queue()
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
from __future__ import division
|
from __future__ import division
|
||||||
|
|
||||||
import subprocess,os,platform
|
import subprocess, os, platform
|
||||||
from SCons.Script import DefaultEnvironment
|
from SCons.Script import DefaultEnvironment
|
||||||
|
|
||||||
current_OS = platform.system()
|
current_OS = platform.system()
|
||||||
|
|
|
@ -9,9 +9,9 @@
|
||||||
# Will continue on if a COM port isn't found so that the compilation can be done.
|
# Will continue on if a COM port isn't found so that the compilation can be done.
|
||||||
#
|
#
|
||||||
|
|
||||||
import os
|
import os, platform
|
||||||
from SCons.Script import DefaultEnvironment
|
from SCons.Script import DefaultEnvironment
|
||||||
import platform
|
|
||||||
current_OS = platform.system()
|
current_OS = platform.system()
|
||||||
|
|
||||||
env = DefaultEnvironment()
|
env = DefaultEnvironment()
|
||||||
|
|
|
@ -25,13 +25,13 @@
|
||||||
[STM32F1_maple]
|
[STM32F1_maple]
|
||||||
platform = ststm32@~12.1
|
platform = ststm32@~12.1
|
||||||
board_build.core = maple
|
board_build.core = maple
|
||||||
build_flags = !python Marlin/src/HAL/STM32F1/build_flags.py
|
build_flags = !python buildroot/share/PlatformIO/scripts/STM32F1_build_flags.py
|
||||||
${common.build_flags} -DARDUINO_ARCH_STM32 -DMAPLE_STM32F1 -DPLATFORM_M997_SUPPORT
|
${common.build_flags} -DARDUINO_ARCH_STM32 -DMAPLE_STM32F1 -DPLATFORM_M997_SUPPORT
|
||||||
build_unflags = -std=gnu11 -std=gnu++11
|
build_unflags = -std=gnu11 -std=gnu++11
|
||||||
build_src_filter = ${common.default_src_filter} +<src/HAL/STM32F1> -<src/HAL/STM32F1/tft>
|
build_src_filter = ${common.default_src_filter} +<src/HAL/STM32F1> -<src/HAL/STM32F1/tft>
|
||||||
lib_ignore = SPI, FreeRTOS701, FreeRTOS821
|
lib_ignore = SPI, FreeRTOS701, FreeRTOS821
|
||||||
lib_deps = ${common.lib_deps}
|
lib_deps = ${common.lib_deps}
|
||||||
SoftwareSerialM
|
SoftwareSerialM
|
||||||
platform_packages = tool-stm32duino
|
platform_packages = tool-stm32duino
|
||||||
extra_scripts = ${common.extra_scripts}
|
extra_scripts = ${common.extra_scripts}
|
||||||
pre:buildroot/share/PlatformIO/scripts/fix_framework_weakness.py
|
pre:buildroot/share/PlatformIO/scripts/fix_framework_weakness.py
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue