This commit is contained in:
maliakal_d 2021-09-03 17:34:28 +02:00
parent a718d69368
commit f1b31100db
2 changed files with 7 additions and 11 deletions

View File

@ -3725,14 +3725,6 @@ int program_fpga(int file_des) {
LOG(logDEBUG1, LOG(logDEBUG1,
("Program size is: %lld\n", (long long unsigned int)filesize)); ("Program size is: %lld\n", (long long unsigned int)filesize));
// checksum
uint16_t checksum = 0;
if (receiveData(file_des, &checksum, sizeof(filesize), INT32) < 0)
return printSocketReadError();
LOG(logINFOBLUE,
("checksum: %d\n", checksum));
// open file and allocate memory for part program // open file and allocate memory for part program
FILE *fd = NULL; FILE *fd = NULL;
ret = startCopyingFPGAProgram(&fd, filesize, mess); ret = startCopyingFPGAProgram(&fd, filesize, mess);

View File

@ -1323,11 +1323,15 @@ std::vector<char> DetectorImpl::readProgrammingFile(const std::string &fname,
} }
} }
// Swap bits from source and write to dest // Swap bits from source and write to dest
int oldProgress = 0;
while (!feof(src)) { while (!feof(src)) {
// print progress // print progress
printf("%d%%\r", (int)(((double)(dstFilePos) / srcSize) * 100)); int progress = (int)(((double)(dstFilePos) / srcSize) * 100);
if (oldProgress != progress) {
printf("%d%%\r", );
fflush(stdout); fflush(stdout);
oldProgress = progress;
}
// pof: exit early to discard footer // pof: exit early to discard footer
if (isPof && dstFilePos >= pofFooterOfst) { if (isPof && dstFilePos >= pofFooterOfst) {
break; break;