-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ga510.py: add 'reset' after clone error and upload
The radio has to be power cycled after upload or clone errors. This patch fixes issue by adding missing 'resets' to close communicatons.
- Loading branch information
Showing
1 changed file
with
6 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,6 +56,7 @@ def start_program(radio): | |
if not ack.endswith(b'\x06'): | ||
LOG.debug('Ack was %r' % ack) | ||
raise errors.RadioError('Radio did not respond to clone request') | ||
reset(radio) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
kk7ds
Owner
|
||
|
||
radio.pipe.write(b'F') | ||
|
||
|
@@ -85,9 +86,11 @@ def do_download(radio): | |
if raddr != addr: | ||
raise errors.RadioError('Radio send address %04x, expected %04x' % | ||
(raddr, addr)) | ||
reset(radio) | ||
if rlen != 0x40 or len(block) != 0x40: | ||
raise errors.RadioError('Radio sent %02x (%02x) bytes, ' | ||
'expected %02x' % (rlen, len(block), 0x40)) | ||
reset(radio) | ||
|
||
data += block | ||
|
||
|
@@ -119,10 +122,13 @@ def do_upload(radio): | |
ack = radio.pipe.read(1) | ||
if ack != b'\x06': | ||
raise errors.RadioError('Radio refused block at addr %04x' % addr) | ||
reset(radio) | ||
|
||
s.cur = addr | ||
radio.status_fn(s) | ||
|
||
reset(radio) | ||
|
||
|
||
BASE_FORMAT = """ | ||
struct { | ||
|
this and the other calls to reset(radio) after raising an exception won't be executed