1
0
mirror of https://github.com/DigitalDevices/dddvb.git synced 2023-10-10 13:37:43 +02:00

flen was not defined yet, so move after assignment

This commit is contained in:
internal 2023-07-31 21:29:44 +02:00
parent 48d9945769
commit 847aa3c044

View File

@ -630,13 +630,14 @@ int flashwrite_pagemode(struct ddflash *ddf, int dev, uint32_t FlashOffset,
uint8_t cmd[260];
int i, j;
uint32_t flen, blen;
int blockerase = be && ((FlashOffset & 0xFFFF) == 0 ) && (flen >= 0x10000);
int blockerase;
blen = flen = lseek(dev, 0, SEEK_END) - fw_off;
if (blen % 0xff)
blen = (blen + 0xff) & 0xffffff00;
//printf("blen = %u, flen = %u\n", blen, flen);
setbuf(stdout, NULL);
blockerase = be && ((FlashOffset & 0xFFFF) == 0 ) && (flen >= 0x10000);
cmd[0] = 0x50; // EWSR
err = flashio(ddf->fd, ddf->link, cmd, 1, NULL, 0);