From 7f5c73543cf0b5566f49079c0b1704b48e682ad6 Mon Sep 17 00:00:00 2001 From: cfif Date: Wed, 3 Jun 2026 11:24:41 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BF=D0=BB=D0=B0=D1=82=D1=8B=20=D0=BD?= =?UTF-8?q?=D0=B0=20V2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CanUds.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/CanUds.c b/CanUds.c index 89bcb63..8fa17bc 100644 --- a/CanUds.c +++ b/CanUds.c @@ -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 {