pre-commit: autoupdate hooks (#1639)

* Update pre-commit hook versions

* fix

---------

Co-authored-by: adeebshihadeh <adeebshihadeh@users.noreply.github.com>
This commit is contained in:
Adeeb Shihadeh
2023-09-07 19:10:30 -07:00
committed by GitHub
parent ee21517c77
commit d87d33cb51
6 changed files with 14 additions and 14 deletions

View File

@@ -78,7 +78,7 @@ class STBootloaderUSBHandle(BaseSTBootloaderHandle):
# Program
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):
for i in range(len(dat) // bs):
ldat = dat[i * bs:(i + 1) * bs]
print("programming %d with length %d" % (i, len(ldat)))
self._libusb_handle.controlWrite(0x21, self.DFU_DNLOAD, 2 + i, 0, ldat)