Merge upstream changes from Marlin 2.1.2.3
This commit is contained in:
@@ -18,13 +18,13 @@ def enabled_defines(filepath):
|
||||
Each entry is a dictionary with a 'name' and a 'section' key. We end up with:
|
||||
{ MOTHERBOARD: { name: "MOTHERBOARD", section: "hardware" }, ... }
|
||||
|
||||
The 'name' key might get dropped as redundant, but it's useful for debugging.
|
||||
TODO: Drop the 'name' key as redundant. For now it's useful for debugging.
|
||||
|
||||
This list is only used to filter config-defined options from those defined elsewhere.
|
||||
|
||||
Because the option names are the keys, only the last occurrence is retained.
|
||||
Use the Schema class for a more complete list of options, soon with full parsing.
|
||||
|
||||
This list is used to filter what is actually a config-defined option versus
|
||||
defines from elsewhere.
|
||||
This means the actual used value might not be reflected by this function.
|
||||
The Schema class does more complete parsing for a more accurate list of options.
|
||||
|
||||
While the Schema class parses the configurations on its own, this script will
|
||||
get the preprocessor output and get the intersection of the enabled options from
|
||||
@@ -44,13 +44,10 @@ def enabled_defines(filepath):
|
||||
# This will avoid false positives from #defines in comments
|
||||
f = re.sub(r'/\*.*?\*/', '', '\n'.join(f), flags=re.DOTALL).split("\n")
|
||||
|
||||
a = []
|
||||
for line in f:
|
||||
sline = line.strip()
|
||||
m = re.match(spatt, sline) # @section ...
|
||||
if m:
|
||||
section = m.group(1).strip()
|
||||
continue
|
||||
if m: section = m.group(1).strip() ; continue
|
||||
if sline[:7] == "#define":
|
||||
# Extract the key here (we don't care about the value)
|
||||
kv = sline[8:].strip().split()
|
||||
@@ -79,6 +76,7 @@ def compute_build_signature(env):
|
||||
Compute the build signature by extracting all configuration settings and
|
||||
building a unique reversible signature that can be included in the binary.
|
||||
The signature can be reversed to get a 1:1 equivalent configuration file.
|
||||
Used by common-dependencies.py after filtering build files by feature.
|
||||
'''
|
||||
if 'BUILD_SIGNATURE' in env: return
|
||||
env.Append(BUILD_SIGNATURE=1)
|
||||
|
@@ -157,14 +157,14 @@ def Upload(source, target, env):
|
||||
marlin_string_config_h_author = _GetMarlinEnv(MarlinEnv, 'STRING_CONFIG_H_AUTHOR')
|
||||
|
||||
# Get firmware upload params
|
||||
upload_firmware_source_name = env['PROGNAME'] + '.bin' if 'PROGNAME' in env else str(source[0])
|
||||
upload_firmware_source_path = os.path.join(env["PROJECT_BUILD_DIR"], env["PIOENV"], f"{env['PROGNAME']}.bin") if 'PROGNAME' in env else str(source[0])
|
||||
# Source firmware filename
|
||||
upload_speed = env['UPLOAD_SPEED'] if 'UPLOAD_SPEED' in env else 115200
|
||||
# baud rate of serial connection
|
||||
upload_port = _GetUploadPort(env) # Serial port to use
|
||||
|
||||
# Set local upload params
|
||||
upload_firmware_target_name = os.path.basename(upload_firmware_source_name)
|
||||
upload_firmware_target_name = os.path.basename(upload_firmware_source_path)
|
||||
# Target firmware filename
|
||||
upload_timeout = 1000 # Communication timout, lossy/slow connections need higher values
|
||||
upload_blocksize = 512 # Transfer block size. 512 = Autodetect
|
||||
@@ -216,7 +216,7 @@ def Upload(source, target, env):
|
||||
print(f' LONG_FILENAME_WRITE_SUPPORT : {marlin_longname_write}')
|
||||
print(f' CUSTOM_FIRMWARE_UPLOAD : {marlin_custom_firmware_upload}')
|
||||
print('---- Upload parameters ------------------------')
|
||||
print(f' Source : {upload_firmware_source_name}')
|
||||
print(f' Source : {upload_firmware_source_path}')
|
||||
print(f' Target : {upload_firmware_target_name}')
|
||||
print(f' Port : {upload_port} @ {upload_speed} baudrate')
|
||||
print(f' Timeout : {upload_timeout}')
|
||||
@@ -271,14 +271,14 @@ def Upload(source, target, env):
|
||||
# WARNING! The serial port must be closed here because the serial transfer that follow needs it!
|
||||
|
||||
# Upload firmware file
|
||||
debugPrint(f"Copy '{upload_firmware_source_name}' --> '{upload_firmware_target_name}'")
|
||||
debugPrint(f"Copy '{upload_firmware_source_path}' --> '{upload_firmware_target_name}'")
|
||||
protocol = MarlinBinaryProtocol.Protocol(upload_port, upload_speed, upload_blocksize, float(upload_error_ratio), int(upload_timeout))
|
||||
#echologger = MarlinBinaryProtocol.EchoProtocol(protocol)
|
||||
protocol.connect()
|
||||
# Mark the rollback (delete broken transfer) from this point on
|
||||
rollback = True
|
||||
filetransfer = MarlinBinaryProtocol.FileTransferProtocol(protocol)
|
||||
transferOK = filetransfer.copy(upload_firmware_source_name, upload_firmware_target_name, upload_compression, upload_test)
|
||||
transferOK = filetransfer.copy(upload_firmware_source_path, upload_firmware_target_name, upload_compression, upload_test)
|
||||
protocol.disconnect()
|
||||
|
||||
# Notify upload completed
|
||||
|
Reference in New Issue
Block a user