Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ga510.py: add 'reset' after clone error and upload #733

Merged
merged 1 commit into from
Jul 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions chirp/drivers/ga510.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

radio.pipe.write(b'F')

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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 {
Expand Down
Loading