Обновление платы на V2
This commit is contained in:
parent
d48eedf91f
commit
7f5c73543c
11
CanUds.c
11
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);
|
setResponseErrorPending(env, UDS_RoutineControl, UDS_error_requestCorrectlyReceived_ResponsePending);
|
||||||
|
|
||||||
bool result = false;
|
bool result1 = false;
|
||||||
|
bool result2 = false;
|
||||||
|
|
||||||
|
|
||||||
if (env->udsBlock == UDS_BlockMain) {
|
if (env->udsBlock == UDS_BlockMain) {
|
||||||
env->timeoutPendingClear = SystemGetMs() + 200;
|
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) {
|
if (env->udsBlock == UDS_BlockCalib) {
|
||||||
env->timeoutPendingClear = SystemGetMs() + 200;
|
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);
|
// bool result = FLASHDRIVER_FlashEraseBlock(FLASH_BLOCK_SELECT1);
|
||||||
|
|
||||||
if (result) {
|
if ((result1) || (result2)) {
|
||||||
env->dataResponse[4] =
|
env->dataResponse[4] =
|
||||||
UDS_routine_RoutineStartStopSuccess;
|
UDS_routine_RoutineStartStopSuccess;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue