From a48de726bf71c9f8af55a469b738fd8eb37d3533 Mon Sep 17 00:00:00 2001 From: ole00 Date: Sat, 23 Mar 2024 11:01:00 +0000 Subject: [PATCH] PC app: fix progress bar compatibility The proress bar cusros hiding/revealing sequence was not compatible with some Windows versions / shells. This fix removes the escaped sequences and ensures the progress bar is fully printed at the end of each iteration, which prevents the visual artefacts caused by the jumping cursor. --- src_pc/afterburner.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src_pc/afterburner.c b/src_pc/afterburner.c index 1e0a57a..1da16df 100644 --- a/src_pc/afterburner.c +++ b/src_pc/afterburner.c @@ -820,7 +820,6 @@ static char upload() { fuseSet = 0; printf("Uploading fuse map...\n"); - printf("\e[?25l"); for (i = 0; i < totalFuses;) { unsigned char f = 0; if (i % 32 == 0) { @@ -852,9 +851,9 @@ static char upload() { printf("%4d/%4d |", i + 1, totalFuses); int done = ((i + 1) * 40) / totalFuses; printf("%.*s%*s|\r", done, "########################################", 40 - done, ""); + fflush(stdout); //flush the text out so that the animation of the progress bar looks smooth } printf("%4d/%4d |########################################|\n", totalFuses, totalFuses); - printf("\e[?25h"); // send last unfinished fuse line if (fuseSet) {