Обновление
This commit is contained in:
parent
2547f3c83d
commit
d543c67e5f
|
|
@ -57,11 +57,12 @@ xStorageOnFlashFlagchip_DumpOn(
|
|||
return STORAGE_ERR_DEVICE;
|
||||
}
|
||||
|
||||
if (sInternalFlashPage_Write(pageAddress, dataSizeOnFlash, (uint8_t *) &dataCrc, 4) != 4) {
|
||||
uint64_t dataCrc64 = dataCrc;
|
||||
if (sInternalFlashPage_Write(pageAddress, dataSizeOnFlash, (uint8_t *) &dataCrc64, 8) != 8) {
|
||||
return STORAGE_ERR_DEVICE;
|
||||
}
|
||||
|
||||
uint32_t flashCalcCrc = xStorageOnFlashArtery_CrcFlash((uint8_t *) pageAddress, size);
|
||||
uint32_t flashCalcCrc = xStorageOnFlashArtery_CrcFlash((uint8_t *) pageAddress, size );
|
||||
uint32_t flashReedCrc = iInternalFlashPage_ReadWord(pageAddress + dataSizeOnFlash);
|
||||
|
||||
if ((flashCalcCrc == flashReedCrc) && (flashCalcCrc == dataCrc)) {
|
||||
|
|
@ -74,6 +75,9 @@ xStorageOnFlashFlagchip_DumpOn(
|
|||
|
||||
static uint8_t xStorageOnFlashFlagchip_Dump(tStorageOnFlashFlagchip *env, void *data, size_t size) {
|
||||
|
||||
|
||||
size = size - 8;
|
||||
|
||||
uint32_t crc = xStorageOnFlashArtery_Crc(data, size);
|
||||
|
||||
if (xStorageOnFlashFlagchip_DumpOn(env, crc, env->recoveryFlashPageAddress, data, size) != STORAGE_OK) {
|
||||
|
|
@ -90,6 +94,8 @@ static uint8_t xStorageOnFlashFlagchip_Dump(tStorageOnFlashFlagchip *env, void *
|
|||
|
||||
eStorageStatus xStorageOnFlashFlagchip_Load(tStorageOnFlashFlagchip *env, void *data, size_t size) {
|
||||
|
||||
size = size - 8;
|
||||
|
||||
size_t dataSizeOnFlash = size;//(size + 3) & (~3); // выравниваем до кратного 4 (целое количество слов)
|
||||
|
||||
uint32_t recoveryCrcCalc = xStorageOnFlashArtery_CrcFlash((uint8_t *) env->recoveryFlashPageAddress, size);
|
||||
|
|
|
|||
Loading…
Reference in New Issue