minor persist fix

This commit is contained in:
Luxferre
2022-08-12 11:50:59 +03:00
parent d736ab3019
commit 8401e5bbb3
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -308,7 +308,7 @@ ushort crc16(const uchar* data_p, uchar length) {
ushort persistOp(FILE *pfd, ushort maddr, ushort dataLen, ushort adl, ushort adh, uchar isWrite) {
ushort status = 0, proc;
if(pfd) {
fseek(pfd, ((adh&0x7fffu) << 15) | adl, SEEK_SET);
fseek(pfd, ((unsigned long) adh << 16) | adl, SEEK_SET);
if(isWrite) /* writing to the persistent area from the memory */
proc = (ushort) fwrite(&flatram[maddr], 1, dataLen, pfd);
else /* reading from the persistent area into the memory */