Обновление

This commit is contained in:
cfif 2026-04-15 16:28:57 +03:00
parent 6b9351f2e2
commit 2a765a4056
1 changed files with 20 additions and 1 deletions

View File

@ -50,7 +50,6 @@ bool P_bInternalFlashPage_Clear(
.wdTriggerFct = (void *) 0
};
FLASHDRIVER_FlashEraseBlock(FLASH_DATA_BLOCK_SELECT0);
tFlashParam.u32Address = pageAddress;
tFlashParam.u32Length = FLASH_PAGE_SIZE;
@ -83,6 +82,24 @@ bool P_bInternalFlashPage_ClearRange(
return false;
}
FLASHDRIVER_Init();
FLASH_DRIVER_ParamType tFlashParam = {
.pData = NULL,
.wdTriggerFct = (void *)0,
.u32Address = firstPageAddr,
.u32Length = totalSize
};
FLASH_StatusType Res = FLASHDRIVER_PFlashEraseSector(&tFlashParam);
bool result = false;
if (FLASH_ERROR_OK == Res) {
result = true;
}
return result;
/*
uint32_t endAddr = firstPageAddr + totalSize;
for (; firstPageAddr < endAddr; firstPageAddr += FLASH_PAGE_SIZE) {
if (!P_bInternalFlashPage_Clear(firstPageAddr)) {
@ -91,6 +108,8 @@ bool P_bInternalFlashPage_ClearRange(
}
return true;
*/
}
bool P_bInternalFlashPage_CopyRange(