Обновление платы на V2

This commit is contained in:
cfif 2026-06-03 11:24:41 +03:00
parent d48eedf91f
commit 7f5c73543c
1 changed files with 7 additions and 4 deletions

View File

@ -1040,22 +1040,25 @@ static uint16_t vUDS_routine_Erase_Memory(tCanUds *env, eUdsRoutineControlType u
setResponseErrorPending(env, UDS_RoutineControl, UDS_error_requestCorrectlyReceived_ResponsePending);
bool result = false;
bool result1 = false;
bool result2 = false;
if (env->udsBlock == UDS_BlockMain) {
env->timeoutPendingClear = SystemGetMs() + 200;
result = env->clear_flash_func(ADR_HEX_Mapped_BlockMain, SIZE_HEX_BlockMain, SendUpdatePendingFlashClear, env);
result1 = env->clear_flash_func(ADR_HEX_Mapped_BlockMain, (SIZE_HEX_BlockMain / 2), SendUpdatePendingFlashClear, env);
setResponseErrorPending(env, UDS_RoutineControl, UDS_error_requestCorrectlyReceived_ResponsePending);
result2 = env->clear_flash_func(ADR_HEX_Mapped_BlockMain + (SIZE_HEX_BlockMain / 2), (SIZE_HEX_BlockMain / 2), SendUpdatePendingFlashClear, env);
}
if (env->udsBlock == UDS_BlockCalib) {
env->timeoutPendingClear = SystemGetMs() + 200;
result = env->clear_flash_func(ADR_HEX_Mapped_BlockCalib, SIZE_HEX_BlockCalib, SendUpdatePendingFlashClear, env);
result1 = env->clear_flash_func(ADR_HEX_Mapped_BlockCalib, SIZE_HEX_BlockCalib, SendUpdatePendingFlashClear, env);
}
// bool result = FLASHDRIVER_FlashEraseBlock(FLASH_BLOCK_SELECT1);
if (result) {
if ((result1) || (result2)) {
env->dataResponse[4] =
UDS_routine_RoutineStartStopSuccess;
} else {