|
|
|
|
@ -12,7 +12,7 @@
|
|
|
|
|
#include "lfs.h"
|
|
|
|
|
#include "LittleFsInterface.h"
|
|
|
|
|
#include "StatusError.h"
|
|
|
|
|
#include "VIN_DATA.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define LOG_SIGN "ModelTask"
|
|
|
|
|
#define LOGGER env->logger
|
|
|
|
|
@ -611,35 +611,14 @@ void InitWakeupModel(tModelTask *env) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
volatile bool isUpdateVinDataModel = false;
|
|
|
|
|
|
|
|
|
|
uint8_t getVehicleTypeArmoredFromVin(tModelTask *env, const char* vin) {
|
|
|
|
|
|
|
|
|
|
env->isVinArmored = 0;
|
|
|
|
|
|
|
|
|
|
// Преобразуем два байта в 16-битное значение
|
|
|
|
|
uint16_t typeCode = ((uint16_t)(uint8_t)vin[3] << 8) | (uint8_t)vin[4];
|
|
|
|
|
|
|
|
|
|
// Определяем Vehicle TYPE по коду
|
|
|
|
|
switch (typeCode) {
|
|
|
|
|
case VEHICLE_SEDAN_ARMORED:
|
|
|
|
|
case VEHICLE_SEDAN_LONG_ARMORED:
|
|
|
|
|
case VEHICLE_LIMO_ARMORED_V12:
|
|
|
|
|
case VEHICLE_LIMO_ARMORED_V8:
|
|
|
|
|
case VEHICLE_LIMO_ARMORED_V8_CIVIL:
|
|
|
|
|
case VEHICLE_SUV_ARMORED:
|
|
|
|
|
case VEHICLE_MPV_ARMORED_8SEAT:
|
|
|
|
|
case VEHICLE_MPV_ARMORED_9SEAT:
|
|
|
|
|
case VEHICLE_MPV_ARMORED_4SEAT:
|
|
|
|
|
env->isVinArmored = 1;
|
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
return 0; // Неизвестный тип
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void updateVinDataModel(tModelTask *env, const char *vin) {
|
|
|
|
|
isUpdateVinDataModel = false;
|
|
|
|
|
env->VIN_BodyTypeBodyArmored = getVehicleTypeBodyArmoredFromVin(vin);
|
|
|
|
|
env->VIN_EngineType = getEngineTypeFromVin(vin);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
volatile bool isSendingCAN = true;
|
|
|
|
|
|
|
|
|
|
#define SLEEP_TIME 5000
|
|
|
|
|
@ -683,18 +662,24 @@ static _Noreturn void ModelTask_Thread(tModelTask *env) {
|
|
|
|
|
|
|
|
|
|
if (osMutexAcquire(env->access, 1000) == osOK) {
|
|
|
|
|
|
|
|
|
|
if (isUpdateVinDataModel) {
|
|
|
|
|
updateVinDataModel(env, env->canUds->deviceStorage->dataParam->device.identification.Vehicle_Identification);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//LoggerFormatError(LOGGER, LOG_SIGN, "Step END = %d", SystemGetMs())
|
|
|
|
|
|
|
|
|
|
rtDW.t_now = SystemGetMs();
|
|
|
|
|
|
|
|
|
|
//начало--------------------------------------------------ВХОД МОДЕЛИ ADC----------------------------------------------
|
|
|
|
|
getCmdBusADCData(env->adc0Task, &rtDW.ADC_Data_Model);
|
|
|
|
|
getCmdBusADC2Data(env->adc1Task,(CmdBusADC2Data *) &rtDW.ADC_Data_Model.VN7008AJ_DIAG_FrontLINActuatorPowerDriverAB);
|
|
|
|
|
getCmdBusADC2Data(env->adc1Task,
|
|
|
|
|
(CmdBusADC2Data *) &rtDW.ADC_Data_Model.VN7008AJ_DIAG_FrontLINActuatorPowerDriverAB);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// rtDW.ADC_Data_Model.PBATT_CHECK = 1400;
|
|
|
|
|
uint16_t PBATT_CHECK_16 = (uint16_t) (((float)rtDW.ADC_Data_Model.PBATT_CHECK * 33.4375f / 4095.0f) * 10.0f);
|
|
|
|
|
uint16_t IGN_CHECK_16 = (uint16_t) (((float)rtDW.ADC_Data_Model.IGN_ANS * 27.75f / 4095.0f) * 10.0f);
|
|
|
|
|
uint16_t PBATT_CHECK_16 = (uint16_t) (((float) rtDW.ADC_Data_Model.PBATT_CHECK * 33.4375f / 4095.0f) *
|
|
|
|
|
10.0f);
|
|
|
|
|
uint16_t IGN_CHECK_16 = (uint16_t) (((float) rtDW.ADC_Data_Model.IGN_ANS * 27.75f / 4095.0f) * 10.0f);
|
|
|
|
|
|
|
|
|
|
// if ((PBATT_CHECK_16 >= V_SEND_LOW) && (PBATT_CHECK_16 <= V_SEND_HIGH)) {
|
|
|
|
|
// isSendingCAN = true;
|
|
|
|
|
@ -707,7 +692,8 @@ static _Noreturn void ModelTask_Thread(tModelTask *env) {
|
|
|
|
|
rtDW.ADC_Key_Data_Model.EmergencyAirCleanSwitch = GpioPinGet(&env->gpios->EmergencyAirCleanSwitch);
|
|
|
|
|
rtDW.ADC_Key_Data_Model.FireExtinguishSwitch = GpioPinGet(&env->gpios->FireExtinguishSwitch);
|
|
|
|
|
|
|
|
|
|
memcpy((void *) &rtDW.CCUCAN_tStatus_CCU_Configuration_model, (void *) &statusData.ecu.Status_CCU_Configuration, sizeof(tStatus_CCU_Configuration_Bus));
|
|
|
|
|
memcpy((void *) &rtDW.CCUCAN_tStatus_CCU_Configuration_model,
|
|
|
|
|
(void *) &statusData.ecu.Status_CCU_Configuration, sizeof(tStatus_CCU_Configuration_Bus));
|
|
|
|
|
//начало--------------------------------------------------ВХОД МОДЕЛИ НАСТРОЙКИ----------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -732,7 +718,8 @@ static _Noreturn void ModelTask_Thread(tModelTask *env) {
|
|
|
|
|
//конец--------------------------------------------------ВХОД МОДЕЛИ CAN DBG--------------------------------------------
|
|
|
|
|
|
|
|
|
|
//начало--------------------------------------------------ВХОД МОДЕЛИ CAN-----------------------------------------------
|
|
|
|
|
get_CanSpamReceiver(env->canSpamReceiver, env->GET_HVAC_VIN, &env->CAN_ERROR_MISSING, &env->CAN_TIME_MISSING);
|
|
|
|
|
get_CanSpamReceiver(env->canSpamReceiver, env->GET_HVAC_VIN, &env->CAN_ERROR_MISSING,
|
|
|
|
|
&env->CAN_TIME_MISSING);
|
|
|
|
|
|
|
|
|
|
// Если был захват в UDS (подмена)
|
|
|
|
|
if (model_Status_Set_For_Model_output.EMS == 1) {
|
|
|
|
|
@ -757,9 +744,12 @@ static _Noreturn void ModelTask_Thread(tModelTask *env) {
|
|
|
|
|
|
|
|
|
|
//начало-------------------------------------------------ВХОД МОДЕЛИ SlEEP----------------------------------------------
|
|
|
|
|
|
|
|
|
|
memcpy((void *) &rtDW.CCU_STAT1_WAKEUP_MODEL, (void *) &CCU_STAT1_MODEL_SAVE, sizeof(CmdCAN_CCU_STAT1_WakeUp_Bus));
|
|
|
|
|
memcpy((void *) &rtDW.CCU_STAT2_WAKEUP_MODEL, (void *) &CCU_STAT2_MODEL_SAVE, sizeof(CmdCAN_CCU_STAT2_WakeUp_Bus));
|
|
|
|
|
memcpy((void *) &rtDW.CCU_STAT3_WAKEUP_MODEL, (void *) &CCU_STAT3_MODEL_SAVE, sizeof(CmdCAN_CCU_STAT3_WakeUp_Bus));
|
|
|
|
|
memcpy((void *) &rtDW.CCU_STAT1_WAKEUP_MODEL, (void *) &CCU_STAT1_MODEL_SAVE,
|
|
|
|
|
sizeof(CmdCAN_CCU_STAT1_WakeUp_Bus));
|
|
|
|
|
memcpy((void *) &rtDW.CCU_STAT2_WAKEUP_MODEL, (void *) &CCU_STAT2_MODEL_SAVE,
|
|
|
|
|
sizeof(CmdCAN_CCU_STAT2_WakeUp_Bus));
|
|
|
|
|
memcpy((void *) &rtDW.CCU_STAT3_WAKEUP_MODEL, (void *) &CCU_STAT3_MODEL_SAVE,
|
|
|
|
|
sizeof(CmdCAN_CCU_STAT3_WakeUp_Bus));
|
|
|
|
|
memcpy((void *) &rtDW.CCU_Msg1_WakeUp_model, (void *) &CCU_MSG1_MODEL_SAVE, sizeof(CCU_Msg1_WakeUp_Bus));
|
|
|
|
|
|
|
|
|
|
//конец--------------------------------------------------ВХОД МОДЕЛИ SLEEP----------------------------------------------
|
|
|
|
|
@ -820,19 +810,27 @@ static _Noreturn void ModelTask_Thread(tModelTask *env) {
|
|
|
|
|
|
|
|
|
|
Lin5_Output_Get_From_Model(env->lin5TaskSensor, env->LIN5_ERROR_MISSING);
|
|
|
|
|
|
|
|
|
|
if (((rtDW.LIN5_SENSON_ADR_Stat_model.Err_Stat[0] == 1) || (rtDW.LIN5_SENSON_ADR_Stat_model.Err_Stat[1] == 1) ||
|
|
|
|
|
(rtDW.LIN5_SENSON_ADR_Stat_model.Err_Stat[2] == 1) || (rtDW.LIN5_SENSON_ADR_Stat_model.Err_Stat[3] == 1)) ||
|
|
|
|
|
((rtDW.LIN5_SENSON_ADR_Stat_model.LinRespErr_Stat[0] == 1) || (rtDW.LIN5_SENSON_ADR_Stat_model.LinRespErr_Stat[1] == 1) ||
|
|
|
|
|
(rtDW.LIN5_SENSON_ADR_Stat_model.LinRespErr_Stat[2] == 1) || (rtDW.LIN5_SENSON_ADR_Stat_model.LinRespErr_Stat[3] == 1))) {
|
|
|
|
|
if (((rtDW.LIN5_SENSON_ADR_Stat_model.Err_Stat[0] == 1) ||
|
|
|
|
|
(rtDW.LIN5_SENSON_ADR_Stat_model.Err_Stat[1] == 1) ||
|
|
|
|
|
(rtDW.LIN5_SENSON_ADR_Stat_model.Err_Stat[2] == 1) ||
|
|
|
|
|
(rtDW.LIN5_SENSON_ADR_Stat_model.Err_Stat[3] == 1)) ||
|
|
|
|
|
((rtDW.LIN5_SENSON_ADR_Stat_model.LinRespErr_Stat[0] == 1) ||
|
|
|
|
|
(rtDW.LIN5_SENSON_ADR_Stat_model.LinRespErr_Stat[1] == 1) ||
|
|
|
|
|
(rtDW.LIN5_SENSON_ADR_Stat_model.LinRespErr_Stat[2] == 1) ||
|
|
|
|
|
(rtDW.LIN5_SENSON_ADR_Stat_model.LinRespErr_Stat[3] == 1))) {
|
|
|
|
|
env->diagnostic->state.d_DTC_DRS_FRONT_ZONE_MALFUNCTION = 1;
|
|
|
|
|
} else {
|
|
|
|
|
env->diagnostic->state.d_DTC_DRS_FRONT_ZONE_MALFUNCTION = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (((rtDW.LIN5_SENSON_ADR_Stat_model.Err_Stat[4] == 1) || (rtDW.LIN5_SENSON_ADR_Stat_model.Err_Stat[5] == 1) ||
|
|
|
|
|
(rtDW.LIN5_SENSON_ADR_Stat_model.Err_Stat[6] == 1) || (rtDW.LIN5_SENSON_ADR_Stat_model.Err_Stat[7] == 1)) ||
|
|
|
|
|
((rtDW.LIN5_SENSON_ADR_Stat_model.LinRespErr_Stat[4] == 1) || (rtDW.LIN5_SENSON_ADR_Stat_model.LinRespErr_Stat[5] == 1) ||
|
|
|
|
|
(rtDW.LIN5_SENSON_ADR_Stat_model.LinRespErr_Stat[6] == 1) || (rtDW.LIN5_SENSON_ADR_Stat_model.LinRespErr_Stat[7] == 1))) {
|
|
|
|
|
if (((rtDW.LIN5_SENSON_ADR_Stat_model.Err_Stat[4] == 1) ||
|
|
|
|
|
(rtDW.LIN5_SENSON_ADR_Stat_model.Err_Stat[5] == 1) ||
|
|
|
|
|
(rtDW.LIN5_SENSON_ADR_Stat_model.Err_Stat[6] == 1) ||
|
|
|
|
|
(rtDW.LIN5_SENSON_ADR_Stat_model.Err_Stat[7] == 1)) ||
|
|
|
|
|
((rtDW.LIN5_SENSON_ADR_Stat_model.LinRespErr_Stat[4] == 1) ||
|
|
|
|
|
(rtDW.LIN5_SENSON_ADR_Stat_model.LinRespErr_Stat[5] == 1) ||
|
|
|
|
|
(rtDW.LIN5_SENSON_ADR_Stat_model.LinRespErr_Stat[6] == 1) ||
|
|
|
|
|
(rtDW.LIN5_SENSON_ADR_Stat_model.LinRespErr_Stat[7] == 1))) {
|
|
|
|
|
env->diagnostic->state.d_DTC_DRS_REAR_ZONE_MALFUNCTION = 1;
|
|
|
|
|
} else {
|
|
|
|
|
env->diagnostic->state.d_DTC_DRS_REAR_ZONE_MALFUNCTION = 0;
|
|
|
|
|
@ -946,23 +944,28 @@ static _Noreturn void ModelTask_Thread(tModelTask *env) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GpioPinSet(&env->gpios->power.BTS5180_2EKA_TwoWayValveAndReservePowerSupply.TwoWayValve_EN,env->TwoWayValve_EN);
|
|
|
|
|
GpioPinSet(&env->gpios->power.BTS5180_2EKA_TwoWayValveAndReservePowerSupply.TwoWayValve_EN,
|
|
|
|
|
env->TwoWayValve_EN);
|
|
|
|
|
GpioPinSet(&env->gpios->power.BTS5180_2EKA_TwoWayValveAndReservePowerSupply.TwoWayValve_EN_Diag, true);
|
|
|
|
|
GpioPinSet(&env->gpios->power.BTS5180_2EKA_TwoWayValveAndReservePowerSupply.ReservePower_EN,rtY.PowerEnable_Model.ReservePower_EN);
|
|
|
|
|
GpioPinSet(&env->gpios->power.BTS5180_2EKA_TwoWayValveAndReservePowerSupply.ReservePower_EN,
|
|
|
|
|
rtY.PowerEnable_Model.ReservePower_EN);
|
|
|
|
|
|
|
|
|
|
GpioPinSet(&env->gpios->power.BTS4175SGAXUMA1_ShutOFFValveBatteryChiller.EN_BATTChiller,env->EN_BATTChiller);
|
|
|
|
|
GpioPinSet(&env->gpios->power.BTS4175SGAXUMA1_ShutOFFValveBatteryChiller.EN_BATTChiller,
|
|
|
|
|
env->EN_BATTChiller);
|
|
|
|
|
|
|
|
|
|
GpioPinSet(&env->gpios->power.BTS5180_2EKA_FrontRearIncarMotor.Incar_Motor_Front_EN,env->Incar_Motor_Front_EN);
|
|
|
|
|
GpioPinSet(&env->gpios->power.BTS5180_2EKA_FrontRearIncarMotor.Incar_Motor_Front_EN,
|
|
|
|
|
env->Incar_Motor_Front_EN);
|
|
|
|
|
GpioPinSet(&env->gpios->power.BTS5180_2EKA_FrontRearIncarMotor.Incar_EN_Diag, true);
|
|
|
|
|
GpioPinSet(&env->gpios->power.BTS5180_2EKA_FrontRearIncarMotor.Incar_Motor_Rear_EN,env->Incar_Motor_Rear_EN);
|
|
|
|
|
GpioPinSet(&env->gpios->power.BTS5180_2EKA_FrontRearIncarMotor.Incar_Motor_Rear_EN,
|
|
|
|
|
env->Incar_Motor_Rear_EN);
|
|
|
|
|
|
|
|
|
|
GpioPinSet(&env->gpios->power.BTS5180_2EKA_ShutOFFValveFrontRear.ShutOffFront_EN, env->ShutOffFront_EN);
|
|
|
|
|
GpioPinSet(&env->gpios->power.BTS5180_2EKA_ShutOFFValveFrontRear.ShutOff_EN_Diag, true);
|
|
|
|
|
GpioPinSet(&env->gpios->power.BTS5180_2EKA_ShutOFFValveFrontRear.ShutOffRear_EN, env->ShutOffRear_EN);
|
|
|
|
|
|
|
|
|
|
GpioPinSet(&env->gpios->power.BTS5180_2EKA_2xChannelPTCPower.PtcRelayDriver1_EN,env->PtcRelayDriver1_EN);
|
|
|
|
|
GpioPinSet(&env->gpios->power.BTS5180_2EKA_2xChannelPTCPower.PtcRelayDriver1_EN, env->PtcRelayDriver1_EN);
|
|
|
|
|
GpioPinSet(&env->gpios->power.BTS5180_2EKA_2xChannelPTCPower.PtcRelayDriver_EN_Diag, true);
|
|
|
|
|
GpioPinSet(&env->gpios->power.BTS5180_2EKA_2xChannelPTCPower.PtcRelayDriver2_EN,env->PtcRelayDriver2_EN);
|
|
|
|
|
GpioPinSet(&env->gpios->power.BTS5180_2EKA_2xChannelPTCPower.PtcRelayDriver2_EN, env->PtcRelayDriver2_EN);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Для UDS
|
|
|
|
|
@ -977,17 +980,22 @@ static _Noreturn void ModelTask_Thread(tModelTask *env) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// GpioPinSet(&env->gpios->power.BTS4175SGAXUMA1_ReservePowerOutput.EN_ReservePower, rtY.PowerEnable_Model.EN_ReservePower);
|
|
|
|
|
GpioPinSet(&env->gpios->power.BTS4175SGAXUMA1_PowerReserve.EN_PowerReserve, rtY.PowerEnable_Model.EN_PowerReserve);
|
|
|
|
|
GpioPinSet(&env->gpios->power.BTS4175SGAXUMA1_PowerReserve.EN_PowerReserve,
|
|
|
|
|
rtY.PowerEnable_Model.EN_PowerReserve);
|
|
|
|
|
|
|
|
|
|
GpioPinSet(&env->gpios->power.VN7008AJ_FrontLINActuatorPowerDriverAB.LIN_ActPower_AB, rtY.PowerEnable_Model.LIN_ActPower_AB);
|
|
|
|
|
GpioPinSet(&env->gpios->power.VN7008AJ_FrontLINActuatorPowerDriverAB.LIN_ActPower_AB,
|
|
|
|
|
rtY.PowerEnable_Model.LIN_ActPower_AB);
|
|
|
|
|
GpioPinSet(&env->gpios->power.VN7008AJ_FrontLINActuatorPowerDriverAB.EN_CurrentSensing_AB, true);
|
|
|
|
|
|
|
|
|
|
GpioPinSet(&env->gpios->power.VN7008AJ_RearLINActuatorPowerDriverC.LIN_ActPower_C, rtY.PowerEnable_Model.LIN_ActPower_C);
|
|
|
|
|
GpioPinSet(&env->gpios->power.VN7008AJ_RearLINActuatorPowerDriverC.LIN_ActPower_C,
|
|
|
|
|
rtY.PowerEnable_Model.LIN_ActPower_C);
|
|
|
|
|
GpioPinSet(&env->gpios->power.VN7008AJ_RearLINActuatorPowerDriverC.EN_CurrentSensing_C, true);
|
|
|
|
|
|
|
|
|
|
GpioPinSet(&env->gpios->power.BTS5120_2EKA_ShutoffValvePowerTXV.ShutOffTXV1_EN, rtY.PowerEnable_Model.ShutOffTXV1_EN);
|
|
|
|
|
GpioPinSet(&env->gpios->power.BTS5120_2EKA_ShutoffValvePowerTXV.ShutOffTXV1_EN,
|
|
|
|
|
rtY.PowerEnable_Model.ShutOffTXV1_EN);
|
|
|
|
|
GpioPinSet(&env->gpios->power.BTS5120_2EKA_ShutoffValvePowerTXV.ShutOffTXV_EN_Diag, true);
|
|
|
|
|
GpioPinSet(&env->gpios->power.BTS5120_2EKA_ShutoffValvePowerTXV.ShutOffTXV2_EN, rtY.PowerEnable_Model.ShutOffTXV2_EN);
|
|
|
|
|
GpioPinSet(&env->gpios->power.BTS5120_2EKA_ShutoffValvePowerTXV.ShutOffTXV2_EN,
|
|
|
|
|
rtY.PowerEnable_Model.ShutOffTXV2_EN);
|
|
|
|
|
//конец--------------------------------------------------ВЫХОД МОДЕЛИ ДЛЯ GPIO------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1015,15 +1023,19 @@ static _Noreturn void ModelTask_Thread(tModelTask *env) {
|
|
|
|
|
|
|
|
|
|
env->pwms->pwmFrontIo.setActivePercent(env->pwms->pwmFrontIo.env, Pwm_Front);
|
|
|
|
|
env->pwms->pwmRearIo.setActivePercent(env->pwms->pwmRearIo.env, Pwm_Rear);
|
|
|
|
|
env->pwms->pwmFrontReservedIo.setActivePercent(env->pwms->pwmFrontReservedIo.env, rtY.PWM_Get_out.pwmPercentFrontReserved);
|
|
|
|
|
env->pwms->pwmRearReservedIo.setActivePercent(env->pwms->pwmRearReservedIo.env, rtY.PWM_Get_out.pwmPercentRearReserved);
|
|
|
|
|
env->pwms->pwmFrontReservedIo.setActivePercent(env->pwms->pwmFrontReservedIo.env,
|
|
|
|
|
rtY.PWM_Get_out.pwmPercentFrontReserved);
|
|
|
|
|
env->pwms->pwmRearReservedIo.setActivePercent(env->pwms->pwmRearReservedIo.env,
|
|
|
|
|
rtY.PWM_Get_out.pwmPercentRearReserved);
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
env->pwms->pwmFrontIo.setActivePercent(env->pwms->pwmFrontIo.env, rtY.PWM_Get_out.pwmPercentFront);
|
|
|
|
|
env->pwms->pwmRearIo.setActivePercent(env->pwms->pwmRearIo.env, rtY.PWM_Get_out.pwmPercentRear);
|
|
|
|
|
env->pwms->pwmFrontReservedIo.setActivePercent(env->pwms->pwmFrontReservedIo.env, rtY.PWM_Get_out.pwmPercentFrontReserved);
|
|
|
|
|
env->pwms->pwmRearReservedIo.setActivePercent(env->pwms->pwmRearReservedIo.env,rtY.PWM_Get_out.pwmPercentRearReserved);
|
|
|
|
|
env->pwms->pwmFrontReservedIo.setActivePercent(env->pwms->pwmFrontReservedIo.env,
|
|
|
|
|
rtY.PWM_Get_out.pwmPercentFrontReserved);
|
|
|
|
|
env->pwms->pwmRearReservedIo.setActivePercent(env->pwms->pwmRearReservedIo.env,
|
|
|
|
|
rtY.PWM_Get_out.pwmPercentRearReserved);
|
|
|
|
|
}
|
|
|
|
|
//конец--------------------------------------------------ВЫХОД МОДЕЛИ ДЛЯ PWM-------------------------------------------
|
|
|
|
|
|
|
|
|
|
@ -1043,6 +1055,7 @@ static _Noreturn void ModelTask_Thread(tModelTask *env) {
|
|
|
|
|
//==============================================DTC===============================================================================================
|
|
|
|
|
//==============================================DTC===============================================================================================
|
|
|
|
|
//==============================================DTC===============================================================================================
|
|
|
|
|
|
|
|
|
|
if (env->is_Global_Soft_T15) {
|
|
|
|
|
memcpy(env->dtc_state_error, rtY.dtc_state_error_model, sizeof(env->dtc_state_error));
|
|
|
|
|
|
|
|
|
|
@ -1083,7 +1096,8 @@ static _Noreturn void ModelTask_Thread(tModelTask *env) {
|
|
|
|
|
memcpy(&env->ccu_candb_tx.CCU_Stat1, &rtY.CCU_Stat1_model, sizeof(env->ccu_candb_tx.CCU_Stat1));
|
|
|
|
|
memcpy(&env->ccu_candb_tx.CCU_Stat2, &rtY.CCU_Stat2_model, sizeof(env->ccu_candb_tx.CCU_Stat2));
|
|
|
|
|
memcpy(&env->ccu_candb_tx.CCU_Stat3, &rtY.CCU_Stat3_model, sizeof(env->ccu_candb_tx.CCU_Stat3));
|
|
|
|
|
memcpy(&env->ccu_candb_tx.CCU_HVC_Req_Msg, &rtY.CCUCAN_HVC_REQ_MSG_MODEL, sizeof(env->ccu_candb_tx.CCU_HVC_Req_Msg));
|
|
|
|
|
memcpy(&env->ccu_candb_tx.CCU_HVC_Req_Msg, &rtY.CCUCAN_HVC_REQ_MSG_MODEL,
|
|
|
|
|
sizeof(env->ccu_candb_tx.CCU_HVC_Req_Msg));
|
|
|
|
|
memcpy(&env->ccu_candb_tx.CCU_Msg3, &rtY.CCU_Msg3_model, sizeof(env->ccu_candb_tx.CCU_Msg3));
|
|
|
|
|
memcpy(&env->ccu_candb_tx.CCU_Msg1, &rtY.CCU_Msg1_model, sizeof(env->ccu_candb_tx.CCU_Msg1));
|
|
|
|
|
|
|
|
|
|
@ -1137,43 +1151,67 @@ static _Noreturn void ModelTask_Thread(tModelTask *env) {
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_Act0, &rtY.dbgCAN_dbg_Act0_model, sizeof(env->ccu_candb_dbg_tx.dbg_Act0));
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_Act1, &rtY.dbgCAN_dbg_Act1_model, sizeof(env->ccu_candb_dbg_tx.dbg_Act1));
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_Act2, &rtY.dbgCAN_dbg_Act2_model, sizeof(env->ccu_candb_dbg_tx.dbg_Act2));
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_Sen_Duct, &rtY.dbgCAN_dbg_Sen_Duct_model,sizeof(env->ccu_candb_dbg_tx.dbg_Sen_Duct));
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_Sen_Eva, &rtY.dbgCAN_dbg_Sen_Eva_model,sizeof(env->ccu_candb_dbg_tx.dbg_Sen_Eva));
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_Logic_Blower, &rtY.dbgCAN_dbg_Logic_Blower_model, sizeof(env->ccu_candb_dbg_tx.dbg_Logic_Blower));
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_Sen_Duct, &rtY.dbgCAN_dbg_Sen_Duct_model,
|
|
|
|
|
sizeof(env->ccu_candb_dbg_tx.dbg_Sen_Duct));
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_Sen_Eva, &rtY.dbgCAN_dbg_Sen_Eva_model,
|
|
|
|
|
sizeof(env->ccu_candb_dbg_tx.dbg_Sen_Eva));
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_Logic_Blower, &rtY.dbgCAN_dbg_Logic_Blower_model,
|
|
|
|
|
sizeof(env->ccu_candb_dbg_tx.dbg_Logic_Blower));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Подмена дебажного сообщения для UDS
|
|
|
|
|
if (model_Status_Set_For_Model_output.Pwm == 1) {
|
|
|
|
|
|
|
|
|
|
env->ccu_candb_dbg_tx.dbg_Logic_Blower.Logic_Blower_Pwm_Front = model_Status_Pwm_For_Model_output.Pwm_Front / 10;
|
|
|
|
|
env->ccu_candb_dbg_tx.dbg_Logic_Blower.Logic_Blower_Pwm_Rear = model_Status_Pwm_For_Model_output.Pwm_Rear / 10;
|
|
|
|
|
env->ccu_candb_dbg_tx.dbg_Logic_Blower.Logic_Blower_Pwm_Front =
|
|
|
|
|
model_Status_Pwm_For_Model_output.Pwm_Front / 10;
|
|
|
|
|
env->ccu_candb_dbg_tx.dbg_Logic_Blower.Logic_Blower_Pwm_Rear =
|
|
|
|
|
model_Status_Pwm_For_Model_output.Pwm_Rear / 10;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
model_Status_Pwm_For_Model_input.Pwm_Front = env->ccu_candb_dbg_tx.dbg_Logic_Blower.Logic_Blower_Pwm_Front * 10;
|
|
|
|
|
model_Status_Pwm_For_Model_input.Pwm_Rear = env->ccu_candb_dbg_tx.dbg_Logic_Blower.Logic_Blower_Pwm_Rear * 10;
|
|
|
|
|
model_Status_Pwm_For_Model_input.Pwm_Front =
|
|
|
|
|
env->ccu_candb_dbg_tx.dbg_Logic_Blower.Logic_Blower_Pwm_Front * 10;
|
|
|
|
|
model_Status_Pwm_For_Model_input.Pwm_Rear =
|
|
|
|
|
env->ccu_candb_dbg_tx.dbg_Logic_Blower.Logic_Blower_Pwm_Rear * 10;
|
|
|
|
|
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_Sen_Amb, &rtY.dbgCAN_dbg_Sen_Amb_model, sizeof(env->ccu_candb_dbg_tx.dbg_Sen_Amb));
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_Sen_Incar, &rtY.dbgCAN_dbg_Sen_Incar_model, sizeof(env->ccu_candb_dbg_tx.dbg_Sen_Incar));
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_Sen_0, &rtY.dbgCAN_dbg_Sen_0_model, sizeof(env->ccu_candb_dbg_tx.dbg_Sen_0));
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_Logic_Ac, &rtY.dbg_Logic_Ac_model, sizeof(env->ccu_candb_dbg_tx.dbg_Logic_Ac));
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_CCU_IO, &rtY.dbgCAN_CCU_IO_model, sizeof(env->ccu_candb_dbg_tx.dbg_CCU_IO));
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_Logic_Rec, &rtY.dbgCAN_Logic_Rec_model, sizeof(env->ccu_candb_dbg_tx.dbg_Logic_Rec));
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_Logic_State, &rtY.dbgCAN_Logic_State_model, sizeof(env->ccu_candb_dbg_tx.dbg_Logic_State));
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_Auto_AF, &rtY.dbgCAN_Auto_AF_model, sizeof(env->ccu_candb_dbg_tx.dbg_Auto_AF));
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_Auto_Duct, &rtY.dbgCAN_Auto_Duct_model, sizeof(env->ccu_candb_dbg_tx.dbg_Auto_Duct));
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_Logic_Valve, &rtY.dbg_Logic_Valve_model, sizeof(env->ccu_candb_dbg_tx.dbg_Logic_Valve));
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_Sen_Amb, &rtY.dbgCAN_dbg_Sen_Amb_model,
|
|
|
|
|
sizeof(env->ccu_candb_dbg_tx.dbg_Sen_Amb));
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_Sen_Incar, &rtY.dbgCAN_dbg_Sen_Incar_model,
|
|
|
|
|
sizeof(env->ccu_candb_dbg_tx.dbg_Sen_Incar));
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_Sen_0, &rtY.dbgCAN_dbg_Sen_0_model,
|
|
|
|
|
sizeof(env->ccu_candb_dbg_tx.dbg_Sen_0));
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_Logic_Ac, &rtY.dbg_Logic_Ac_model,
|
|
|
|
|
sizeof(env->ccu_candb_dbg_tx.dbg_Logic_Ac));
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_CCU_IO, &rtY.dbgCAN_CCU_IO_model,
|
|
|
|
|
sizeof(env->ccu_candb_dbg_tx.dbg_CCU_IO));
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_Logic_Rec, &rtY.dbgCAN_Logic_Rec_model,
|
|
|
|
|
sizeof(env->ccu_candb_dbg_tx.dbg_Logic_Rec));
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_Logic_State, &rtY.dbgCAN_Logic_State_model,
|
|
|
|
|
sizeof(env->ccu_candb_dbg_tx.dbg_Logic_State));
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_Auto_AF, &rtY.dbgCAN_Auto_AF_model,
|
|
|
|
|
sizeof(env->ccu_candb_dbg_tx.dbg_Auto_AF));
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_Auto_Duct, &rtY.dbgCAN_Auto_Duct_model,
|
|
|
|
|
sizeof(env->ccu_candb_dbg_tx.dbg_Auto_Duct));
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_Logic_Valve, &rtY.dbg_Logic_Valve_model,
|
|
|
|
|
sizeof(env->ccu_candb_dbg_tx.dbg_Logic_Valve));
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_Drs, &rtY.dbg_Drs_t_model, sizeof(env->ccu_candb_dbg_tx.dbg_Drs));
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_LIN_AirQS_Stat, &rtY.dbg_LIN_AirQS_Stat_t_model, sizeof(env->ccu_candb_dbg_tx.dbg_Logic_Valve));
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_LIN_AirQS_Stat, &rtY.dbg_LIN_AirQS_Stat_t_model,
|
|
|
|
|
sizeof(env->ccu_candb_dbg_tx.dbg_Logic_Valve));
|
|
|
|
|
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_LIN_Ionizer_Stat, &rtY.dbg_LIN_Ionizer_Stat_t_model, sizeof(env->ccu_candb_dbg_tx.dbg_LIN_Ionizer_Stat));
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_LIN_Aroma_Stat, &rtY.dbg_LIN_Aroma_Stat_t_model, sizeof(env->ccu_candb_dbg_tx.dbg_LIN_Aroma_Stat));
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_LIN_Ionizer_Stat, &rtY.dbg_LIN_Ionizer_Stat_t_model,
|
|
|
|
|
sizeof(env->ccu_candb_dbg_tx.dbg_LIN_Ionizer_Stat));
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_LIN_Aroma_Stat, &rtY.dbg_LIN_Aroma_Stat_t_model,
|
|
|
|
|
sizeof(env->ccu_candb_dbg_tx.dbg_LIN_Aroma_Stat));
|
|
|
|
|
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_Sen_Demist, &rtY.dbg_Sen_Demist_model_out, sizeof(env->ccu_candb_dbg_tx.dbg_Sen_Demist));
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_PID_tune, &rtY.dbg_PID_valve_model_out, sizeof(env->ccu_candb_dbg_tx.dbg_PID_tune));
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_Sen_Demist, &rtY.dbg_Sen_Demist_model_out,
|
|
|
|
|
sizeof(env->ccu_candb_dbg_tx.dbg_Sen_Demist));
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_PID_tune, &rtY.dbg_PID_valve_model_out,
|
|
|
|
|
sizeof(env->ccu_candb_dbg_tx.dbg_PID_tune));
|
|
|
|
|
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_Act_calibration, &rtY.dbg_Act_calibration_model_out, sizeof(env->ccu_candb_dbg_tx.dbg_Act_calibration));
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_Act_calibration_error, &rtY.dbg_Act_calibration_error_model_out, sizeof(env->ccu_candb_dbg_tx.dbg_Act_calibration_error));
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_Act_calibration, &rtY.dbg_Act_calibration_model_out,
|
|
|
|
|
sizeof(env->ccu_candb_dbg_tx.dbg_Act_calibration));
|
|
|
|
|
memcpy(&env->ccu_candb_dbg_tx.dbg_Act_calibration_error, &rtY.dbg_Act_calibration_error_model_out,
|
|
|
|
|
sizeof(env->ccu_candb_dbg_tx.dbg_Act_calibration_error));
|
|
|
|
|
|
|
|
|
|
//конец--------------------------------------------------ВЫХОД МОДЕЛИ ДЛЯ CAN-------------------------------------------
|
|
|
|
|
|
|
|
|
|
|