Skip to content

Commit

Permalink
Fix #24: Display an error when radio is in programming mode
Browse files Browse the repository at this point in the history
  • Loading branch information
egzumer committed Jan 14, 2024
1 parent 0936df5 commit 3fdac80
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion uvk5_egzumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,8 @@ def _sayhello(serport):
if tries == 0:
LOG.warning("Failed to initialise radio")
raise errors.RadioError("Failed to initialize radio")
if o.startswith(b'\x18\x05'):
raise errors.RadioError("Radio is in programming mode, restart radio into normal mode")
firmware = _getstring(o, 4, 24)

LOG.info("Found firmware: %s" % firmware)
Expand Down Expand Up @@ -678,7 +680,7 @@ def do_download(radio):
if f:
radio.FIRMWARE_VERSION = f
else:
return False
raise errors.RadioError("Failed to initialize radio")

addr = 0
while addr < MEM_SIZE:
Expand Down

0 comments on commit 3fdac80

Please sign in to comment.