Skip to content

Commit f88c749

Browse files
authored
Merge pull request #27 from mafiltenborg/patch-1
Add decoding support for Record Type 4
2 parents 97219bb + fa8c64b commit f88c749

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: adafruit_avrprog.py

+5
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ def _busy_wait(self):
365365

366366

367367
def read_hex_page(file_state, page_addr, page_size, page_buffer):
368+
# pylint: disable=too-many-branches
368369
"""
369370
Helper function that does the Intel Hex parsing. Takes in a dictionary
370371
that contains the file 'state'. The dictionary should have file_state['f']
@@ -420,6 +421,10 @@ def read_hex_page(file_state, page_addr, page_size, page_buffer):
420421
continue
421422
if rec_type == 3: # sometimes appears, we ignore this
422423
continue
424+
if rec_type == 4:
425+
file_state["ext_addr"] = int(line[9:13], 16) << 16
426+
# print("ExtLin addr: %05X" % file_state['ext_addr'])
427+
continue
423428
if rec_type != 0: # if not the above or a data record...
424429
raise RuntimeError(
425430
"Unsupported record type %d on line %d" % (rec_type, file_state["line"])

0 commit comments

Comments
 (0)