summaryrefslogtreecommitdiffstats
path: root/utils/imxtools/scsitools
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2014-02-22 18:12:00 +0100
committerAmaury Pouly <amaury.pouly@gmail.com>2014-02-22 18:12:00 +0100
commit9517bd86b0eeee71679bef3aceeaf8dff5543a66 (patch)
tree1f6690acc93c90bd325d54d25721d5efb4d73e13 /utils/imxtools/scsitools
parent4e1a043cf01dd1358661b951aecaaf0183d5b9bf (diff)
downloadrockbox-9517bd86b0eeee71679bef3aceeaf8dff5543a66.tar.gz
rockbox-9517bd86b0eeee71679bef3aceeaf8dff5543a66.tar.bz2
rockbox-9517bd86b0eeee71679bef3aceeaf8dff5543a66.zip
imxtools/scsitool: add progress indicator
Change-Id: I061ddac4f882156139e38fa6d495fee86271a6aa
Diffstat (limited to 'utils/imxtools/scsitools')
-rw-r--r--utils/imxtools/scsitools/scsitool.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/utils/imxtools/scsitools/scsitool.c b/utils/imxtools/scsitools/scsitool.c
index 131af22dce..a94260b717 100644
--- a/utils/imxtools/scsitools/scsitool.c
+++ b/utils/imxtools/scsitools/scsitool.c
@@ -1068,9 +1068,18 @@ void do_write(const char *file, int want_a_brick)
goto Lend;
}
+ int percent = -1;
for(int off = 0; off < fw_size; off += sector_size)
{
int sec = off / sector_size;
+ int this_percent = (sec * 100) / (fw_size / sector_size);
+ if(this_percent != percent && (this_percent % 5) == 0)
+ {
+ cprintf(RED, "%d%%", this_percent);
+ cprintf(YELLOW, "...");
+ fflush(stdout);
+ }
+ percent = this_percent;
int xfer_len = MIN(fw_size - off, (int)sector_size);
if(fread(sector, xfer_len, 1, f) != 1)
{