Добавлены изменения:
2. 2F CF 51 03 — IO CONTROL — Не работает или не отображается в dbg сообщениях 3. 2F CF 52 03 — PWM (0, 15-80) 4. 22 CF 01 - Sensor Read Pressure minus 40
This commit is contained in:
parent
8b1aa1953f
commit
5f1f111ae7
|
|
@ -243,11 +243,18 @@ typedef struct __attribute__ ((packed)) {
|
|||
#define MAX_DTO 8
|
||||
|
||||
#define BODY_MAX_LEN (MAX_DTO - 2)
|
||||
|
||||
/*
|
||||
#define MAX_DAO 10
|
||||
#define MAX_ODT 255
|
||||
#define MAX_ODT_ENTRIES_SIZE_DAQ 1
|
||||
#define MAX_EVENT_CHANNEL 4
|
||||
*/
|
||||
|
||||
#define MAX_DAO 1
|
||||
#define MAX_ODT 255
|
||||
#define MAX_ODT_ENTRIES_SIZE_DAQ 1
|
||||
#define MAX_EVENT_CHANNEL 4
|
||||
|
||||
|
||||
typedef struct {
|
||||
uint8_t DATA[BODY_MAX_LEN];
|
||||
|
|
|
|||
|
|
@ -91,6 +91,7 @@ void CanUdsInput_Set_Model(tCanUds *env) {
|
|||
env->Status_Sensort_model_IO_local.Ignition = IGN_ANS;
|
||||
env->Status_Sensort_model_IO_local.Battery = PBATT_CHECK;
|
||||
|
||||
env->Status_Sensort_model_IO_local.Pressure -= 40;
|
||||
|
||||
status = osMessageQueuePut(env->queue_input_get_Status_Sensor, &env->Status_Sensort_model_IO_local, 0, 0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -660,11 +660,14 @@ static _Noreturn void ModelTask_Thread(tModelTask *env) {
|
|||
getCmdBusADCData(env->adc0Task, &rtDW.ADC_Data_Model);
|
||||
getCmdBusADC2Data(env->adc1Task,
|
||||
(CmdBusADC2Data *) &rtDW.ADC_Data_Model.VN7008AJ_DIAG_FrontLINActuatorPowerDriverAB);
|
||||
rtDW.ADC_Data_Model.PBATT_CHECK = 1400;
|
||||
// rtDW.ADC_Data_Model.PBATT_CHECK = 1400;
|
||||
uint16_t PBATT_CHECK_16 = (uint16_t) ((rtDW.ADC_Data_Model.PBATT_CHECK * 33.4375f / 4095.0f) * 10.0);
|
||||
|
||||
//конец--------------------------------------------------ВХОД МОДЕЛИ ADC------------------------------------------------
|
||||
|
||||
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));
|
||||
//начало--------------------------------------------------ВХОД МОДЕЛИ НАСТРОЙКИ----------------------------------------------
|
||||
|
||||
|
|
@ -761,7 +764,7 @@ static _Noreturn void ModelTask_Thread(tModelTask *env) {
|
|||
env->PtcRelayDriver1_EN = rtY.PowerEnable_Model.PtcRelayDriver1_EN;
|
||||
env->PtcRelayDriver2_EN = rtY.PowerEnable_Model.PtcRelayDriver2_EN;
|
||||
|
||||
// Для UDS (подмена)
|
||||
// Для UDS (IO подмена)
|
||||
if (model_Status_Set_For_Model_output.IO == 1) {
|
||||
|
||||
if (model_Status_IO_For_Model_output._2_Way_Valve == 0) {
|
||||
|
|
@ -812,33 +815,33 @@ static _Noreturn void ModelTask_Thread(tModelTask *env) {
|
|||
env->PtcRelayDriver2_EN = true;
|
||||
}
|
||||
|
||||
} else {
|
||||
env->ccu_candb_dbg_tx.dbg_CCU_IO.dbg_IO_2WayValve = env->TwoWayValve_EN;
|
||||
env->ccu_candb_dbg_tx.dbg_CCU_IO.dbg_IO_IncarMotor_F = env->Incar_Motor_Front_EN;
|
||||
env->ccu_candb_dbg_tx.dbg_CCU_IO.dbg_IO_IncarMotor_R = env->Incar_Motor_Rear_EN;
|
||||
env->ccu_candb_dbg_tx.dbg_CCU_IO.dbg_IO_Txv_Ch = env->EN_BATTChiller;
|
||||
env->ccu_candb_dbg_tx.dbg_CCU_IO.dbg_IO_Txv_F = env->ShutOffFront_EN;
|
||||
env->ccu_candb_dbg_tx.dbg_CCU_IO.dbg_IO_Txv_R = env->ShutOffRear_EN;
|
||||
|
||||
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
|
||||
model_Status_IO_For_Model_input._2_Way_Valve = env->TwoWayValve_EN;
|
||||
|
|
@ -852,22 +855,17 @@ 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------------------------------------------
|
||||
|
||||
|
||||
|
|
@ -876,23 +874,34 @@ static _Noreturn void ModelTask_Thread(tModelTask *env) {
|
|||
// Для UDS (подмена)
|
||||
if (model_Status_Set_For_Model_output.Pwm == 1) {
|
||||
|
||||
env->pwms->pwmFrontIo.setActivePercent(env->pwms->pwmFrontIo.env,
|
||||
model_Status_Pwm_For_Model_output.Pwm_Front / 10);
|
||||
env->pwms->pwmRearIo.setActivePercent(env->pwms->pwmRearIo.env,
|
||||
model_Status_Pwm_For_Model_output.Pwm_Rear / 10);
|
||||
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);
|
||||
uint16_t Pwm_Front = model_Status_Pwm_For_Model_output.Pwm_Front / 10;
|
||||
uint16_t Pwm_Rear = model_Status_Pwm_For_Model_output.Pwm_Rear / 10;
|
||||
|
||||
if ((Pwm_Front != 0) && (Pwm_Front < 15)) {
|
||||
Pwm_Front = 15;
|
||||
}
|
||||
if (Pwm_Front > 80) {
|
||||
Pwm_Front = 80;
|
||||
}
|
||||
|
||||
if ((Pwm_Rear != 0) && (Pwm_Rear < 15)) {
|
||||
Pwm_Rear = 15;
|
||||
}
|
||||
if (Pwm_Rear > 80) {
|
||||
Pwm_Rear = 80;
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
} 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-------------------------------------------
|
||||
|
||||
|
|
@ -929,8 +938,9 @@ static _Noreturn void ModelTask_Thread(tModelTask *env) {
|
|||
memcpy(&env->ccu_candb_tx.CCU_Msg1, &rtY.CCU_Msg1_model, sizeof(env->ccu_candb_tx.CCU_Msg1));
|
||||
|
||||
|
||||
// Для UDS (подмена)
|
||||
// начало Для UDS (подмена) --------------------------------------------------------------------------------------
|
||||
if (model_Status_Set_For_Model_output.eComp == 1) {
|
||||
|
||||
env->ccu_candb_tx.CCU_HVC_Req_Msg.CCU_eCompSpeedReq_Val_ro = model_Status_eComp_For_Model_output.Pwm_Front;
|
||||
|
||||
// request to EMS for closing the low temperature circuit valve
|
||||
|
|
@ -954,6 +964,7 @@ static _Noreturn void ModelTask_Thread(tModelTask *env) {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
model_Status_eComp_For_Model_input.Pwm_Front = env->ccu_candb_tx.CCU_HVC_Req_Msg.CCU_eCompSpeedReq_Val_ro;
|
||||
|
||||
if (env->ccu_candb_tx.CCU_HVC_Req_Msg.CCU_LowTempValve_Req == 2) {
|
||||
|
|
@ -961,8 +972,6 @@ static _Noreturn void ModelTask_Thread(tModelTask *env) {
|
|||
} else {
|
||||
model_Status_eComp_For_Model_input.LowTempValve = 0;
|
||||
}
|
||||
|
||||
|
||||
model_Status_eComp_For_Model_input.eComp_Statue_Request = env->ccu_candb_tx.CCU_HVC_Req_Msg.CCU_eCompReq_Stat;
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue