Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
marlin-anet-a8
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jonas Leder
marlin-anet-a8
Commits
66f70652
Unverified
Commit
66f70652
authored
5 years ago
by
Chris Pepper
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[LPC176x] Update extra script to support Python3 (#13908)
parent
2f32a661
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Marlin/src/HAL/HAL_LPC1768/upload_extra_script.py
+12
-11
12 additions, 11 deletions
Marlin/src/HAL/HAL_LPC1768/upload_extra_script.py
with
12 additions
and
11 deletions
Marlin/src/HAL/HAL_LPC1768/upload_extra_script.py
+
12
−
11
View file @
66f70652
...
...
@@ -3,6 +3,7 @@
# if target_filename is found then that drive is used
# else if target_drive is found then that drive is used
#
from
__future__
import
print_function
target_filename
=
"
FIRMWARE.CUR
"
target_drive
=
"
REARM
"
...
...
@@ -12,11 +13,11 @@ import platform
current_OS
=
platform
.
system
()
Import
(
"
env
"
)
def
detec
t_error
(
e
):
print
'
\n
Unable to find destination disk (
'
+
e
+
'
)
\n
'
\
def
prin
t_error
(
e
):
print
(
'
\n
Unable to find destination disk (
'
+
e
+
'
)
\n
'
\
'
Please select it in platformio.ini using the upload_port keyword
'
\
'
(https://docs.platformio.org/en/latest/projectconf/section_env_upload.html)
\n
'
\
'
or copy the firmware (.pioenvs/
'
+
env
.
get
(
'
PIOENV
'
)
+
'
/firmware.bin) manually to the appropriate disk
\n
'
'
(https://docs.platformio.org/en/latest/projectconf/section_env_upload.html)
'
\
'
or copy the firmware (.pioenvs/
'
+
env
.
get
(
'
PIOENV
'
)
+
'
/firmware.bin) manually to the appropriate disk
\n
'
)
try
:
if
current_OS
==
'
Windows
'
:
...
...
@@ -63,9 +64,9 @@ try:
env
.
Replace
(
UPLOAD_PORT
=
upload_disk
)
print
'
upload disk:
'
,
upload_disk
print
(
'
upload disk:
'
,
upload_disk
)
else
:
detec
t_error
(
'
Autodetect Error
'
)
prin
t_error
(
'
Autodetect Error
'
)
elif
current_OS
==
'
Linux
'
:
#
...
...
@@ -100,9 +101,9 @@ try:
UPLOAD_FLAGS
=
"
-P$UPLOAD_PORT
"
,
UPLOAD_PORT
=
upload_disk
)
print
'
upload disk:
'
,
upload_disk
print
(
'
upload disk:
'
,
upload_disk
)
else
:
detec
t_error
(
'
Autodetect Error
'
)
prin
t_error
(
'
Autodetect Error
'
)
elif
current_OS
==
'
Darwin
'
:
# MAC
#
...
...
@@ -133,9 +134,9 @@ try:
env
.
Replace
(
UPLOAD_PORT
=
upload_disk
)
print
'
\n
upload disk:
'
,
upload_disk
,
'
\n
'
print
(
'
\n
upload disk:
'
,
upload_disk
,
'
\n
'
)
else
:
detec
t_error
(
'
Autodetect Error
'
)
prin
t_error
(
'
Autodetect Error
'
)
except
Exception
as
e
:
detec
t_error
(
str
(
e
))
prin
t_error
(
str
(
e
))
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment