tools/pydfu.py: Support DFU files with elements of zero size.
Instead of raising a ZeroDivisionError, this tool now just skips any elements in the DFU file that have zero size. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
parent
53f5bb05a9
commit
cdaec0dcaf
|
@ -521,7 +521,7 @@ def write_elements(elements, mass_erase_used, progress=None):
|
||||||
data = elem["data"]
|
data = elem["data"]
|
||||||
elem_size = size
|
elem_size = size
|
||||||
elem_addr = addr
|
elem_addr = addr
|
||||||
if progress:
|
if progress and elem_size:
|
||||||
progress(elem_addr, 0, elem_size)
|
progress(elem_addr, 0, elem_size)
|
||||||
while size > 0:
|
while size > 0:
|
||||||
write_size = size
|
write_size = size
|
||||||
|
|
Loading…
Reference in New Issue