mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-12 12:57:13 +02:00
wip
This commit is contained in:
@ -230,7 +230,7 @@ int writeToFlash(FILE *flashfd, FILE *srcfd, char *mess) {
|
|||||||
if (buffer == NULL) {
|
if (buffer == NULL) {
|
||||||
fclose(flashfd);
|
fclose(flashfd);
|
||||||
fclose(srcfd);
|
fclose(srcfd);
|
||||||
strcpy(mess, "Could not program foga. Memory allocation to write to "
|
strcpy(mess, "Could not program fpga. Memory allocation to write to "
|
||||||
"flash failed.\n");
|
"flash failed.\n");
|
||||||
LOG(logERROR, (mess));
|
LOG(logERROR, (mess));
|
||||||
return FAIL;
|
return FAIL;
|
||||||
@ -243,6 +243,7 @@ int writeToFlash(FILE *flashfd, FILE *srcfd, char *mess) {
|
|||||||
fwrite((void *)buffer, sizeof(char), bytes, flashfd);
|
fwrite((void *)buffer, sizeof(char), bytes, flashfd);
|
||||||
totalBytes += bytesWritten;
|
totalBytes += bytesWritten;
|
||||||
if (bytesWritten != bytes) {
|
if (bytesWritten != bytes) {
|
||||||
|
free(buffer);
|
||||||
fclose(flashfd);
|
fclose(flashfd);
|
||||||
fclose(srcfd);
|
fclose(srcfd);
|
||||||
sprintf(mess,
|
sprintf(mess,
|
||||||
@ -257,6 +258,7 @@ int writeToFlash(FILE *flashfd, FILE *srcfd, char *mess) {
|
|||||||
printf(".");
|
printf(".");
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
free(buffer);
|
||||||
fclose(flashfd);
|
fclose(flashfd);
|
||||||
fclose(srcfd);
|
fclose(srcfd);
|
||||||
LOG(logINFO, ("\tWrote %ld bytes to flash\n", totalBytes));
|
LOG(logINFO, ("\tWrote %ld bytes to flash\n", totalBytes));
|
||||||
|
Reference in New Issue
Block a user