Исправления в диагностике и добавлен 3WayValve
This commit is contained in:
parent
e44a6c8836
commit
2c8c6e17f8
|
|
@ -305,12 +305,6 @@ static void set_CanSpamReceiver(tCanSpamReceiver *env, uint32_t recid) {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
countQueue_ccu_candb_rx = osMessageQueueGetSpace(env->ccu_candb_rx_DW_STATE);
|
||||
if ((countQueue_ccu_candb_rx) && (recid == DW_STATE_CANID)) {
|
||||
status = osMessageQueuePut(env->ccu_candb_rx_DW_STATE, &ccu_candb_rx.DW_STATE, 0, 0U);
|
||||
|
|
@ -318,15 +312,6 @@ static void set_CanSpamReceiver(tCanSpamReceiver *env, uint32_t recid) {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
countQueue_ccu_candb_rx = osMessageQueueGetSpace(env->ccu_candb_rx_LOCAL_HVAC_VIN);
|
||||
|
||||
if ((countQueue_ccu_candb_rx) && (recid == VEH_VIN_CANID)) {
|
||||
|
|
@ -433,6 +418,22 @@ uint32_t getCanTimeReceived(tCanSpamReceiver *env, bool isCan0BusOff, bool isT15
|
|||
return time;
|
||||
}
|
||||
|
||||
|
||||
void isClearDTC_Can(tCanSpamReceiver *env) {
|
||||
if (osMutexAcquire(env->access, 5000) == osOK) {
|
||||
|
||||
for (uint32_t i = 0; i < CAN_MONITOR_COUNT; i++) {
|
||||
FrameMonitor_t *mon = g_can_monitors[i].monitor;
|
||||
mon->last_cycle = env->canTimeReceived;
|
||||
}
|
||||
|
||||
osStatus_t status = osMessageQueueReset(env->ccu_candb_error_missing_rx);
|
||||
|
||||
osMutexRelease(env->access);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void ListenCanSpamReceiver(tCanSpamReceiver *env) {
|
||||
|
||||
uint16_t recv = env->ioCanFrame->receive(env->ioCanFrame->env, PROTOCOL_CAN_RAW, (uint8_t *) &env->canFrame, 1,
|
||||
|
|
@ -502,7 +503,8 @@ void get_CanSpamReceiver(tCanSpamReceiver *env, char *VIN, ccu_candb_error_missi
|
|||
uint32_t countQueue_ccu_candb_rx = osMessageQueueGetSpace(env->ccu_candb_error_missing_rx);
|
||||
if (countQueue_ccu_candb_rx == 0) {
|
||||
status = osMessageQueueGet(env->ccu_candb_error_missing_rx, CAN_ERROR_MISSING, 0, 0U);
|
||||
memcpy(&rtDW.CCUCAN_ccu_candb_error_missing_rx_model, CAN_ERROR_MISSING, sizeof(rtDW.CCUCAN_ccu_candb_error_missing_rx_model));
|
||||
memcpy(&rtDW.CCUCAN_ccu_candb_error_missing_rx_model, CAN_ERROR_MISSING,
|
||||
sizeof(rtDW.CCUCAN_ccu_candb_error_missing_rx_model));
|
||||
}
|
||||
|
||||
countQueue_ccu_candb_rx = osMessageQueueGetSpace(env->ccu_candb_time_missing_rx);
|
||||
|
|
@ -593,8 +595,6 @@ void get_CanSpamReceiver(tCanSpamReceiver *env, char *VIN, ccu_candb_error_missi
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
countQueue_ccu_candb_rx = osMessageQueueGetSpace(env->ccu_candb_rx_TM_CP);
|
||||
if (countQueue_ccu_candb_rx == 0) {
|
||||
status = osMessageQueueGet(env->ccu_candb_rx_TM_CP, &rtDW.TM_CP_model, 0, 0U);
|
||||
|
|
@ -668,17 +668,12 @@ void get_CanSpamReceiver(tCanSpamReceiver *env, char *VIN, ccu_candb_error_missi
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
countQueue_ccu_candb_rx = osMessageQueueGetSpace(env->ccu_candb_rx_DW_STATE);
|
||||
if (countQueue_ccu_candb_rx == 0) {
|
||||
status = osMessageQueueGet(env->ccu_candb_rx_DW_STATE, &rtDW.CCUCAN_DW_STATE_model, 0, 0U);
|
||||
}
|
||||
|
||||
|
||||
|
||||
countQueue_ccu_candb_rx = osMessageQueueGetSpace(env->ccu_candb_rx_LOCAL_HVAC_VIN);
|
||||
if (countQueue_ccu_candb_rx == 0) {
|
||||
status = osMessageQueueGet(env->ccu_candb_rx_LOCAL_HVAC_VIN, VIN, 0, 0U);
|
||||
|
|
|
|||
|
|
@ -122,4 +122,6 @@ bool get_is_NoNull_CanSpam_BCM_PowerTrain_Receiver(tCanSpamReceiver *env);
|
|||
|
||||
uint32_t getCanTimeReceived(tCanSpamReceiver *env, bool isCan0BusOff, bool isT15);
|
||||
|
||||
void isClearDTC_Can(tCanSpamReceiver *env);
|
||||
|
||||
#endif //HVAC_CAN_SPAM_RECEIVER_H
|
||||
|
|
|
|||
|
|
@ -25,6 +25,18 @@ const uint8_t LIN5_SENSON_ADR_Stat[LIN5_SENSOR_COUNT] = {DRS_DL_Stat,
|
|||
DRS_FCL_Stat,
|
||||
DRS_FCR_Stat};
|
||||
|
||||
const uint8_t LIN4_SENSON_ADR_Stat[LIN4_SENSOR_COUNT] = {AirQS_Stat,
|
||||
Aroma_Stat,
|
||||
Ionizer_Stat,
|
||||
TheeWayValveStat};
|
||||
|
||||
const uint8_t LIN4_SENSON_LEN_Stat[LIN4_SENSOR_COUNT] = {sizeof(tAirQS_Stat),
|
||||
sizeof(tAroma_Stat),
|
||||
sizeof(tIonizer_Stat),
|
||||
sizeof(tThreeWayValve_Stat)};
|
||||
|
||||
|
||||
/*
|
||||
const uint8_t LIN4_SENSON_ADR_Stat[LIN4_SENSOR_COUNT] = {AirQS_Stat,
|
||||
Aroma_Stat,
|
||||
Ionizer_Stat,
|
||||
|
|
@ -33,6 +45,7 @@ const uint8_t LIN4_SENSON_ADR_Stat[LIN4_SENSOR_COUNT] = {AirQS_Stat,
|
|||
eTXV_batChiller_Stat,
|
||||
eTXV_eeChiller_Stat};
|
||||
|
||||
|
||||
const uint8_t LIN4_SENSON_LEN_Stat[LIN4_SENSOR_COUNT] = {sizeof(tAirQS_Stat),
|
||||
sizeof(tAroma_Stat),
|
||||
sizeof(tIonizer_Stat),
|
||||
|
|
@ -40,6 +53,7 @@ const uint8_t LIN4_SENSON_LEN_Stat[LIN4_SENSOR_COUNT] = {sizeof(tAirQS_Stat),
|
|||
sizeof(teTXV_rHVAC_Stat),
|
||||
sizeof(teTXV_batChiller_Stat),
|
||||
sizeof(teTXV_eeChiller_Stat)};
|
||||
*/
|
||||
|
||||
static lin_event_id_t SEND_SENSOR_COM_x(tLinIO *linIo, uint8_t COM_ADR) {
|
||||
lin_event_id_t res = linIo->runCommand(linIo->env, COM_ADR, 30);
|
||||
|
|
@ -73,6 +87,31 @@ static lin_event_id_t Set_CCU_Req(tLinIO *linIo, tLinData *linData, tCCU_Req *p_
|
|||
return res;
|
||||
}
|
||||
|
||||
static lin_event_id_t Set_TheeWayValve_Req(tLinIO *linIo, tLinData *linData, tThreeWayValve_Req *p_ThreeWayValve_Req) {
|
||||
lin_event_id_t res;
|
||||
|
||||
linData->direction = LIN_DIRECTION_SET;
|
||||
|
||||
linData->g_aTxBufferLen = sizeof(tThreeWayValve_Req);
|
||||
linData->g_aRxBufferLen = 0;
|
||||
|
||||
memcpy(linData->g_aTxBuffer, p_ThreeWayValve_Req, sizeof(tThreeWayValve_Req));
|
||||
|
||||
uint8_t retry = 1;
|
||||
|
||||
while (retry) {
|
||||
|
||||
res = SEND_SENSOR_COM_x(linIo, CCU_TheeWayValve_Req);
|
||||
|
||||
if (res == LIN_TX_COMPLETED) {
|
||||
break;
|
||||
}
|
||||
|
||||
--retry;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
static lin_event_id_t
|
||||
Get_Sensor4_Stat(tLinIO *linIo, tLinData *linData, void *p_Stat, uint8_t p_Stat_Len, uint8_t ADR_stat) {
|
||||
|
|
@ -133,7 +172,7 @@ void Lin4_Output_Set_Model(tLin4TaskSensor *env) {
|
|||
env->Ionizer_Stat_For_Model.Ionizer_LinRespErr_Stat = pIonizer_Stat->Ionizer_LinRespErr_Stat;
|
||||
env->Ionizer_Stat_For_Model.Ionizer_Err_Stat = pIonizer_Stat->Ionizer_Err_Stat;
|
||||
env->Ionizer_Stat_For_Model.Ionizer_Ionization_Stat = pIonizer_Stat->Ionizer_Ionization_Stat;
|
||||
|
||||
/*
|
||||
teTXV_fHVAC_Stat *p_teTXV_fHVAC_Stat = (teTXV_fHVAC_Stat *) &env->Stat[3];
|
||||
env->eTXV_fHVAC_Stat_For_Model.eTXV_fHVAC_Pos_Stat = p_teTXV_fHVAC_Stat->eTXV_fHVAC_Pos_Stat;
|
||||
env->eTXV_fHVAC_Stat_For_Model.eTXV_fHVAC_LinRespErr_Stat = p_teTXV_fHVAC_Stat->eTXV_fHVAC_LinRespErr_Stat;
|
||||
|
|
@ -162,8 +201,36 @@ void Lin4_Output_Set_Model(tLin4TaskSensor *env) {
|
|||
env->eTXV_eeChiller_Stat_For_Model.eTXV_eeChiller_Err_Stat = p_teTXV_eeChiller_Stat->eTXV_eeChiller_Err_Stat;
|
||||
env->eTXV_eeChiller_Stat_For_Model.eTXV_eeChiller_Pressure_Val = p_teTXV_eeChiller_Stat->eTXV_eeChiller_Pressure_Val;
|
||||
env->eTXV_eeChiller_Stat_For_Model.eTXV_eeChiller_Temp_Val = p_teTXV_eeChiller_Stat->eTXV_eeChiller_Temp_Val;
|
||||
*/
|
||||
|
||||
tThreeWayValve_Stat *p_ThreeWayValve_Stat = (tThreeWayValve_Stat *) &env->Stat[3];
|
||||
env->ThreeWayValve_Stat_For_Model.State_CurrentMode = p_ThreeWayValve_Stat->State_CurrentMode;
|
||||
env->ThreeWayValve_Stat_For_Model.State_Move = p_ThreeWayValve_Stat->State_Move;
|
||||
env->ThreeWayValve_Stat_For_Model.State_SelfCheck = p_ThreeWayValve_Stat->State_SelfCheck;
|
||||
env->ThreeWayValve_Stat_For_Model.Require_SelfCheck = p_ThreeWayValve_Stat->Require_SelfCheck;
|
||||
env->ThreeWayValve_Stat_For_Model.Err_Blockage = p_ThreeWayValve_Stat->Err_Blockage;
|
||||
env->ThreeWayValve_Stat_For_Model.Err_UnderVoltage = p_ThreeWayValve_Stat->Err_UnderVoltage;
|
||||
env->ThreeWayValve_Stat_For_Model.Err_OverVoltage = p_ThreeWayValve_Stat->Err_OverVoltage;
|
||||
env->ThreeWayValve_Stat_For_Model.Err_OverTemperature = p_ThreeWayValve_Stat->Err_OverTemperature;
|
||||
env->ThreeWayValve_Stat_For_Model.Err_ChangeMode_OverTime = p_ThreeWayValve_Stat->Err_ChangeMode_OverTime;
|
||||
env->ThreeWayValve_Stat_For_Model.Err_OverHallNumber = p_ThreeWayValve_Stat->Err_OverHallNumber;
|
||||
env->ThreeWayValve_Stat_For_Model.Hall_Pulse = p_ThreeWayValve_Stat->Hall_Pulse;
|
||||
env->ThreeWayValve_Stat_For_Model.Voltage = p_ThreeWayValve_Stat->Voltage;
|
||||
env->ThreeWayValve_Stat_For_Model.Current = p_ThreeWayValve_Stat->Current;
|
||||
env->ThreeWayValve_Stat_For_Model.NAMI_SWVer = p_ThreeWayValve_Stat->NAMI_SWVer;
|
||||
env->ThreeWayValve_Stat_For_Model.NAMI_HWVer = p_ThreeWayValve_Stat->NAMI_HWVer;
|
||||
|
||||
|
||||
//memcpy(env->sensorLin4CmdBusInput.in_error_connect, env->error_connect, LIN4_SENSOR_COUNT);
|
||||
env->sensorLin4CmdBusInput.in_error_connect[0] = env->error_connect[0]; // AirQS_Stat
|
||||
env->sensorLin4CmdBusInput.in_error_connect[1] = env->error_connect[1]; // Aroma_Stat
|
||||
env->sensorLin4CmdBusInput.in_error_connect[2] = env->error_connect[2]; // Ionizer_Stat
|
||||
env->sensorLin4CmdBusInput.in_error_connect[3] = 0; // TXV_fHVAC
|
||||
env->sensorLin4CmdBusInput.in_error_connect[4] = 0; // TXV_rHVAC
|
||||
env->sensorLin4CmdBusInput.in_error_connect[5] = 0; // TXV_batChiller
|
||||
env->sensorLin4CmdBusInput.in_error_connect[6] = 0; // TXV_eeChiller
|
||||
env->sensorLin4CmdBusInput.in_error_connect[7] = env->error_connect[3]; // TheeWayValve
|
||||
|
||||
memcpy(env->sensorLin4CmdBusInput.in_error_connect, env->error_connect, LIN4_SENSOR_COUNT);
|
||||
env->sensorLin4CmdBusInput.Error_Connect = env->error_all_connect;
|
||||
|
||||
osStatus_t status = osOK;
|
||||
|
|
@ -208,6 +275,11 @@ void Lin4_Output_Set_Model(tLin4TaskSensor *env) {
|
|||
status = osMessageQueuePut(env->queue_input_Lin4_Stat, &env->sensorLin4CmdBusInput, 0, 0);
|
||||
}
|
||||
|
||||
countQueue_space = osMessageQueueGetSpace(env->queue_input_ThreeWayValve);
|
||||
if (countQueue_space) {
|
||||
status = osMessageQueuePut(env->queue_input_ThreeWayValve, &env->ThreeWayValve_Stat_For_Model, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
countQueue_space = osMessageQueueGetSpace(env->queue_error_missing);
|
||||
if (countQueue_space) {
|
||||
|
|
@ -227,7 +299,8 @@ void Lin4_Output_Get_From_Model(tLin4TaskSensor *env, uint8_t *MISSING) {
|
|||
|
||||
countQueue_space = osMessageQueueGetSpace(env->queue_input_Lin4_Stat);
|
||||
if (countQueue_space == 0) {
|
||||
status = osMessageQueueGet(env->queue_input_Lin4_Stat, &env->sensorLin4CmdBusInput, 0, 0);
|
||||
//cfif
|
||||
// status = osMessageQueueGet(env->queue_input_Lin4_Stat, &rtDW.LIN4_ERROR_model, 0, 0);
|
||||
}
|
||||
|
||||
countQueue_space = osMessageQueueGetSpace(env->queue_input_tAroma);
|
||||
|
|
@ -243,7 +316,16 @@ void Lin4_Output_Get_From_Model(tLin4TaskSensor *env, uint8_t *MISSING) {
|
|||
countQueue_space = osMessageQueueGetSpace(env->queue_error_missing);
|
||||
if (countQueue_space == 0) {
|
||||
status = osMessageQueueGet(env->queue_error_missing, MISSING, 0, 0);
|
||||
memcpy((void *) &rtDW.CCUCAN_LIN4_ERROR_MISSING_model, MISSING, sizeof(rtDW.CCUCAN_LIN4_ERROR_MISSING_model));
|
||||
|
||||
rtDW.CCUCAN_LIN4_ERROR_MISSING_model.LIN4_ERROR_MISSING_AirQS = env->error_connect[0]; // AirQS_Stat
|
||||
rtDW.CCUCAN_LIN4_ERROR_MISSING_model.LIN4_ERROR_MISSING_Aroma = env->error_connect[1]; // Aroma_Stat
|
||||
rtDW.CCUCAN_LIN4_ERROR_MISSING_model.LIN4_ERROR_MISSING_Ionizer = env->error_connect[2]; // Ionizer_Stat
|
||||
rtDW.CCUCAN_LIN4_ERROR_MISSING_model.LIN4_ERROR_MISSING_eTXV_fHVAC = 1;
|
||||
rtDW.CCUCAN_LIN4_ERROR_MISSING_model.LIN4_ERROR_MISSING_eTXV_rHVAC = 1;
|
||||
rtDW.CCUCAN_LIN4_ERROR_MISSING_model.LIN4_ERROR_MISSING_eTXV_batChiller = 1;
|
||||
rtDW.CCUCAN_LIN4_ERROR_MISSING_model.LIN4_ERROR_MISSING_eTXV_eeChiller = 1;
|
||||
|
||||
//memcpy((void *) &rtDW.CCUCAN_LIN4_ERROR_MISSING_model, MISSING, sizeof(rtDW.CCUCAN_LIN4_ERROR_MISSING_model));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -296,6 +378,17 @@ static lin_event_id_t Lin4_Scheduler(tLin4TaskSensor *env) {
|
|||
}
|
||||
#endif
|
||||
|
||||
|
||||
ret = Set_TheeWayValve_Req(env->linIo, env->linData, &env->d_ThreeWayValve_Req);
|
||||
|
||||
#if (LOG_LIN4_SENSOR == 1)
|
||||
if (ret == LIN_TX_COMPLETED) {
|
||||
LoggerFormatInfo(LOGGER, LOG_SIGN4, "OK Set_TheeWayValve_Req = %d", ret)
|
||||
} else {
|
||||
LoggerFormatInfo(LOGGER, LOG_SIGN4, "ERROR Set_TheeWayValve_Req = %d", ret)
|
||||
}
|
||||
#endif
|
||||
|
||||
SystemDelayMs(40);
|
||||
|
||||
for (uint8_t i = 0; i < LIN4_SENSOR_COUNT; ++i) {
|
||||
|
|
@ -354,6 +447,31 @@ static lin_event_id_t Lin4_Scheduler(tLin4TaskSensor *env) {
|
|||
|
||||
break;
|
||||
}
|
||||
|
||||
case eeTheeWayValve_Stat: {
|
||||
tThreeWayValve_Stat *p_tThreeWayValve_Stat = (tThreeWayValve_Stat *) &env->Stat[i];
|
||||
|
||||
LoggerFormatInfo(LOGGER, LOG_SIGN4,
|
||||
"State_CurrentMode = %d State_Move = %d State_SelfCheck = %d Require_SelfCheck = %d Err_Blockage = %d Err_UnderVoltage = %d Err_OverVoltage = %d Err_ChangeMode_OverTime = %d Err_OverHallNumber = %d Hall_Pulse = %d State_Move = %d Voltage = %d Current = %d NAMI_SWVer = %d NAMI_HWVer = %d",
|
||||
p_tThreeWayValve_Stat->State_CurrentMode,
|
||||
p_tThreeWayValve_Stat->State_Move,
|
||||
p_tThreeWayValve_Stat->State_SelfCheck,
|
||||
p_tThreeWayValve_Stat->Require_SelfCheck,
|
||||
p_tThreeWayValve_Stat->Err_Blockage,
|
||||
p_tThreeWayValve_Stat->Err_UnderVoltage,
|
||||
p_tThreeWayValve_Stat->Err_OverVoltage,
|
||||
p_tThreeWayValve_Stat->Err_OverTemperature,
|
||||
p_tThreeWayValve_Stat->Err_ChangeMode_OverTime,
|
||||
p_tThreeWayValve_Stat->Err_OverHallNumber,
|
||||
p_tThreeWayValve_Stat->Hall_Pulse,
|
||||
p_tThreeWayValve_Stat->Voltage,
|
||||
p_tThreeWayValve_Stat->Current,
|
||||
p_tThreeWayValve_Stat->NAMI_SWVer,
|
||||
p_tThreeWayValve_Stat->NAMI_HWVer)
|
||||
|
||||
break;
|
||||
}
|
||||
/*
|
||||
case eeTXV_fHVAC_Stat: {
|
||||
teTXV_fHVAC_Stat *p_teTXV_fHVAC_Stat = (teTXV_fHVAC_Stat *) &env->Stat[i];
|
||||
|
||||
|
|
@ -415,6 +533,7 @@ static lin_event_id_t Lin4_Scheduler(tLin4TaskSensor *env) {
|
|||
|
||||
break;
|
||||
}
|
||||
*/
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
|
|
@ -445,6 +564,15 @@ static lin_event_id_t Lin4_Scheduler(tLin4TaskSensor *env) {
|
|||
|
||||
break;
|
||||
}
|
||||
|
||||
case eeTheeWayValve_Stat: {
|
||||
tThreeWayValve_Stat *p_tThreeWayValve_Stat = (tThreeWayValve_Stat *) &env->Stat[i];
|
||||
|
||||
LoggerFormatInfo(LOGGER, LOG_SIGN4, "LIN4 ERROR (p_tThreeWayValve_Stat) = %d", ret)
|
||||
|
||||
break;
|
||||
}
|
||||
/*
|
||||
case eeTXV_fHVAC_Stat: {
|
||||
teTXV_fHVAC_Stat *p_teTXV_fHVAC_Stat = (teTXV_fHVAC_Stat *) &env->Stat[i];
|
||||
|
||||
|
|
@ -476,6 +604,7 @@ static lin_event_id_t Lin4_Scheduler(tLin4TaskSensor *env) {
|
|||
|
||||
break;
|
||||
}
|
||||
*/
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
@ -506,6 +635,11 @@ void Lin_4_Init(tLin4TaskSensor *env,
|
|||
env->queue_input_teTXV_rHVAC = osMessageQueueNew(1, sizeof(LIN4_eTXV_rHVAC_Stat_Bus), NULL);
|
||||
env->queue_input_teTXV_batChiller = osMessageQueueNew(1, sizeof(LIN4_eTXV_batChiller_Stat_Bus), NULL);
|
||||
env->queue_input_teTXV_eeChiller = osMessageQueueNew(1, sizeof(LIN4_eTXV_eeChiller_Stat_Bus), NULL);
|
||||
|
||||
//cfif
|
||||
env->queue_input_ThreeWayValve = osMessageQueueNew(1, sizeof(tThreeWayValve_Stat_model), NULL);
|
||||
|
||||
|
||||
env->queue_input_Lin4_Stat = osMessageQueueNew(1, sizeof(SensorLin4CmdBusInput), NULL);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,93 @@
|
|||
#define LOG_LIN4_SENSOR 0
|
||||
#define LOG_LIN5_SENSOR 0
|
||||
|
||||
#define LIN4_SENSOR_COUNT 4
|
||||
#define LIN4_SENSOR_MODEL_COUNT 8
|
||||
|
||||
|
||||
/*
|
||||
typedef enum {
|
||||
eeAirQS_Stat = 0,
|
||||
eeAroma_Stat = 1,
|
||||
eeIonizer_Stat = 2,
|
||||
eeTXV_fHVAC_Stat = 3,
|
||||
eeTXV_rHVAC_Stat = 4,
|
||||
eeTXV_batChiller_Stat = 5,
|
||||
eeTXV_eeChiller_Stat = 6
|
||||
} eSensorStat4;
|
||||
*/
|
||||
typedef enum {
|
||||
eeAirQS_Stat = 0,
|
||||
eeAroma_Stat = 1,
|
||||
eeIonizer_Stat = 2,
|
||||
eeTheeWayValve_Stat = 3,
|
||||
} eSensorStat4;
|
||||
|
||||
#define CCU_Req 0x1
|
||||
#define CCU_TheeWayValve_Req 0xB
|
||||
#define AirQS_Stat 0x14
|
||||
#define Aroma_Stat 0x5
|
||||
#define Ionizer_Stat 0x1C
|
||||
#define TheeWayValveStat 0x0E
|
||||
|
||||
|
||||
typedef struct __attribute__ ((packed)) {
|
||||
uint16_t Reserve1: 12; // 0
|
||||
uint8_t ECU_Ctrl_Motor_Test: 2; // 12
|
||||
uint8_t ECU_Ctrl_Check: 1; // 14
|
||||
uint8_t ECU_Ctrl_Production_Test: 1; // 15
|
||||
uint8_t Reserve2: 8; // 16
|
||||
uint8_t ECU_Ctrl_TargetMode: 8; // 24
|
||||
} tThreeWayValve_Req;
|
||||
|
||||
typedef struct __attribute__ ((packed)) {
|
||||
uint8_t State_CurrentMode: 8; // 0
|
||||
uint8_t State_Move: 1; // 8
|
||||
uint8_t Reserve1: 1; // 9
|
||||
uint8_t State_SelfCheck: 1; // 10
|
||||
uint8_t Require_SelfCheck: 1; // 11
|
||||
uint8_t Err_Blockage: 1; // 12
|
||||
uint8_t Err_UnderVoltage: 1; // 13
|
||||
uint8_t Err_OverVoltage: 1; // 14
|
||||
uint8_t Err_OverTemperature: 1; // 15
|
||||
uint8_t Err_ChangeMode_OverTime: 1; // 16
|
||||
uint8_t Err_OverHallNumber: 1; // 17
|
||||
uint8_t Reserve2: 6; // 18
|
||||
uint16_t Hall_Pulse: 16; // 24
|
||||
uint8_t Voltage: 8; // 40
|
||||
uint8_t Current: 8; // 48
|
||||
uint8_t NAMI_SWVer: 4; // 56
|
||||
uint8_t NAMI_HWVer: 4; // 60
|
||||
} tThreeWayValve_Stat;
|
||||
|
||||
typedef struct __attribute__ ((packed)) {
|
||||
uint8_t State_CurrentMode;
|
||||
uint8_t State_Move;
|
||||
uint8_t State_SelfCheck;
|
||||
uint8_t Require_SelfCheck;
|
||||
uint8_t Err_Blockage;
|
||||
uint8_t Err_UnderVoltage;
|
||||
uint8_t Err_OverVoltage;
|
||||
uint8_t Err_OverTemperature;
|
||||
uint8_t Err_ChangeMode_OverTime;
|
||||
uint8_t Err_OverHallNumber;
|
||||
uint16_t Hall_Pulse;
|
||||
uint8_t Voltage;
|
||||
uint8_t Current;
|
||||
uint8_t NAMI_SWVer;
|
||||
uint8_t NAMI_HWVer;
|
||||
} tThreeWayValve_Stat_model;
|
||||
|
||||
typedef struct __attribute__ ((packed)) {
|
||||
uint16_t Reserve1: 12; // 0
|
||||
uint8_t ECU_Ctrl_Motor_Test: 2; // 12
|
||||
uint8_t ECU_Ctrl_Check: 1; // 14
|
||||
uint8_t ECU_Ctrl_Production_Test: 1; // 15
|
||||
uint8_t Reserve2: 8; // 16
|
||||
uint8_t ECU_Ctrl_TargetMode: 8; // 24
|
||||
} tThreeWayValve_Req_model;
|
||||
|
||||
/*
|
||||
#define LIN4_SENSOR_COUNT 7
|
||||
|
||||
typedef enum {
|
||||
|
|
@ -35,6 +121,7 @@ typedef enum {
|
|||
#define eTXV_rHVAC_Stat 0x20
|
||||
#define eTXV_batChiller_Stat 0x22
|
||||
#define eTXV_eeChiller_Stat 0x24
|
||||
*/
|
||||
|
||||
#define LIN5_SENSOR_COUNT 8
|
||||
|
||||
|
|
@ -292,7 +379,7 @@ typedef struct __attribute__ ((packed)) {
|
|||
} tDRS_RRB_Stat;
|
||||
|
||||
typedef struct {
|
||||
uint8_t in_error_connect[LIN4_SENSOR_COUNT]; // Конкретное устройство не ответило
|
||||
uint8_t in_error_connect[LIN4_SENSOR_MODEL_COUNT]; // Конкретное устройство не ответило
|
||||
uint8_t Error_Connect; // Ошибка LIN шины (ни одно устройство не отвечает)
|
||||
} SensorLin4CmdBusInput;
|
||||
|
||||
|
|
@ -305,6 +392,7 @@ typedef struct {
|
|||
|
||||
tLoggerInterface *logger;
|
||||
|
||||
tThreeWayValve_Req d_ThreeWayValve_Req;
|
||||
tCCU_Req d_CCU_Req;
|
||||
uint64_t Stat[LIN4_SENSOR_COUNT];
|
||||
|
||||
|
|
@ -325,6 +413,9 @@ typedef struct {
|
|||
//teTXV_eeChiller_Stat_For_Model eTXV_eeChiller_Stat_For_Model;
|
||||
LIN4_eTXV_eeChiller_Stat_Bus eTXV_eeChiller_Stat_For_Model;
|
||||
|
||||
// cfif
|
||||
tThreeWayValve_Stat_model ThreeWayValve_Stat_For_Model;
|
||||
|
||||
SensorLin4CmdBusInput sensorLin4CmdBusInput;
|
||||
|
||||
|
||||
|
|
@ -339,6 +430,7 @@ typedef struct {
|
|||
osMessageQueueId_t queue_input_teTXV_rHVAC;
|
||||
osMessageQueueId_t queue_input_teTXV_batChiller;
|
||||
osMessageQueueId_t queue_input_teTXV_eeChiller;
|
||||
osMessageQueueId_t queue_input_ThreeWayValve;
|
||||
osMessageQueueId_t queue_input_Lin4_Stat;
|
||||
|
||||
uint8_t error_connect[LIN4_SENSOR_COUNT];
|
||||
|
|
|
|||
|
|
@ -1063,7 +1063,18 @@ static _Noreturn void ModelTask_Thread(tModelTask *env) {
|
|||
env->diagnostic->state.LIN4_ERROR_MISSING = env->LIN4_ERROR_MISSING;
|
||||
env->diagnostic->state.LIN5_ERROR_MISSING = env->LIN5_ERROR_MISSING;
|
||||
|
||||
set_Dtc_state(env->diagnostic);
|
||||
bool isClearDTC = set_Dtc_state(env->diagnostic);
|
||||
|
||||
if (isClearDTC) {
|
||||
memset(&env->CAN_ERROR_MISSING, 0, sizeof(env->CAN_ERROR_MISSING));
|
||||
memset(env->LIN1_ERROR_MISSING, 0, sizeof(env->LIN1_ERROR_MISSING));
|
||||
memset(env->LIN2_ERROR_MISSING, 0, sizeof(env->LIN2_ERROR_MISSING));
|
||||
memset(env->LIN3_ERROR_MISSING, 0, sizeof(env->LIN3_ERROR_MISSING));
|
||||
memset(env->LIN4_ERROR_MISSING, 0, sizeof(env->LIN4_ERROR_MISSING));
|
||||
memset(env->LIN5_ERROR_MISSING, 0, sizeof(env->LIN5_ERROR_MISSING));
|
||||
isClearDTC_Can(env->canSpamReceiver);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -565,12 +565,33 @@ setErrorDTC_LIN(tDiagnostic *env) {
|
|||
}
|
||||
}
|
||||
|
||||
for (uint8_t i = 0; i < 7; ++i) {
|
||||
if (env->state.LIN4_ERROR_MISSING[i]) {
|
||||
env->state.dtc_state_error_model[i + 117] = DTC_TEST_FAILED_CONFIRMED;
|
||||
// for (uint8_t i = 0; i < 7; ++i) {
|
||||
// if (env->state.LIN4_ERROR_MISSING[i]) {
|
||||
// env->state.dtc_state_error_model[i + 117] = DTC_TEST_FAILED_CONFIRMED;
|
||||
// } else {
|
||||
// env->state.dtc_state_error_model[i + 117] = dtc_state_error[i + 117] & (~(DTC_TEST_FAILED));
|
||||
// }
|
||||
// }
|
||||
|
||||
// AirQS
|
||||
if (env->state.LIN4_ERROR_MISSING[0]) {
|
||||
env->state.dtc_state_error_model[DTC_LOST_COMM_AIR_QUALITY_SENSOR] = DTC_TEST_FAILED_CONFIRMED;
|
||||
} else {
|
||||
env->state.dtc_state_error_model[i + 117] = dtc_state_error[i + 117] & (~(DTC_TEST_FAILED));
|
||||
env->state.dtc_state_error_model[DTC_LOST_COMM_AIR_QUALITY_SENSOR] = dtc_state_error[DTC_LOST_COMM_AIR_QUALITY_SENSOR] & (~(DTC_TEST_FAILED));
|
||||
}
|
||||
|
||||
// Aroma_Stat
|
||||
if (env->state.LIN4_ERROR_MISSING[1]) {
|
||||
env->state.dtc_state_error_model[DTC_LOST_COMM_AROMATIZATION] = DTC_TEST_FAILED_CONFIRMED;
|
||||
} else {
|
||||
env->state.dtc_state_error_model[DTC_LOST_COMM_AROMATIZATION] = dtc_state_error[DTC_LOST_COMM_AROMATIZATION] & (~(DTC_TEST_FAILED));
|
||||
}
|
||||
|
||||
// Ionizer
|
||||
if (env->state.LIN4_ERROR_MISSING[2]) {
|
||||
env->state.dtc_state_error_model[DTC_LOST_COMM_IONIZER] = DTC_TEST_FAILED_CONFIRMED;
|
||||
} else {
|
||||
env->state.dtc_state_error_model[DTC_LOST_COMM_IONIZER] = dtc_state_error[DTC_LOST_COMM_IONIZER] & (~(DTC_TEST_FAILED));
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -676,7 +697,8 @@ static void setDtcWithDebounce_V(tDiagnostic *env, uint8_t index, uint8_t raw,
|
|||
}
|
||||
}
|
||||
|
||||
void set_Dtc_state(tDiagnostic *env) {
|
||||
|
||||
bool set_Dtc_state(tDiagnostic *env) {
|
||||
|
||||
if (osMutexAcquire(env->access, 5000) == osOK) {
|
||||
|
||||
|
|
@ -684,11 +706,16 @@ void set_Dtc_state(tDiagnostic *env) {
|
|||
env->isCleanDTC = false;
|
||||
memset(dtc_state_FIX_error, 0, sizeof(dtc_state_FIX_error));
|
||||
memset(dtc_state_error, 0, sizeof(dtc_state_error));
|
||||
memset(env->state.dtc_state_error_model, 0, COUNT_DTC_CODE_ERROR);
|
||||
|
||||
osMutexRelease(env->access);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (env->isNoBitsDTC == true) {
|
||||
|
||||
osMutexRelease(env->access);
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
// начало--------------От модели-------------------------------------------------------
|
||||
|
|
@ -700,7 +727,7 @@ void set_Dtc_state(tDiagnostic *env) {
|
|||
}
|
||||
}
|
||||
|
||||
for (uint8_t i = 52; i < 79; ++i) {
|
||||
for (uint8_t i = 50; i < 79; ++i) {
|
||||
if (env->state.dtc_state_error_model[i]) {
|
||||
env->state.dtc_state_error_model[i] = DTC_TEST_FAILED_CONFIRMED;
|
||||
} else {
|
||||
|
|
@ -720,7 +747,6 @@ void set_Dtc_state(tDiagnostic *env) {
|
|||
env->state.P_IGN,
|
||||
&env->state.dtc_aux_debounce[DEB_IONIZER_OPEN], env->state.now_ms);
|
||||
|
||||
|
||||
if (memcmp(dtc_state_error, env->state.dtc_state_error_model, sizeof(dtc_state_error)) != 0) {
|
||||
|
||||
bool isDTC_FileWrite = false;
|
||||
|
|
@ -790,5 +816,7 @@ void set_Dtc_state(tDiagnostic *env) {
|
|||
} else {
|
||||
LoggerErrorStatic(LOGGER, LOG_SIGN, "Access error set_Dtc_state_error");
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ void Diagnostic_Init(tDiagnostic *env,
|
|||
|
||||
void set_NoBitsDTC(tDiagnostic *env, bool noBitsDTC);
|
||||
|
||||
void set_Dtc_state(tDiagnostic *env);
|
||||
bool set_Dtc_state(tDiagnostic *env);
|
||||
|
||||
uint32_t diagnostic_ClearDiagnosticInformation_14(tDiagnostic *env);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue