From df808be8d741b8920d09a92671ddce7712b4f519 Mon Sep 17 00:00:00 2001 From: Georgii Surkov <37121527+gsurkov@users.noreply.github.com> Date: Thu, 8 Dec 2022 12:31:22 +0300 Subject: [PATCH] [FL-3003] Fix logical error in storage script (#2105) * Fix logical error in storage script * Fix formatting --- scripts/flipper/storage.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/flipper/storage.py b/scripts/flipper/storage.py index 6b53f747..9c9f5295 100644 --- a/scripts/flipper/storage.py +++ b/scripts/flipper/storage.py @@ -238,9 +238,9 @@ class FlipperStorage: while read_size < size: self.read.until("Ready?" + self.CLI_EOL) self.send("y") - read_size = min(size - read_size, buffer_size) - filedata.extend(self.port.read(read_size)) - read_size = read_size + read_size + chunk_size = min(size - read_size, buffer_size) + filedata.extend(self.port.read(chunk_size)) + read_size = read_size + chunk_size percent = str(math.ceil(read_size / size * 100)) total_chunks = str(math.ceil(size / buffer_size))