From 0831911658ca9af41ae4327c4a61bc820bef75bd Mon Sep 17 00:00:00 2001 From: Martin Filtenborg Date: Fri, 5 Nov 2021 13:03:19 +0100 Subject: [PATCH 1/2] Update adafruit_avrprog.py Added support for Record type 4, as described here: https://en.wikipedia.org/wiki/Intel_HEX#Record_types --- adafruit_avrprog.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/adafruit_avrprog.py b/adafruit_avrprog.py index ccd6e12..4eecffa 100644 --- a/adafruit_avrprog.py +++ b/adafruit_avrprog.py @@ -420,6 +420,10 @@ def read_hex_page(file_state, page_addr, page_size, page_buffer): continue if rec_type == 3: # sometimes appears, we ignore this continue + if rec_type == 4: + file_state["ext_addr"] = int(line[9:13], 16) << 16 + #print("ExtLin addr: %05X" % file_state['ext_addr']) + continue if rec_type != 0: # if not the above or a data record... raise RuntimeError( "Unsupported record type %d on line %d" % (rec_type, file_state["line"]) From fa8c64b8b1866aada144dff8065f4c880d06ca60 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Fri, 5 Nov 2021 20:47:37 -0500 Subject: [PATCH 2/2] merge main and code format --- adafruit_avrprog.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/adafruit_avrprog.py b/adafruit_avrprog.py index 7c4550a..0f3f3ae 100644 --- a/adafruit_avrprog.py +++ b/adafruit_avrprog.py @@ -365,6 +365,7 @@ def _busy_wait(self): def read_hex_page(file_state, page_addr, page_size, page_buffer): + # pylint: disable=too-many-branches """ Helper function that does the Intel Hex parsing. Takes in a dictionary that contains the file 'state'. The dictionary should have file_state['f'] @@ -422,7 +423,7 @@ def read_hex_page(file_state, page_addr, page_size, page_buffer): continue if rec_type == 4: file_state["ext_addr"] = int(line[9:13], 16) << 16 - #print("ExtLin addr: %05X" % file_state['ext_addr']) + # print("ExtLin addr: %05X" % file_state['ext_addr']) continue if rec_type != 0: # if not the above or a data record... raise RuntimeError(