diff --git a/imageflasher.py b/imageflasher.py index 790d46b..d92709f 100755 --- a/imageflasher.py +++ b/imageflasher.py @@ -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: