Добавлено время TDiag
This commit is contained in:
parent
9fcf04ffc8
commit
d9487d672f
|
|
@ -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->logger->loggingCan(env->logger->env, 1, 0, env->canFrame.dlc, env->canFrame.standard_id,
|
||||||
env->canFrame.data, SystemGetMs());
|
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);
|
set_CanSpamReceiver(env, recid);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -618,7 +618,6 @@ lfs_file_t file;
|
||||||
static _Noreturn void ModelTask_Thread(tModelTask *env) {
|
static _Noreturn void ModelTask_Thread(tModelTask *env) {
|
||||||
|
|
||||||
lfs_soff_t lfs_err = lfs_file_open(&fs.lfs, &file, "dtc.bin", LFS_O_RDONLY);
|
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) {
|
if (lfs_err == LFS_ERR_OK) {
|
||||||
|
|
||||||
|
|
@ -904,12 +903,10 @@ static _Noreturn void ModelTask_Thread(tModelTask *env) {
|
||||||
//==============================================DTC===============================================================================================
|
//==============================================DTC===============================================================================================
|
||||||
//==============================================DTC===============================================================================================
|
//==============================================DTC===============================================================================================
|
||||||
|
|
||||||
if (SystemGetMs() > timeDTC) {
|
|
||||||
set_Dtc_state(env->diagnostic, isT15, &env->ccu_candb_tx.CCU_Errors, env->dtc_state_error,
|
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->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->LIN2_ERROR_MISSING, env->LIN3_ERROR_MISSING, env->LIN4_ERROR_MISSING,
|
||||||
env->LIN5_ERROR_MISSING);
|
env->LIN5_ERROR_MISSING);
|
||||||
}
|
|
||||||
//конец--------------------------------------------------ВЫХОД МОДЕЛИ ДЛЯ DTC-------------------------------------------
|
//конец--------------------------------------------------ВЫХОД МОДЕЛИ ДЛЯ DTC-------------------------------------------
|
||||||
|
|
||||||
memcpy(&env->ccu_candb_tx.CCU_Stat1, &rtY.CCU_Stat1_model, sizeof(env->ccu_candb_tx.CCU_Stat1));
|
memcpy(&env->ccu_candb_tx.CCU_Stat1, &rtY.CCU_Stat1_model, sizeof(env->ccu_candb_tx.CCU_Stat1));
|
||||||
|
|
|
||||||
|
|
@ -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));
|
dtc_state_error_model[DTC_BODY_CAN_BUS_OFF] = dtc_state_error[DTC_BODY_CAN_BUS_OFF] & (~(DTC_TEST_FAILED));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
env->tDiagStart = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isT15 == false) {
|
if (isT15 == false) {
|
||||||
|
env->tDiagStart = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (env->tDiagStart == 0) {
|
||||||
|
env->tDiagStart = SystemGetMs() + TDiagStart;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (env->tDiagStart > time) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,8 @@
|
||||||
#define DTC_TEST_CONFIRMED 8
|
#define DTC_TEST_CONFIRMED 8
|
||||||
#define DTC_TEST_FAILED_CONFIRMED (DTC_TEST_FAILED | DTC_TEST_CONFIRMED)
|
#define DTC_TEST_FAILED_CONFIRMED (DTC_TEST_FAILED | DTC_TEST_CONFIRMED)
|
||||||
|
|
||||||
|
#define TDiagStart 500
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint8_t mask;
|
uint8_t mask;
|
||||||
uint8_t *dataResponse;
|
uint8_t *dataResponse;
|
||||||
|
|
@ -26,6 +28,8 @@ typedef struct {
|
||||||
osMutexId_t access;
|
osMutexId_t access;
|
||||||
tLoggerInterface *logger;
|
tLoggerInterface *logger;
|
||||||
|
|
||||||
|
uint32_t tDiagStart;
|
||||||
|
|
||||||
tCanSpamReceiver *canSpamReceiver;
|
tCanSpamReceiver *canSpamReceiver;
|
||||||
|
|
||||||
bool isNoBitsDTC;
|
bool isNoBitsDTC;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue