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>
pull/6958/head
Damien George 2021-02-23 14:33:31 +11:00
rodzic 53f5bb05a9
commit cdaec0dcaf
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -521,7 +521,7 @@ def write_elements(elements, mass_erase_used, progress=None):
data = elem["data"]
elem_size = size
elem_addr = addr
if progress:
if progress and elem_size:
progress(elem_addr, 0, elem_size)
while size > 0:
write_size = size