Skip to content

Commit

Permalink
Fix fail with very small images
Browse files Browse the repository at this point in the history
  • Loading branch information
penn5 committed May 23, 2019
1 parent 1ab2809 commit 0bbe9e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion imageflasher.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def send_data(self, data, length, address):
length = len(data)
if length == 0 or not isinstance(length, int):
raise FlashException(INVALID_LENGTH)
nframes = length // MAX_DATA_LEN
nframes = length // MAX_DATA_LEN + (1 if length % MAX_DATA_LEN > 0 else 0)
self.send_head_frame(length, address)
n = 0
while length > MAX_DATA_LEN:
Expand Down

0 comments on commit 0bbe9e1

Please sign in to comment.