diff --git a/src/opentx.cpp b/src/opentx.cpp index eac4236dd..4df6fe855 100644 --- a/src/opentx.cpp +++ b/src/opentx.cpp @@ -383,7 +383,7 @@ void generalDefault() uint16_t evalChkSum() { uint16_t sum=0; - for (int i=0; i= 4) { - eeWriteBlockCmp((uint8_t *)buffer, (sector-4)*512, 512); + const EeFs * test = (const EeFs *)buffer; + if (test->version==EEFS_VERS && test->mySize==sizeof(eeFs) && test->bs==BS) { + offset = sector; + } + if (offset && sector >= offset) { + eeWriteBlockCmp((uint8_t *)buffer, (sector-offset)*512, 512); } buffer += 512; sector++; count--; + if (sector-offset+1==EESIZE/512) + offset = 0; } return 0 ; }