From 00c26894876484d2c5a5b63a1c33c28f0f9b15dd Mon Sep 17 00:00:00 2001 From: Bruce Wayne Date: Wed, 24 May 2023 16:23:37 -0700 Subject: [PATCH] dfu: fix small writes --- python/usb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/usb.py b/python/usb.py index 2e236a9999..1487f101bc 100644 --- a/python/usb.py +++ b/python/usb.py @@ -77,7 +77,7 @@ def program(self, address, dat): self._status() # Program - bs = self._mcu_type.config.block_size + bs = min(len(dat), self._mcu_type.config.block_size) dat += b"\xFF" * ((bs - len(dat)) % bs) for i in range(0, len(dat) // bs): ldat = dat[i * bs:(i + 1) * bs]