Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Firmware
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
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alberto Ruiz Garcia
Firmware
Commits
8b91a68f
Commit
8b91a68f
authored
6 years ago
by
Julian Oes
Committed by
David Sidrane
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
px_uploader: white space PEP8 fixes
parent
f9a6c13d
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
Tools/px_uploader.py
+7
-7
7 additions, 7 deletions
Tools/px_uploader.py
with
7 additions
and
7 deletions
Tools/px_uploader.py
+
7
−
7
View file @
8b91a68f
...
...
@@ -191,7 +191,7 @@ class uploader(object):
MAVLINK_REBOOT_ID1
=
bytearray
(
b
'
\xfe\x21\x72\xff\x00\x4c\x00\x00\x40\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf6\x00\x01\x00\x00\x53\x6b
'
)
MAVLINK_REBOOT_ID0
=
bytearray
(
b
'
\xfe\x21\x45\xff\x00\x4c\x00\x00\x40\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf6\x00\x00\x00\x00\xcc\x37
'
)
MAX_FLASH_PRGRAM_TIME
=
0.001
# Time on an F7 to send SYNC, RESULT from last data in multi RXed
MAX_FLASH_PRGRAM_TIME
=
0.001
# Time on an F7 to send SYNC, RESULT from last data in multi RXed
SYNC_DETECT_THRESHOLD
=
0.00015
def
__init__
(
self
,
portname
,
baudrate_bootloader
,
baudrate_flightstack
):
...
...
@@ -204,7 +204,7 @@ class uploader(object):
# we use a window approche to SYNC,<result> gathring
self
.
window
=
0
self
.
window_max
=
256
self
.
window_per
=
2
# Sync,<result>
self
.
window_per
=
2
# Sync,<result>
self
.
maxDtGetSync
=
-
1000.00
self
.
port
=
serial
.
Serial
(
portname
,
baudrate_bootloader
,
timeout
=
0.5
,
write_timeout
=
0.5
)
...
...
@@ -254,7 +254,7 @@ class uploader(object):
# debugging code
def
__probe
(
self
,
state
):
#self.port.setRTS(state)
#
self.port.setRTS(state)
return
def
__send
(
self
,
c
):
...
...
@@ -301,7 +301,7 @@ class uploader(object):
data
=
bytearray
(
bytes
(
self
.
__recv
(
count
)))
if
(
len
(
data
)
!=
count
):
raise
RuntimeError
(
"
Ack Window %i not %i
"
%
(
len
(
data
),
count
))
for
i
in
range
(
0
,
len
(
data
),
2
):
for
i
in
range
(
0
,
len
(
data
),
2
):
if
chr
(
data
[
i
])
!=
self
.
INSYNC
:
raise
RuntimeError
(
"
unexpected %s instead of INSYNC
"
%
c
)
if
chr
(
data
[
i
+
1
])
==
self
.
INVALID
:
...
...
@@ -357,8 +357,8 @@ class uploader(object):
synstart
=
time
.
time
()
self
.
__getSync
()
dif
=
time
.
time
()
-
synstart
#print("%5.5f" %dif)
if
(
dif
>
self
.
maxDtGetSync
and
dif
!=
0
)
:
#
print("%5.5f" %dif)
if
(
dif
>
self
.
maxDtGetSync
and
dif
!=
0
):
self
.
maxDtGetSync
=
dif
return
value
...
...
@@ -436,7 +436,7 @@ class uploader(object):
self
.
__send
(
data
)
self
.
__send
(
uploader
.
EOC
)
if
(
not
windowMode
):
self
.
__getSync
()
self
.
__getSync
()
else
:
# The following is done to have minimum delay on the transmission
# of the ne fw. The per block cost of __getSync was about 16 mS per.
...
...
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