mirror of
https://github.com/ole00/afterburner.git
synced 2024-06-01 14:41:34 +00:00
PC app: play JTAG file: improved progress bar updates
When the chunk sizes were not power of 2 the progress bar updates were irregular. This change ensures that any upload progress is regularly updated."
This commit is contained in:
parent
ad9308e291
commit
cce891c513
|
@ -1294,6 +1294,7 @@ static int readJtagSerialLine(char* buf, int bufSize, int maxDelay, int* feedReq
|
||||||
static int playJtagFile(char* label, int fSize, int vpp, int showProgress) {
|
static int playJtagFile(char* label, int fSize, int vpp, int showProgress) {
|
||||||
char buf[MAX_LINE] = {0};
|
char buf[MAX_LINE] = {0};
|
||||||
int sendPos = 0;
|
int sendPos = 0;
|
||||||
|
int lastSendPos = 0;
|
||||||
char ready = 0;
|
char ready = 0;
|
||||||
int result = 0;
|
int result = 0;
|
||||||
unsigned int csum = 0;
|
unsigned int csum = 0;
|
||||||
|
@ -1344,7 +1345,8 @@ static int playJtagFile(char* label, int fSize, int vpp, int showProgress) {
|
||||||
int w = serialDeviceWrite(serialF, galbuffer + sendPos, chunkSize);
|
int w = serialDeviceWrite(serialF, galbuffer + sendPos, chunkSize);
|
||||||
sendPos += w;
|
sendPos += w;
|
||||||
// print progress / file position
|
// print progress / file position
|
||||||
if (showProgress && (sendPos % 1024 == 0 || sendPos == fSize)) {
|
if (showProgress && (sendPos - lastSendPos >= 1024 || sendPos == fSize)) {
|
||||||
|
lastSendPos = sendPos;
|
||||||
updateProgressBar(label, sendPos, fSize);
|
updateProgressBar(label, sendPos, fSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user