mirror of
https://github.com/DigitalDevices/dddvb.git
synced 2023-10-10 13:37:43 +02:00
Verify flash after writing
This commit is contained in:
parent
285d7aed49
commit
a7ce2ef8da
@ -510,12 +510,12 @@ static int check_fw(struct ddflash *ddf, char *fn, uint32_t *fw_off)
|
||||
goto out;
|
||||
}
|
||||
} else if (!strcasecmp(key, "Version")) {
|
||||
if (strchr(val,'.')) {
|
||||
int major = 0, minor = 0;
|
||||
sscanf(val,"%d.%d",&major,&minor);
|
||||
version = (major << 16) + minor;
|
||||
} else
|
||||
sscanf(val, "%x", &version);
|
||||
if (strchr(val,'.')) {
|
||||
int major = 0, minor = 0;
|
||||
sscanf(val,"%d.%d",&major,&minor);
|
||||
version = (major << 16) + minor;
|
||||
} else
|
||||
sscanf(val, "%x", &version);
|
||||
} else if (!strcasecmp(key, "Length")) {
|
||||
sscanf(val, "%u", &length);
|
||||
}
|
||||
@ -570,8 +570,13 @@ static int update_image(struct ddflash *ddf, char *fn,
|
||||
if (res < 0)
|
||||
goto out;
|
||||
res = flashwrite(ddf, fs, adr, len, fw_off);
|
||||
if (res == 0)
|
||||
res = 1;
|
||||
if (res == 0) {
|
||||
res = flashcmp(ddf, fs, adr, len, fw_off);
|
||||
if (res == -2) {
|
||||
res = 1
|
||||
}
|
||||
}
|
||||
|
||||
out:
|
||||
close(fs);
|
||||
return res;
|
||||
|
Loading…
Reference in New Issue
Block a user