diff --git a/MainModesArbiter.c b/MainModesArbiter.c index da50168..38b7f34 100644 --- a/MainModesArbiter.c +++ b/MainModesArbiter.c @@ -42,7 +42,48 @@ void LoadDataInFromModel(tMma *env) { if (osMutexAcquire(env->ModelTask.access, 5000) == osOK) { -// env->pwms->pwmFrontIo.setActivePercent(env->pwms->pwmFrontIo.env, rtY.PWM_Get_f.pwmPercentFront); + + + // Включение 5V (1 - ВКЛ) + GpioPinSet(&env->gpios->power.SW5V_EN, rtY.PowerEnable_Model.SW5V_EN); + + // Контроль напряжения борт-сети (1 - ВКЛ) + GpioPinSet(&env->gpios->power.PBATT_CK_EN, rtY.PowerEnable_Model.PBATT_CK_EN); + + GpioPinSet(&env->gpios->power.BTS5180_2EKA_FrontRearIncarMotor.Incar_Motor_Front_EN, rtY.PowerEnable_Model.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, rtY.PowerEnable_Model.Incar_Motor_Rear_EN); + + GpioPinSet(&env->gpios->power.BTS5180_2EKA_TwoWayValveAndReservePowerSupply.TwoWayValve_EN, rtY.PowerEnable_Model.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.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.BTS5180_2EKA_2xChannelPTCPower.PtcRelayDriver1_EN, rtY.PowerEnable_Model.PtcRelayDriver1_EN); + GpioPinSet(&env->gpios->power.BTS5180_2EKA_2xChannelPTCPower.PtcRelayDriver_EN_Diag, true); + GpioPinSet(&env->gpios->power.BTS5180_2EKA_2xChannelPTCPower.PtcRelayDriver2_EN, rtY.PowerEnable_Model.PtcRelayDriver2_EN); + + 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.EN_CurrentSensing_C, true); + + GpioPinSet(&env->gpios->power.BTS4175SGAXUMA1_ShutOFFValveBatteryChiller.EN_BATTChiller, rtY.PowerEnable_Model.EN_BATTChiller); + + + GpioPinSet(&env->gpios->power.BTS5180_2EKA_ShutOFFValveFrontRear.ShutOffFront_EN, rtY.PowerEnable_Model.ShutOffFront_EN); + GpioPinSet(&env->gpios->power.BTS5180_2EKA_ShutOFFValveFrontRear.ShutOff_EN_Diag, true); + GpioPinSet(&env->gpios->power.BTS5180_2EKA_ShutOFFValveFrontRear.ShutOffRear_EN, rtY.PowerEnable_Model.ShutOffRear_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); + + + env->pwms->pwmFrontIo.setActivePercent(env->pwms->pwmFrontIo.env, rtY.PWM_Get_f.pwmPercentFront); env->pwms->pwmRearIo.setActivePercent(env->pwms->pwmRearIo.env, rtY.PWM_Get_f.pwmPercentRear); env->pwms->pwmFrontReservedIo.setActivePercent(env->pwms->pwmFrontReservedIo.env, rtY.PWM_Get_f.pwmPercentFrontReserved); env->pwms->pwmRearReservedIo.setActivePercent(env->pwms->pwmRearReservedIo.env, rtY.PWM_Get_f.pwmPercentRearReserved); diff --git a/MainModesArbiter_InitStage.c b/MainModesArbiter_InitStage.c index fda9b88..5248762 100644 --- a/MainModesArbiter_InitStage.c +++ b/MainModesArbiter_InitStage.c @@ -72,7 +72,7 @@ static void Mma_InitSubSystems(tMma *env) { VarsTabDumpObserver_StartThread(&env->storage.dumpObserver); LoadFromStorageToStatusData(&env->storage, &statusData.ecu); - +/* // Включение 5V (0 - ВКЛ) GpioPinSet(&env->gpios->power.SW5V_EN, false); @@ -110,7 +110,7 @@ static void Mma_InitSubSystems(tMma *env) { GpioPinSet(&env->gpios->power.BTS5120_2EKA_ShutoffValvePowerTXV.ShutOffTXV1_EN, true); GpioPinSet(&env->gpios->power.BTS5120_2EKA_ShutoffValvePowerTXV.ShutOffTXV_EN_Diag, true); GpioPinSet(&env->gpios->power.BTS5120_2EKA_ShutoffValvePowerTXV.ShutOffTXV2_EN, true); - +*/ // Indication_Init(&env->Indication, HVAC_DEV_MODE_STARTUP);