Добавлено время TDiag

This commit is contained in:
cfif 2026-10-02 14:00:55 +03:00
parent 9fcf04ffc8
commit d9487d672f
4 changed files with 21 additions and 4 deletions

View File

@ -386,7 +386,13 @@ static void ListenCanSpamReceiver(tCanSpamReceiver *env) {
env->logger->loggingCan(env->logger->env, 1, 0, env->canFrame.dlc, env->canFrame.standard_id,
env->canFrame.data, SystemGetMs());
uint32_t recid = ccu_candb_Receive(&ccu_candb_rx, env->canFrame.data, id, env->canFrame.dlc);
uint32_t recid;
if (recv > 0) {
recid = ccu_candb_Receive(&ccu_candb_rx, env->canFrame.data, id, env->canFrame.dlc);
} else {
recid = 0;
}
set_CanSpamReceiver(env, recid);

View File

@ -618,7 +618,6 @@ lfs_file_t file;
static _Noreturn void ModelTask_Thread(tModelTask *env) {
lfs_soff_t lfs_err = lfs_file_open(&fs.lfs, &file, "dtc.bin", LFS_O_RDONLY);
uint32_t timeDTC = SystemGetMs() + 500;
if (lfs_err == LFS_ERR_OK) {
@ -904,12 +903,10 @@ static _Noreturn void ModelTask_Thread(tModelTask *env) {
//==============================================DTC===============================================================================================
//==============================================DTC===============================================================================================
if (SystemGetMs() > timeDTC) {
set_Dtc_state(env->diagnostic, isT15, &env->ccu_candb_tx.CCU_Errors, env->dtc_state_error,
env->GET_HVAC_VIN, &env->CAN_ERROR_MISSING, &env->CAN_TIME_MISSING, env->LIN1_ERROR_MISSING,
env->LIN2_ERROR_MISSING, env->LIN3_ERROR_MISSING, env->LIN4_ERROR_MISSING,
env->LIN5_ERROR_MISSING);
}
//конец--------------------------------------------------ВЫХОД МОДЕЛИ ДЛЯ DTC-------------------------------------------
memcpy(&env->ccu_candb_tx.CCU_Stat1, &rtY.CCU_Stat1_model, sizeof(env->ccu_candb_tx.CCU_Stat1));

View File

@ -371,10 +371,20 @@ setErrorDTC_CAN(tDiagnostic *env, bool isT15, uint8_t *dtc_state_error_model, cc
dtc_state_error_model[DTC_BODY_CAN_BUS_OFF] = dtc_state_error[DTC_BODY_CAN_BUS_OFF] & (~(DTC_TEST_FAILED));
}
env->tDiagStart = 0;
return;
}
if (isT15 == false) {
env->tDiagStart = 0;
return;
}
if (env->tDiagStart == 0) {
env->tDiagStart = SystemGetMs() + TDiagStart;
}
if (env->tDiagStart > time) {
return;
}

View File

@ -17,6 +17,8 @@
#define DTC_TEST_CONFIRMED 8
#define DTC_TEST_FAILED_CONFIRMED (DTC_TEST_FAILED | DTC_TEST_CONFIRMED)
#define TDiagStart 500
typedef struct {
uint8_t mask;
uint8_t *dataResponse;
@ -26,6 +28,8 @@ typedef struct {
osMutexId_t access;
tLoggerInterface *logger;
uint32_t tDiagStart;
tCanSpamReceiver *canSpamReceiver;
bool isNoBitsDTC;