Skip to main content
Homepage
Explore
Search or go to…
/
Register
Sign in
Explore
Primary navigation
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Collapse sidebar
Snippets
Groups
Projects
Show more breadcrumbs
Jonas Leder
marlin-anet-a8
Commits
2919f304
Commit
2919f304
authored
Jan 12, 2019
by
Chris Pepper
Committed by
Scott Lahteine
Jan 12, 2019
Browse files
Options
Downloads
Patches
Plain Diff
[LPC176x] Update PIO extrascript (#12878)
parent
19fea772
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Marlin/src/HAL/HAL_LPC1768/upload_extra_script.py
+74
-81
74 additions, 81 deletions
Marlin/src/HAL/HAL_LPC1768/upload_extra_script.py
platformio.ini
+2
-2
2 additions, 2 deletions
platformio.ini
with
76 additions
and
83 deletions
Marlin/src/HAL/HAL_LPC1768/upload_extra_script.py
+
74
−
81
View file @
2919f304
...
...
@@ -10,18 +10,16 @@ target_drive = "REARM"
import
os
import
platform
current_OS
=
platform
.
system
()
Import
(
"
env
"
)
#env_vars = subprocess.check_output('platformio run -t envdump')
#env_vars = env_vars.split('\n')
#for env in env_vars:
# print env
#exit(0)
build_type
=
os
.
environ
.
get
(
"
BUILD_TYPE
"
,
'
Not Set
'
)
if
build_type
==
'
upload
'
or
build_type
==
'
traceback
'
or
build_type
==
'
Not Set
'
:
def
detect_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
'
try
:
if
current_OS
==
'
Windows
'
:
#
# platformio.ini will accept this for a Windows upload port designation: 'upload_port = L:'
# Windows - doesn't care about the disk's name, only cares about the drive letter
...
...
@@ -30,12 +28,14 @@ if build_type == 'upload' or build_type == 'traceback' or build_type == 'Not Set
#
# get all drives on this computer
#
import
subprocess
driveStr
=
subprocess
.
check_output
(
"
fsutil fsinfo drives
"
)
# typical result (string): 'Drives: C:\ D:\ E:\ F:\ G:\ H:\ I:\ J:\ K:\ L:\ M:\ Y:\ Z:\'
driveStr
=
driveStr
.
strip
().
lstrip
(
'
Drives:
'
)
# typical result (string): 'C:\ D:\ E:\ F:\ G:\ H:\ I:\ J:\ K:\ L:\ M:\ Y:\ Z:\'
drives
=
driveStr
.
split
()
# typical result (array of stings): ['C:\\', 'D:\\', 'E:\\', 'F:\\', 'G:\\', 'H:\\', 'I:\\', 'J:\\', 'K:\\', 'L:\\', 'M:\\', 'Y:\\', 'Z:\\']
# typical result (string): 'Drives: C:\ D:\ E:\ F:\ G:\ H:\ I:\ J:\ K:\ L:\ M:\ Y:\ Z:\'
driveStr
=
subprocess
.
check_output
(
"
fsutil fsinfo drives
"
)
# typical result (string): 'C:\ D:\ E:\ F:\ G:\ H:\ I:\ J:\ K:\ L:\ M:\ Y:\ Z:\'
driveStr
=
driveStr
.
strip
().
lstrip
(
'
Drives:
'
)
# typical result (array of stings): ['C:\\', 'D:\\', 'E:\\', 'F:\\',
# 'G:\\', 'H:\\', 'I:\\', 'J:\\', 'K:\\', 'L:\\', 'M:\\', 'Y:\\', 'Z:\\']
drives
=
driveStr
.
split
()
upload_disk
=
'
Disk not found
'
target_file_found
=
False
...
...
@@ -60,21 +60,17 @@ if build_type == 'upload' or build_type == 'traceback' or build_type == 'Not Set
#
if
target_file_found
==
True
or
target_drive_found
==
True
:
Import
(
"
env
"
)
env
.
Replace
(
UPLOAD_PORT
=
upload_disk
)
print
'
upload disk:
'
,
upload_disk
else
:
print
'
\n
Unable to find destination disk. File must be copied manually.
\n
'
if
current_OS
==
'
Linux
'
:
detect_error
(
'
Autodetect Error
'
)
elif
current_OS
==
'
Linux
'
:
#
# platformio.ini will accept this for a Linux upload port designation: 'upload_port = /media/media_name/drive'
#
upload_disk
=
'
Disk not found
'
target_file_found
=
False
target_drive_found
=
False
...
...
@@ -100,23 +96,18 @@ if build_type == 'upload' or build_type == 'traceback' or build_type == 'Not Set
#
if
target_file_found
==
True
or
target_drive_found
==
True
:
Import
(
"
env
"
)
env
.
Replace
(
UPLOAD_FLAGS
=
"
-P$UPLOAD_PORT
"
,
UPLOAD_PORT
=
upload_disk
)
print
'
upload disk:
'
,
upload_disk
else
:
print
'
\n
Unable to find destination disk. File must be copied manually.
\n
'
if
current_OS
==
'
Darwin
'
:
# MAC
detect_error
(
'
Autodetect Error
'
)
elif
current_OS
==
'
Darwin
'
:
# MAC
#
# platformio.ini will accept this for a OSX upload port designation: 'upload_port = /media/media_name/drive'
#
import
os
upload_disk
=
'
Disk not found
'
drives
=
os
.
listdir
(
'
/Volumes
'
)
# human readable names
target_file_found
=
False
...
...
@@ -139,10 +130,12 @@ if build_type == 'upload' or build_type == 'traceback' or build_type == 'Not Set
#
if
target_file_found
==
True
or
target_drive_found
==
True
:
Import
(
"
env
"
)
env
.
Replace
(
UPLOAD_PORT
=
upload_disk
)
print
'
\n
upload disk:
'
,
upload_disk
,
'
\n
'
else
:
print
'
\n
Unable to find destination disk. File must be copied manually.
\n
'
detect_error
(
'
Autodetect Error
'
)
except
Exception
as
e
:
detect_error
(
str
(
e
))
This diff is collapsed.
Click to expand it.
platformio.ini
+
2
−
2
View file @
2919f304
...
...
@@ -161,7 +161,7 @@ src_filter = ${common.default_src_filter} +<src/HAL/HAL_LPC1768>
monitor_speed
=
250000
lib_deps
=
Servo
LiquidCrystal
https://github.com/MarlinFirmware/U8glib-HAL/archive/dev.zip
U8glib-HAL
=
https://github.com/MarlinFirmware/U8glib-HAL/archive/dev.zip
TMCStepper@<1.0.0
[env:LPC1769]
...
...
@@ -179,7 +179,7 @@ src_filter = ${common.default_src_filter} +<src/HAL/HAL_LPC1768>
monitor_speed
=
250000
lib_deps
=
Servo
LiquidCrystal
https://github.com/MarlinFirmware/U8glib-HAL/archive/dev.zip
U8glib-HAL
=
https://github.com/MarlinFirmware/U8glib-HAL/archive/dev.zip
TMCStepper@<1.0.0
#
...
...
...
...
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