mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-05-07 05:10:03 +02:00
wip
This commit is contained in:
parent
bd5f85cdff
commit
32317510ad
@ -258,8 +258,17 @@ int verifyChecksumFromFlash(char *mess, char *clientChecksum, char *fname,
|
|||||||
// the first time, extra bytes are read
|
// the first time, extra bytes are read
|
||||||
ssize_t totalBytesRead = bytes - 1;
|
ssize_t totalBytesRead = bytes - 1;
|
||||||
char lastByte = buf[0];
|
char lastByte = buf[0];
|
||||||
// bytes = 128
|
int oldProgress = 0;
|
||||||
|
|
||||||
while (bytes > 0) {
|
while (bytes > 0) {
|
||||||
|
|
||||||
|
int progress = (int)(((double)(totalBytesRead) / fsize) * 100);
|
||||||
|
if (oldProgress != progress) {
|
||||||
|
printf("%d%%\r", progress);
|
||||||
|
fflush(stdout);
|
||||||
|
oldProgress = progress;
|
||||||
|
}
|
||||||
|
|
||||||
buf[0] = lastByte;
|
buf[0] = lastByte;
|
||||||
// shift by 4 bits to the left
|
// shift by 4 bits to the left
|
||||||
for (int i = 0; i < bytes; ++i) {
|
for (int i = 0; i < bytes; ++i) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user