diff options
author | Damien George <damien@micropython.org> | 2021-02-23 14:33:31 +1100 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2021-02-23 14:33:31 +1100 |
commit | cdaec0dcaffbfcb58e190738cf6e9d34541464f0 (patch) | |
tree | 87bc625e8a6aec40b36170c6c668f3c160a8d68d /tools/pydfu.py | |
parent | 53f5bb05a9cdf59cc2deaf216c25c0c275e6dce7 (diff) | |
download | micropython-cdaec0dcaffbfcb58e190738cf6e9d34541464f0.tar.gz micropython-cdaec0dcaffbfcb58e190738cf6e9d34541464f0.zip |
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>
Diffstat (limited to 'tools/pydfu.py')
-rwxr-xr-x | tools/pydfu.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/pydfu.py b/tools/pydfu.py index 030f56bf85..42b4fa2da6 100755 --- a/tools/pydfu.py +++ b/tools/pydfu.py @@ -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 |