Skip to content

Commit

Permalink
ga510.py: add 'reset' after clone error and upload
Browse files Browse the repository at this point in the history
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
KC9HI committed Jul 18, 2023
1 parent 4f39ef1 commit f674414
Showing 1 changed file with 6 additions and 0 deletions.
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

0 comments on commit f674414

Please sign in to comment.