Skip to content

Commit

Permalink
[bugfix] BF3/BEC2 kann nun aus bf2-File mit SM6300 Support erstellt w…
Browse files Browse the repository at this point in the history
…erden

TS-678
  • Loading branch information
dominik-zitzmann committed Jun 20, 2024
1 parent aaea267 commit 3b50d0c
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions bec2format/bf3file.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,12 @@ class BF3INTF:

def is_known_tagtype(tagtype):
known_tagtypes = [
(0x34, 0x34), # SM4200 delay
(0x35, 0x38), # SM4200
(0x39, 0x3C), # BLE
(0x3D, 0x3E), # PN5180
(0x40, 0x47), # SM6300
(0x48, 0x48), # SM6300 delay
(0x70, 0x73), # UC_LOADER_V3
(0x83, 0x83), # UC_LOADER_V3_SINGLEBANK
(0x84, 0xA3), # UC_V3
Expand Down Expand Up @@ -698,17 +700,15 @@ def emit_bf3comp():
bf2fileobj.close()
for instr, params in bf2_objs:
if instr == "load":
if bf2_fwdata:
fwtagtype = params[0].fwtagtype
if not is_known_tagtype(fwtagtype):
raise Bf3FileFormatError(
"TagType 0x{:02X} is not recognized by ConfigEditor".format(
fwtagtype
)
)
if fwtagtype in BF2_TAGTYPE_MAP:
emit_bf3comp()
bf2_fwdata = []
fwtagtype = params[0].fwtagtype
if not is_known_tagtype(fwtagtype):
raise Bf3FileFormatError(
"TagType 0x{:02X} is not recognized by ConfigEditor"
.format(fwtagtype))
start_new_tag = fwtagtype in BF2_TAGTYPE_MAP and bf2_fwdata
if start_new_tag:
emit_bf3comp()
bf2_fwdata = []
bf2_fwdata = bf2_fwdata + params
else:
if instr == "CHECK_FWVER" and "CHECK_FWVER" in bf2_instrs:
Expand Down

0 comments on commit 3b50d0c

Please sign in to comment.