Skip to content

Commit

Permalink
dfu: fix small writes
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruce Wayne committed May 24, 2023
1 parent 2da9b8d commit 00c2689
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/usb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 00c2689

Please sign in to comment.