🔨 Clean up upload.py (#23679)

This commit is contained in:
GHGiampy 2022-02-05 17:23:44 +01:00 committed by Scott Lahteine
parent cdcf31453b
commit 8799837d75

View File

@ -142,7 +142,7 @@ def Upload(source, target, env):
upload_port = _GetUploadPort(env) # Serial port to use
# Set local upload params
upload_firmware_target_name = os.path.basename(upload_firmware_source_name) # WARNING! Need rework on "binary_stream" to allow filename > 8.3
upload_firmware_target_name = os.path.basename(upload_firmware_source_name)
# Target firmware filename
upload_timeout = 1000 # Communication timout, lossy/slow connections need higher values
upload_blocksize = 512 # Transfer block size. 512 = Autodetect
@ -258,7 +258,7 @@ def Upload(source, target, env):
print('Trigger firmware update...')
protocol.send_ascii('M997', True)
protocol: protocol.shutdown()
protocol.shutdown()
print('Firmware update completed')
except KeyboardInterrupt: