Skip to content

Commit d237dee

Browse files
authored
[core] Fix flashing of UF2 parts beginning at zero (#48)
1 parent 04093ce commit d237dee

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

uf2tool/models/context.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,13 @@ def collect_data(self, scheme: OTAScheme) -> Optional[Dict[int, BytesIO]]:
163163
return None
164164

165165
# find BytesIO in the dict
166+
did_append = False
166167
for io_offs, io_data in out.items():
167168
if io_offs + len(io_data.getvalue()) == offs:
168169
io_data.write(data)
169-
offs = 0
170+
did_append = True
170171
break
171-
if offs == 0:
172+
if did_append:
172173
continue
173174

174175
# create BytesIO at specified offset

0 commit comments

Comments
 (0)