/*
 * Global_Variable.c
 *
 *  Created on: 2024. 4. 15.
 *      Author: User
 */

/*GV_ = Global Variable*/
#include "Global_Variable.h"


/*----------------------------------------Variables----------------------------------------*/
/* Variable Name : IG_Process_Status
 * Data Type : uint8
 * Description : for Debug and Check System Status
 * Value Table :
 * 0 : Key_off_Process / 1 : Key_off_Completed / 2 : Key_on_Process / 3 : Key_on_Completed
 * Requirement : Tx this Signal, CH1
 */


/*======================================== Input Data ========================================*/
/*------------------------------ CH0 ------------------------------*/
// Input_Data_Set_RC_VCU_Signal1_CH0_0x040
float		GV_RC_BrakeTorqueCommand 				= 0;
float		GV_RC_BrakeTorqueCommand_Master 		= 0;
float		GV_Master_Brake_Torque_Command	= 0;
float		GV_RC_RWA_RackAngleCommand 				= 0;
float 		GV_Brake_Torque_Command  		= 0;
uint32_t	GV_RC_Drive_ACC_Cmd 					= 0;
uint32_t	GV_RC_Vx_Command						= 0;
uint32_t	GV_RC_VCU_counter1						= 0;
uint32_t	GV_RC_VCU_counter1_CHECK				= 260;
uint32_t	GV_RC_VCU_CRC1							= 0;
uint32_t	GV_RC_ALV_FLAG							= 0;

// Input_Data_Set_RC_VCU_Signal2_CH0_0x041
uint32_t	GV_RC_Drive_Mode 		= 0;
uint32_t	GV_RC_GearSelStat 		= 0;
uint32_t	GV_RC_ParkBrake_Cmd 	= 0;
uint32_t	GV_RC_Emergency_Stop 	= 0;
uint32_t	GV_RC_VCU_long_Ctl_mode	= 0;
uint32_t	GV_RC_VCU_ARC 			= 0;
uint32_t	GV_RC_VCU_CRC2 			= 0;
uint32_t	GV_RC_VX_Limit 			= 0;

// Input_RC_VCU_Fault_Flag_CH0_0x042
uint8_t		GV_RC_VCU_ACU_Fault_Flag			= 0;
uint8_t		GV_RC_VCU_MCU_Actuator_Fault_Flag	= 0;
uint8_t		GV_RC_VCU_RWA_Actuator_Fault_Flag	= 0;

// Input_Data_Set_IMU_TX1_CH0_0x174
float		GV_IMU_YawRtVal 		= 0;
uint32_t	GV_IMU_CLU_STAT 		= 0;
uint32_t	GV_IMU_YAW_RATE_STAT	= 0;
uint32_t	GV_IMU_TEMP_RATE 		= 0;
float		GV_IMU_AY_Val 			= 0;
uint32_t	GV_IMU_MSG_TX1_CNT 		= 0;
uint32_t	GV_IMU_AY_STAT 			= 0;
uint32_t	GV_IMU_TX1_CRC 			= 0;

// Input_Data_Set_IMU_TX1_CH0_0x178
float		GV_IMU_RollRtVal 		= 0;
uint32_t	GV_IMU_CLU_STAT5 		= 0;
uint32_t	GV_IMU_ROLL_RATE_STAT	= 0;
uint32_t	GV_IMU_CLU_DIAG 		= 0;
float		GV_IMU_AX_Val 			= 0;
uint32_t	GV_IMU_MSG_TX2_CNT 		= 0;
uint32_t	GV_IMU_AX_STAT 			= 0;
uint32_t	GV_IMU_TX2_CRC 			= 0;

// Input_Data_Set_IMU_TX1_CH0_0x17C
float		GV_IMU_PitchRtVal 		= 0;
uint32_t	GV_IMU_HW_Index 		= 0;
uint32_t	GV_IMU_PITCH_RATE_STAT 	= 0;
float		GV_IMU_AZ_Val 			= 0;
uint32_t	GV_IMU_MSG_TX3_CNT 		= 0;
uint32_t	GV_IMU_AZ_STAT 			= 0;
uint32_t	GV_IMU_TX3_CRC 			= 0;

// Input_Data_Set_EPAM_VCU_CH0_0x221
uint32_t	GV_EPAM_driveSensor 		= 0;
uint32_t	GV_EPAM_parkSensor 			= 0;
uint32_t	GV_EPAM_parkLock 			= 0;
uint32_t	GV_EPAM_ParkRequestStatus 	= 0;
uint32_t	GV_EPAM_Voltage 			= 0;
uint32_t	GV_EPAM_Current 			= 0;
uint32_t	GV_EPAM_Temperature 		= 0;
uint32_t	GV_EPAM_HallPosition 		= 0;
uint32_t	GV_ErrEPAM_MotStallMiddle 	= 0;
uint32_t	GV_ErrEPAM_MotStallUnPark 	= 0;
uint32_t	GV_ErrEPAM_MotStallPark 	= 0;
uint32_t	GV_ErrEPAM_MotOpen 			= 0;
uint32_t	GV_ErrEPAM_MotFail 			= 0;
uint32_t	GV_EPAM_State 				= 0;
uint32_t	GV_ErrEPAM_CommErr 			= 0;
uint32_t	GV_ErrEPAM_HallSenErr 		= 0;
uint32_t	GV_ErrEPAM_OT_ECU 			= 0;
uint32_t	GV_ErrEPAM_CANErr 			= 0;
uint32_t	GV_ErrEPAM_HallPaternError 	= 0;
uint32_t	GV_ErrEPAM_HallTimeOut 		= 0;
uint32_t	GV_ErrEPAM_DCBusUnderVoltage= 0;
uint32_t	GV_ErrEPAM_DCBusOverVoltage = 0;
uint32_t	GV_ErrEPAM_DCBusOverCurrent = 0;

// Input_Data_Set_MCU_VCU_Signals1_CH0_0x300
uint32_t	GV_MCU_Ready 		= 0;
uint32_t	GV_MCU_Controlable	= 0;
uint32_t	GV_MCU_FltSta 		= 0;
uint32_t	GV_MCU_Interlock	= 0;
float		GV_MCU_CurGearSta 	= 0;
uint32_t	GV_MCU_GearStaInv 	= 0;
uint32_t	GV_MCU_Derating 	= 0;
uint32_t	GV_MCU_SvrFlt 		= 0;
float		GV_MCU_MtrTemp 		= 0;
float		GV_MCU_InvTemp 		= 0;
float		GV_MCU_RPM 			= 0;
float		GV_MCU_EstTrq 		= 0;

// Input_Data_Set_BCM_VCU_Signal1_CH0_0x570
uint8_t		GV_Lamp_Hazard_STA 	= 0;
uint8_t		GV_Lamp_Break_STA 	= 0;
uint8_t		GV_Lamp_HBEAM_STA 	= 0;
uint8_t		GV_Lamp_Head_STA 	= 0;
uint8_t		GV_Lamp_LTRN_STA 	= 0;
uint8_t		GV_Lamp_Reverse_STA = 0;
uint8_t		GV_Lamp_RTRN_STA 	= 0;
uint8_t		GV_Lamp_Position_STA= 0;
uint8_t		GV_Lamp_DRL_STA 	= 0;
uint32_t	GV_Status_Wiper_STA = 0;
uint32_t	GV_BCM_CE1_STA 		= 0;
uint32_t	GV_BCM_CE2_STA 		= 0;
uint32_t	GV_BCM_CE3_STA 		= 0;
uint32_t	GV_BCM_CE4_STA 		= 0;
uint32_t	GV_BCM_CE5_STA 		= 0;
uint32_t	GV_BCM_MAINSW_STA 	= 0;
float		GV_Battery_Voltage 	= 0;
uint32_t	GV_BCM_VCU_counter1 = 0;
uint32_t	GV_BCM_VCU_CRC1 	= 0;
uint32_t	GV_BCM_VCU_counter3 = 0;
uint32_t	GV_BCM_VCU_CRC3 	= 0;
uint32_t	GV_BCM_Sys_Status 	= 0;
uint8_t		GV_LDC_STA 			= 0;

// Input_Data_Set_BCM_VCU_Signal2_CH0_0x580
uint32_t	GV_ChargingStatus 	= 0;
uint32_t	GV_BCM_ChgeCon_DTD 	= 0;
uint8_t		GV_BMS_HVOn_STA 	= 0;
uint8_t		GV_OBC_Interlock 	= 0;
uint8_t		GV_BMS_Interlock 	= 0;
uint32_t	GV_BMS_SOC 			= 0;
uint32_t	GV_BMS_SOH 			= 0;
uint32_t	GV_CommSta_OBC 		= 0;
uint32_t	GV_CommSta_VCU 		= 0;
uint32_t	GV_CommSta_BMS 		= 0;
uint32_t	GV_CommSta_LDC 		= 0;
uint32_t	GV_CommSta_TMS 		= 0;
uint32_t	GV_BMS_SOH_INV 		= 0;
uint32_t	GV_BMS_SOC_INV 		= 0;
uint32_t	GV_Bms_Soc_Wrng 	= 0;
uint32_t	GV_Bms_SoH_Wrng 	= 0;
uint32_t	GV_BCM_VCU_counter2 = 0;
uint32_t	GV_BCM_VCU_CRC2 	= 0;

//Input_Data_Set_BCM_VCU_Signal5_CH0_0x585
uint8_t 	GV_BMS_FltSta 		= 0;
uint8_t 	GV_BMS_TEMP_FAULT 	= 0;
uint8_t 	GV_TMS_FltSta      	= 0;
float   	GV_OBC_TEMP        	= 0;
float   	GV_LDC_TEMP        	= 0;
uint8_t 	GV_OBC_ACTL_CUR    	= 0;
uint8_t		GV_OBC_TRGT_CUR    	= 0;
uint8_t 	GV_User_SoC        	= 0;
uint8_t 	GV_LDC_FltSta 		= 0;
uint8_t 	GV_LDC_TEMP_FAULT 	= 0;

// Input_Data_Set_BCM_VCU_Signal3_CH0_0x590
float 		GV_Bms_PackCur  = 0;
float 		GV_Bms_PackVolt	= 0;
uint16_t	GV_Bms_PackPwr 	= 0;

// Input_Data_Set_BCM_VCU_Signal4_CH0_0x595
uint8_t 	GV_LDC_ACTL_VOLT= 0;
uint8_t 	GV_LDC_ACTL_CUR = 0;




/*------------------------------ CH1 ------------------------------*/
// Input_Data_Set_ACU_VCU_Signal1_CH1_0x091
uint32_t	GV_ACU_Vx_Command 		= 0;
float	GV_ACU_Drive_ACC_Cmd 		= 0;
float	GV_ACU_BrakeTorqueCommand 	= 0;
uint32_t	GV_ACU_VCU_counter1 	= 0;
uint32_t	GV_ACU_VCU_CRC1 		= 0;

// Input_Data_Set_ACU_VCU_Signal2_CH1_0x092
float	GV_ACU_RWA_cmd_deg 		= 0;
float	GV_ACU_RWS_cmd_deg 		= 0;
uint32_t	GV_ACU_VCU_counter2 = 0;
uint32_t	GV_ACU_VCU_CRC2 	= 0;

// Input_Data_Set_ACU_VCU_Signal3_CH1_0x093
uint32_t	GV_ACU_Drive_mode 		= 0;
uint32_t	GV_ACU_long_Ctl_mode 	= 0;
uint32_t	GV_ACU_EPAM_req 		= 0;
uint32_t	GV_ACU_VCU_GearPos 		= 0;
uint32_t	GV_ACU_Emergency_Stop 	= 0;
uint32_t	GV_ACU_VCU_counter3 	= 0;
uint32_t	GV_ACU_VCU_CRC3 		= 0;

// Input_Data_Set_ACU_BCM_Signal_1_CH1_0x151
uint32_t 	GV_ACU_Lamp_BRAKE_CMD	= 0;
uint32_t 	GV_ACU_Lamp_Hazard_CMD 	= 0;
uint32_t 	GV_ACU_Lamp_HBEAM_CMD 	= 0;
uint32_t 	GV_ACU_Lamp_Head_CMD 	= 0;
uint32_t 	GV_ACU_Lamp_LTRN_CMD 	= 0;
uint32_t 	GV_ACU_Lamp_Reverse_CMD = 0;
uint32_t 	GV_ACU_Lamp_RTRN_CMD 	= 0;
uint32_t 	GV_ACU_Lamp_Position_CMD= 0;
uint32_t 	GV_ACU_Lamp_DRL_CMD 	= 0;
uint32_t 	GV_ACU_Wiper_CMD 		= 0;
uint32_t	GV_ACU_VCU_counter		= 0;




/*------------------------------ CH2 ------------------------------*/
// Input_Data_Set_RWA_Status1_CH2_0x072
uint32_t	GV_RWA1_Arc 					= 0;
uint32_t	GV_RWA1_Crc 					= 0;
uint32_t	GV_RWA1_EcuPowerMode 			= 0;
uint32_t	GV_RWA1_EcuRole 				= 0;
uint32_t	GV_RWA1_EcuStatus 				= 0;
uint32_t	GV_RWA1_MaxMotorOutputValid 	= 0;
float		GV_RWA1_VCU_MaxMotorOutput		= 0;
float		GV_RWA1_VCU_RackAngleSpeedFbk	= 0;
uint32_t	GV_RWA1_RackAngleSpeedFbkValid	= 0;
uint32_t	GV_RWA1_SysInfo 				= 0;
uint32_t	GV_RWA1_WarningLamp 			= 0;

// Input_Data_Set_RWA_Status2_CH2_0x073
// uint32_t GV_RWA1_Arc = 0;
// uint32_t GV_RWA1_Crc = 0;
float		GV_RWA1_RackAngleFbk 		= 0;
uint32_t	GV_RWA1_RackAngleFbkValid	= 0;
float		GV_RWA1_RackForceFbk 		= 0;
uint32_t	GV_RWA1_RackForceFbkValid 	= 0;

// Input_Data_Set_IDB_RegenTcsRequest_CH2_0x082
float 		GV_IDB_VCU_RbcTargetRegenTorque	= 0;
float 		GV_IDB_VCU_TcsTorqueCmd 		= 0;

// Input_Data_Set_IDB_Status_CH2_0x092
uint8_t		GV_IDB_Arc						= 0;
float		GV_IDB_VCU_EscYawRateThreshold	= 0;

// Input_Data_Set_IDB_TireSlipStatus_CH2_0x096
float 		GV_IDB_VCU_FrontLeftTireSlipRatio 	= 0;
float 		GV_IDB_VCU_FrontRightTireSlipRatio 	= 0;
float 		GV_IDB_VCU_RearLeftTireSlipRatio 	= 0;
float 		GV_IDB_VCU_RearRightTireSlipRatio 	= 0;

// Input_Data_Set_IDB_BrakeStatus1_CH2_0x09A
float 		GV_IDB_VCU_EstimatedVehicleSpeed 	= 0;
float 		GV_IDB_VCU_MasterCylinderPressure	= 0;
float 		GV_IDB_VCU_RoadFrictionCoefficient 	= 0;

// Input_Data_Set_IDB_PressureStatus_CH2_0x0A0
float 		GV_IDB_VCU_FrontLeftEstimatedPressure	= 0;
float 		GV_IDB_VCU_FrontRightEstimatedPressure 	= 0;
float 		GV_IDB_VCU_RearLeftEstimatedPressure 	= 0;
float 		GV_IDB_VCU_RearRightEstimatedPressure 	= 0;

// Input_Data_Set_RWA_Status3_CH2_0x0AA
float 	GV_RWA1_VCU_PolValue 			= 0;
float 	GV_RWA1_VCU_SysBatteryVoltage 	= 0;
float 	GV_RWA1_VCU_SysIqCurrent 		= 0;




/*------------------------------ CH3 ------------------------------*/
// Input_Data_Set_RWA_Status1_CH3_0x072
uint32_t	GV_RWA2_Arc								= 0;
float		GV_RWA2_VCU_CH3_0x072_MaxMotorOutput 	= 0;
float		GV_RWA2_VCU_CH3_0x072_RackAngleSpeedFbk = 0;

// Input_Data_Set_RWA_Status2_CH3_0x073
float		GV_RWA2_RackAngleFbk = 0;
float 		GV_RWA2_RackForceFbk = 0;

// Input_Data_Set_RCU_BrakeStatus1_CH3_0x09B
float 		GV_RCU_VCU_EstimatedVehicleSpeed	= 0;
float		GV_RCU_VCU_RoadFrictionCoefficient	= 0;
uint32_t 	GV_VCU_RCU_Brk_Pressure_Fbk  		= 0;

// Input_Data_Set_RCU_PressureStatus_CH3_0x0A1
float		GV_RWA2_FrontLeftEstimatedPressure	= 0;
float		GV_RWA2_FrontRightEstimatedPressure = 0;

// Input_Data_Set_RWA_Status3_CH3_0x0AA
float 		GV_RWA2_PolValue 			= 0;
float 		GV_RWA2_SysBatteryVoltage 	= 0;
float		GV_RWA2_SysIqCurrent 		= 0;

// Input_Data_Set_RCU_Status_CH3_0x093
uint8_t		GV_RCU_Arc				= 0;
float 		GV_EscYawRateThreshold	= 0;

// Input_Data_Set_RCU_TireSlipStatus_CH3_0x097
float 		GV_RCU_VCU_FrontLeftTireSlipRatio	= 0;
float 		GV_RCU_VCU_FrontRightTireSlipRatio 	= 0;
float 		GV_RCU_VCU_RearLeftTireSlipRatio 	= 0;
float 		GV_RCU_VCU_RearRightTireSlipRatio 	= 0;




/*------------------------------ CH4 ------------------------------*/




/*------------------------------ CH5 ------------------------------*/




/*======================================== Output Data ========================================*/
/*------------------------------ CH0 ------------------------------*/
// Output_Data_Set_VCU_RC_Signals1_CH0_0x010
uint32_t	GV_VCU_MCU_EstTrq 		= 0;
float		GV_VCU_RWA_Rack_Fbk 	= 0;
uint32_t	GV_VCU_Brk_Pressure_Fbk	= 0;
float		GV_VCU_Vx_Fbk 			= 0;
uint32_t	GV_VCU_Vx_Limit 		= 0;
uint32_t	GV_VCU_RC_counter1 		= 0;
uint32_t	GV_VCU_RC_CRC1 			= 0;

// Output_Data_Set_VCU_RC_Signals2_CH0_0x011
uint32_t	GV_VCU_RC_BMS_SOC 		= 0;
uint32_t	GV_VCU_RC_long_Ctl_mode = 0;
uint32_t	GV_VCU_RC_Emergency_Stop= 0;
uint32_t	GV_VCU_GearSelStat 		= 0;
uint32_t	GV_VCU_Drive_Mode 		= 3;
uint32_t	GV_VCU_ParkBrake_Fbk 	= 0;
uint32_t	GV_VCU_Acc_Limit 		= 0;
uint32_t	GV_VCU_Acc_Fbk 			= 0;

// Output_Data_Set_CAR_STAT_CH0_0x012
uint32_t	GV_CAR_Bms_PackVolt 	= 0;
float		GV_CAR_Bms_PackCur 		= 0;
uint32_t	GV_CAR_Battery_Voltage	= 0;
uint32_t	GV_CAR_LDC_ACTL_CUR 	= 0;
uint32_t	GV_CAR_LDC_ACTL_VOLT 	= 0;
uint32_t	GV_CAR_ChargingStatus 	= 0;
uint32_t	GV_CAR_BMS_HVOn_STA 	= 0;
uint32_t	GV_CAR_ARC 				= 0;

// Output_Data_Set_VCU_MCU_Fault_mode_CH0_0x013
uint8_t 	GV_VCU_RC_ACU_Fault_Flag  			= 0;
uint8_t		GV_VCU_RC_MCU_Actuator_Fault_Flag	= 0;
uint8_t		GV_VCU_RC_IDB_ECU_Fault_Flag		= 0;
uint8_t		GV_VCU_RC_RCU_ECU_Fault_Flag		= 0;
uint8_t		GV_VCU_RC_RWA1_ECU_Fault_Flag		= 0;
uint8_t		GV_VCU_RC_RWA2_ECU_Fault_Flag		= 0;
uint8_t		GV_VCU_RC_RWA_Actuator_Fault_Flag	= 0;

// Output_Data_Set_VCU_RWA_Fault_mode_CH0_0x014
uint32_t 	GV_VCU_RWA1_CMD 	 	    = 0;
uint32_t 	GV_VCU_RWA2_CMD 	 	    = 0;
uint32_t 	GV_VCU_RWA1_WakeupCommand   = 0;
uint32_t 	GV_VCU_RWA2_WakeupCommand	= 0;
uint32_t 	GV_VCU_RWA1_2_FAULT 	    = 0;

// Output_Data_Set_VCU_RWS_Fault_mode_CH0_0x015
uint32_t 	GV_VCU_RWS1_CMD 	 		= 0;
uint32_t 	GV_VCU_RWS2_CMD 	 		= 0;
uint32_t 	GV_VCU_RWS1_WakeupCommand   = 0;
uint32_t 	GV_VCU_RWS2_WakeupCommand   = 0;
uint32_t 	GV_VCU_RWS1_2_FAULT 	    = 0;

// Output_Data_Set_VCU_IDB_RCU_Fault_mode_CH0_0x016
uint32_t 	GV_VCU_IDB_Fault	 	    = 0;
uint32_t 	GV_VCU_RCU_Fault 		    = 0;
uint32_t 	GV_VCU_IDB_WakeupCommand	= 0;
uint32_t 	GV_VCU_RCU_WakeupCommand    = 0;

// Output_Data_Set_RWA_VCU_RC_Signal1_CH0_0x050
uint32_t	GV_CH0_RWA_RackAngleFbk1 		= 0;
uint32_t	GV_CH0_RWA_RackAngleSpeedFbk1 	= 0;
uint32_t	GV_CH0_RWA_VCU_RC_counter1 		= 0;
uint32_t	GV_CH0_RWA_VCU_RC_CRC1 			= 0;

// Output_Data_Set_RWA_VCU_RC_Signal2_CH0_0x051
uint32_t	GV_CH0_RWA_RackAngleFbk2 		= 0;
uint32_t	GV_CH0_RWA_RackAngleSpeedFbk2 	= 0;
uint32_t	GV_CH0_RWA_VCU_RC_counter2 		= 0;
uint32_t	GV_CH0_RWA_VCU_RC_CRC2 			= 0;

// Output_Data_Set_RWS_VCU_RC_Signal1_CH0_0x060
uint32_t	GV_CH0_RWS_RackAngleFbk1 		= 0;
uint32_t	GV_CH0_RWS_RackAngleSpeedFbk1 	= 0;
uint32_t	GV_CH0_RWS_VCU_RC_counter1 		= 0;
uint32_t	GV_CH0_RWS_VCU_RC_CRC1 			= 0;

// Output_Data_Set_RWS_VCU_RC_Signal2_CH0_0x061
uint32_t	GV_CH0_RWS_RackAngleFbk2 		= 0;
uint32_t	GV_CH0_RWS_RackAngleSpeedFbk2 	= 0;
uint32_t	GV_CH0_RWS_VCU_RC_counter2 		= 0;
uint32_t	GV_CH0_RWS_VCU_RC_CRC2 			= 0;

// Output_Data_Set_SW_VER_CH0_0x100
uint32_t	GV_YEAR 	= 0;
uint32_t	GV_Month	= 0;
uint32_t	GV_Day 		= 0;
uint32_t	GV_Ver 		= 0;
uint32_t	GV_CAR_NUM	= 0;

// Output_Data_Set_VCU_BCM_Signal_1_CH0_0x151
uint32_t	GV_Lamp_BRAKE_CMD 	= 0;
uint32_t	GV_Lamp_Hazard_CMD 	= 0;
uint32_t	GV_Lamp_HBEAM_CMD 	= 0;
uint32_t	GV_Lamp_Head_CMD 	= 0;
uint32_t	GV_Lamp_LTRN_CMD 	= 0;
uint32_t	GV_Lamp_Reverse_CMD	= 0;
uint32_t	GV_Lamp_RTRN_CMD 	= 0;
uint32_t	GV_Lamp_Position_CMD= 0;
uint32_t	GV_Lamp_DRL_CMD 	= 0;
uint32_t	GV_Wiper_CMD 		= 0;

// Output_Data_Set_VCU_BCM_Signal_2_CH0_0x180
uint8_t 	GV_HMI1_LAMP = 0;
uint8_t 	GV_HMI2_LAMP = 0;
uint8_t 	GV_HMI3_LAMP = 0;
uint8_t 	GV_HMI4_LAMP = 0;
uint8_t 	GV_HMI5_LAMP = 0;

// Output_Data_Set_VCU_EPAM_CH0_0x220
uint32_t	GV_VCU_EPAM_Park_Request_to_EPC	= 0;
uint32_t	GV_VCU_EPAM_ErrClear_State 		= 0;

// Output_Data_Set_VCU_MCU_Signals1_CH0_0x250
float 		GV_Motor_Torque_Cmd 		= 0;
uint16_t 	GV_limit_Torq 		= 0;
uint32_t 	GV_VCU_TorqueContol = 0;
uint32_t 	GV_VCU_Ready		= 0;
uint32_t 	GV_VCU_ControlMode  = 0;
uint32_t 	GV_VCU_PwrEnable 	= 0;
uint32_t 	GV_VCU_GearCmd 		= 0;
uint32_t 	GV_VCU_MtrDir 		= 0;
uint32_t 	GV_VCU_BmsFlt 		= 0;
uint32_t 	GV_VCU_BmsHvSt 		= 0;
uint32_t 	GV_VCU_PosTrqLimit  = 0;
float 		GV_VCU_NegTrqLimit  = 0;




/*------------------------------ CH1 ------------------------------*/
// Output_Data_Set_VCU_BCM_Signal_1_CH0_0x151
uint8_t		GV_CE_ON_CMD 	= 0;
uint8_t		GV_HV_ON_CMD 	= 0;
uint8_t		GV_LDC_ACT_CMD 	= 0;
uint16_t	GV_LDC_TAGT_CMD = 0;

// Output_Data_Set_VCU_ACU_Signal1_CH1_0x013
uint32_t	GV_VCU_ACU_MCU_EstTrq 		= 0;
uint32_t	GV_VCU_ACU_RWA_Rack_Fbk 	= 0;
uint32_t	GV_VCU_ACU_Brk_Pressure_Fbk = 0;
uint32_t	GV_VCU_ACU_RC_BMS_SOC 		= 0;
uint32_t	GV_VCU_ACU_long_Ctl_mode 	= 0;
uint32_t	GV_VCU_ACU_GearPos 			= 0;
uint32_t	GV_VCU_ACU_ParkBrake_Fbk 	= 0;
uint32_t	GV_VCU_ACU_Emergency_Stop 	= 0;
uint32_t	GV_VCU_ACU_ARC1 			= 0;
uint32_t	GV_VCU_ACU_CRC1 			= 0;

// Output_Data_Set_VCU_ACU_Signal2_CH1_0x014
uint32_t	GV_RWA_Flt 			= 0;
uint32_t	GV_RWS_Flt 			= 0;
uint32_t	GV_IDB_Flt 			= 0;
uint32_t	GV_MCU_Flt 			= 0;
uint32_t	GV_Drive_Mode 		= 0;
uint32_t	GV_VCU_IGN_SIG 		= 0;
uint32_t	GV_VCU_ACU_counter2 = 0;
uint32_t	GV_VCU_ACU_CRC2 	= 0;

// Output_Data_Set_VCU_ACU_Signal3_CH1_0x015
uint32_t	GV_ACU_VCU_Vx_Fbk 		= 0;
uint32_t	GV_ACU_VCU_Vx_Limit 	= 0;
uint32_t	GV_ACU_VCU_Acc_Fbk 		= 0;
uint32_t	GV_ACU_VCU_Acc_Limit 	= 0;
uint32_t	GV_ACU_VCU_ACU_counter3 = 0;
uint32_t	GV_ACU_VCU_ACU_CRC3 	= 0;

// Output_Data_Set_CH1_ACU_CAR_STAT_CH1_0x016
uint32_t	GV_ACU_CAR_ARC = 0;
uint32_t	GV_ACU_CAR_CRC = 0;

// Output_Data_Set_RWA_VCU_ACU_Signal1_CH1_0x050
uint32_t	GV_RWA_RackAngleFbk1 		= 0;
uint32_t	GV_RWA_RackAngleSpeedFbk1 	= 0;
uint32_t	GV_RWA_VCU_ACU_counter1 	= 0;
uint32_t	GV_RWA_VCU_ACU_CRC1 		= 0;

// Output_Data_Set_RWA_VCU_ACU_Signal2_CH1_0x051
uint32_t	GV_RWA_RackAngleFbk2 		= 0;
uint32_t	GV_RWA_RackAngleSpeedFbk2 	= 0;
uint32_t	GV_RWA_VCU_ACU_counter2 	= 0;
uint32_t	GV_RWA_VCU_ACU_CRC2 		= 0;

// Output_Data_Set_RWS_VCU_ACU_Signal1_CH1_0x060
uint32_t	GV_RWS_RackAngleFbk1 		= 0;
uint32_t	GV_RWS_RackAngleSpeedFbk1 	= 0;
uint32_t	GV_RWS_VCU_ACU_counter1 	= 0;
uint32_t	GV_RWS_VCU_ACU_CRC1 		= 0;

// Output_Data_Set_RWS_VCU_ACU_Signal2_CH1_0x061
uint32_t	GV_RWS_RackAngleFbk2 		= 0;
uint32_t	GV_RWS_RackAngleSpeedFbk2 	= 0;
uint32_t	GV_RWS_VCU_ACU_counter2 	= 0;
uint32_t	GV_RWS_VCU_ACU_CRC2 		= 0;

// RC_VCU_BCM_Signal_1_CH1_0x155
uint32_t	GV_RC_Lamp_BRAKE_CMD 	= 0;
uint32_t	GV_RC_Lamp_Hazard_CMD	= 0;
uint32_t	GV_RC_Lamp_HBEAM_CMD 	= 0;
uint32_t	GV_RC_Lamp_Head_CMD 	= 0;
uint32_t	GV_RC_Lamp_LTRN_CMD 	= 0;
uint32_t	GV_RC_Lamp_Reverse_CMD 	= 0;
uint32_t	GV_RC_Lamp_RTRN_CMD 	= 0;
uint32_t	GV_RC_Lamp_Position_CMD = 0;
uint32_t	GV_RC_Lamp_DRL_CMD 		= 0;
uint32_t	GV_RC_Wiper_CMD 		= 0;

// Output_Data_Set_BCM_VCU_ACU_Signal1_CH1_0x570
uint32_t	GV_ACU_Lamp_RTRN		= 0;
uint32_t	GV_ACU_Lamp_Reverse 	= 0;
uint32_t	GV_ACU_Lamp_LTRN 		= 0;
uint32_t	GV_ACU_Lamp_Head 		= 0;
uint32_t	GV_ACU_Lamp_HBEAM 		= 0;
uint32_t	GV_ACU_Lamp_Hazard 		= 0;
uint32_t	GV_ACU_Lamp_BRAKE 		= 0;
uint32_t	GV_ACU_Status_Wiper 	= 0;
uint32_t	GV_ACU_BCM_CE1_STA 		= 0;
uint32_t	GV_ACU_BCM_CE2_STA 		= 0;
uint32_t	GV_ACU_BCM_CE3_STA 		= 0;
uint32_t	GV_ACU_BCM_CE4_STA 		= 0;
uint32_t	GV_ACU_BCM_CE5_STA 		= 0;
uint32_t	GV_ACU_BCM_MAINSW_STA	= 0;
float		GV_ACU_Battery_Voltage 	= 0;
uint32_t	GV_ACU_Lamp_DRL 		= 0;
uint32_t	GV_ACU_Lamp_Position 	= 0;
uint32_t	GV_ACU_BCM_VCU_counter1 = 0;
uint32_t	GV_ACU_BCM_VCU_CRC1 	= 0;
uint32_t	GV_ACU_BCM_Sys_Status 	= 0;
uint32_t	GV_ACU_LDC_STA 			= 0;

// Output_Data_Set_BCM_VCU_ACU_Signal5_CH1_0x585
uint32_t	GV_ACU_OBC_FltSta 		= 0;
uint32_t	GV_ACU_BMS_FltSta 		= 0;
uint32_t	GV_ACU_LDC_FltSta 		= 0;
uint32_t	GV_ACU_BCM_FltSta 		= 0;
uint32_t	GV_ACU_BMS_TEMP_FAULT 	= 0;
uint32_t	GV_ACU_LDC_TEMP_FAULT 	= 0;
uint32_t	GV_ACU_OBC_TEMP_FAULT 	= 0;
uint32_t	GV_ACU_BCM_VCU_counter5 = 0;
uint32_t	GV_ACU_BCM_VCU_CRC5 	= 0;

// Output_Data_Set_BCM_VCU_ACU_Signal3_CH1_0x590
uint8_t		GV_BCM_VCU_counter5 = 0;
uint8_t		GV_BCM_VCU_CRC5 	= 0;

// Output_Data_Set_BCM_VCU_ACU_Signal4_CH1_0x595
uint8_t		GV_BCM_VCU_counter4 = 0;
uint8_t		GV_BCM_VCU_CRC4 	= 0;

// Output_Data_Set_ICM_303h_CH1_0x303
uint16_t	GV_Speed_Combi = 0;

// Output_Data_Set_CGW_372h_CH1_0x372
uint8_t		GV_WelcomeSoundCmd = 0;
uint8_t		GV_GoodbyeSoundCmd = 0;

// Output_Data_Set_VCU_3ACh_CH1_0x3AC
uint8_t		GV_Charging_Sts_IND = 0;

// Output_Data_Set_CGW_588h_CH1_0x588
uint8_t		GV_VC_DOM = 0;


/*------------------------------ CH2 ------------------------------*/
// Output_Data_Set_BSC_IDB_StartupCommand_CH2_0x032
uint32_t	GV_Arc 			= 0;
uint32_t	GV_Crc 			= 0;
uint32_t	GV_WakeUpCommand= 0;

uint8_t		GV_IDB_032_Arc 			= 0;
uint8_t		GV_IDB_032_Crc 			= 0;
uint8_t		GV_IDB_032_WakeUpCommand= 0;

// Output_Data_Set_BSC_RWA_RackCommand_CH2_0x040
uint32_t	GV_RWA_040_Arc				= 0;
uint32_t	GV_RWA_040_Crc 				= 0;
float		GV_RWA_040_RackAngleCmd 	= 0;
uint8_t		GV_RWA_040_RackAngleCmdValid= 0;

// Output_Data_Set_BSC_IDB_BrakeCommand_CH2_0x064
uint32_t 	GV_BrakeHoldRequest  		= 0;
float 		GV_IDB_BrakeTorqueCommand	= 0;
uint32_t 	GV_DriveTorqueCommand		= 0;
uint32_t 	GV_DriveTorqueCommandValid 	= 0;
uint32_t 	GV_EscActivation 			= 0;
uint32_t 	GV_GearPosition 			= 0;
uint32_t 	GV_ParkBrakeRequest 		= 0;
uint32_t 	GV_PowertrainMode 			= 0;
uint32_t 	GV_RbcActivation 			= 0;
uint32_t 	GV_Reserved1 				= 0;
uint32_t 	GV_Reserved2 				= 0;
uint32_t 	GV_RopActivation 			= 0;
uint32_t 	GV_TcsActivation 			= 0;
uint8_t 	GV_IDB_064_Crc = 0;
uint8_t 	GV_IDB_064_Arc = 0;

// Output_Data_Set_BSC_RegenCommand_CH2_0x06A
uint32_t	GV_BSC_06A_ActualMotorTorque 			= 0;
uint32_t	GV_BSC_06A_ActualMotorTorqueValid 		= 0;
uint32_t	GV_BSC_06A_Arc 							= 0;
uint32_t	GV_BSC_06A_Crc 							= 0;
uint32_t	GV_BSC_06A_MaxAvailableRegenTorque		= 0;
uint32_t	GV_BSC_06A_MaxAvailableRegenTorqueValid = 0;
uint32_t	GV_BSC_06A_TractionMotorFault 			= 0;

// Output_Data_Set_BSC_IMU_CH2_0x070
uint8_t		GV_IMU_070_Arc 							= 0;
uint8_t		GV_IMU_070_Crc 							= 0;
float		GV_IMU_070_LateralAcceleration 			= 0;
uint8_t		GV_IMU_070_LateralAccelerationValid 	= 0;
float		GV_IMU_070_LongitudinalAcceleration 	= 0;
uint8_t		GV_IMU_070_LongitudinalAccelerationValid= 0;
float		GV_IMU_070_VehicleSpeed 				= 0;
uint8_t		GV_IMU_070_VehicleSpeedValid 			= 0;
float		GV_IMU_070_VehicleYawRate 				= 0;
uint8_t		GV_IMU_070_VehicleYawRateValid 			= 0;

// Output_Data_Set_BSC_RWA_StartupCommand_CH2_0x310
uint8_t		GV_RWA_310_Arc 			= 0;
uint8_t		GV_RWA_310_Crc 			= 0;
uint8_t		GV_RWA_310_ModeCommand 	= 0;
uint8_t		GV_RWA_310_WakeupCommand= 0;

// Output_Data_Set_BSC_RWA_Sister_CH2_0x350
uint32_t	GV_RWA_350_Arc 			= 0;
uint32_t	GV_RWA_350_Crc 			= 0;
uint8_t		GV_RWA_350_EcuPowerMode = 0;
uint8_t		GV_RWA_350_EcuRole 		= 0;
uint8_t		GV_RWA_350_EcuStatus 	= 0;

// Output_Data_Set_BSC_VehicleEnvironment_CH2_0x384
uint8_t		GV_Env_384_Arc 							= 0;
uint8_t		GV_Env_384_Crc 							= 0;
uint8_t		GV_Env_384_EnvironmentTemperature		= 0;
uint8_t		GV_Env_384_EnvironmentTemperatureValid 	= 0;
uint8_t		GV_Env_384_TimestampDay 				= 0;
uint8_t		GV_Env_384_TimestampHour 				= 0;
uint8_t		GV_Env_384_TimestampMinute 				= 0;
uint8_t		GV_Env_384_TimestampMonth 				= 0;
uint8_t		GV_Env_384_TimestampSecond 				= 0;
uint8_t		GV_Env_384_TimestampYear 				= 0;

/*------------------------------ CH3 ------------------------------*/
// Output_Data_Set_BSC_RCU_StartupCommand_CH3_0x033
uint8_t		GV_RCU_033_Arc 			= 0;
uint8_t		GV_RCU_033_Crc 			= 0;
uint8_t		GV_RCU_033_WakeUpCommand= 0;

// Output_Data_Set_BSC_RWA_RackCommand_CH3_0x040
uint32_t	GV_RWA2_040_Arc 				= 0;
uint32_t	GV_RWA2_040_Crc 				= 0;
float		GV_RWA2_040_RackAngleCmd 		= 0;
uint8_t		GV_RWA2_040_RackAngleCmdValid 	= 0;

// Output_Data_Set_BSC_RCU_BrakeCommand_CH3_0x065
uint8_t 	GV_RCU_065_Crc  			= 0;
uint8_t 	GV_RCU_065_Arc  			= 0;
uint32_t 	GV_RCU_BrakeHoldRequest 	= 0;
float 		GV_RCU_BrakeTorqueCommand 	= 0;
uint32_t 	GV_RCU_EscActivation 		= 0;
uint32_t 	GV_RCU_GearPosition 		= 0;
uint32_t 	GV_RCU_ParkBrakeRequest 	= 0;
uint32_t 	GV_RCU_PowertrainMode 		= 0;
uint32_t 	GV_RCU_Reserved1 			= 0;
uint32_t 	GV_RCU_Reserved2 			= 0;

// Output_Data_Set_BSC_IMU_CH3_0x071
uint8_t		GV_IMU_071_Arc 							= 0;
uint8_t		GV_IMU_071_Crc 							= 0;
float		GV_IMU_071_LateralAcceleration 			= 0;
uint8_t		GV_IMU_071_LateralAccelerationValid 	= 0;
float		GV_IMU_071_LongitudinalAcceleration 	= 0;
uint8_t		GV_IMU_071_LongitudinalAccelerationValid= 0;
float		GV_IMU_071_VehicleSpeed 				= 0;
uint8_t		GV_IMU_071_VehicleSpeedValid 			= 0;
float		GV_IMU_071_VehicleYawRate 				= 0;
uint8_t		GV_IMU_071_VehicleYawRateValid 			= 0;

// Output_Data_Set_BSC_RWA_StartupCommand_CH3_0x310
uint8_t	GV_RWA2_310_Arc 			= 0;
uint8_t	GV_RWA2_310_Crc 			= 0;
uint8_t	GV_RWA2_310_ModeCommand 	= 0;
uint8_t	GV_RWA2_310_WakeupCommand 	= 0;


// Output_Data_Set_BSC_RWA_Sister_CH3_0x350
uint32_t	GV_RWA2_350_Arc 		= 0;
uint32_t	GV_RWA2_350_Crc 		= 0;
uint8_t		GV_RWA2_350_EcuPowerMode= 0;
uint8_t		GV_RWA2_350_EcuRole 	= 0;
uint8_t		GV_RWA2_350_EcuStatus 	= 0;


// Output_Data_Set_BSC_VehicleEnvironment_CH3_0x385
uint8_t	GV_Env_385_Arc 							= 0;
uint8_t	GV_Env_385_Crc 							= 0;
uint8_t	GV_Env_385_EnvironmentTemperature 		= 0;
uint8_t	GV_Env_385_EnvironmentTemperatureValid 	= 0;
uint8_t	GV_Env_385_TimestampDay 				= 0;
uint8_t	GV_Env_385_TimestampHour 				= 0;
uint8_t	GV_Env_385_TimestampMinute 				= 0;
uint8_t	GV_Env_385_TimestampMonth 				= 0;
uint8_t	GV_Env_385_TimestampSecond 				= 0;
uint8_t	GV_Env_385_TimestampYear 				= 0;


/*------------------------------ CH4 ------------------------------*/
// Output_Data_Set_VCU_RWS_Rack_Cmd_CH4_0x040
uint32_t	GV_RWS1_040_Arc 				= 0;
uint32_t	GV_RWS1_040_Crc 				= 0;
float		GV_RWS1_040_RackAngleCmd 		= 0;
uint8_t		GV_RWS1_040_RackAngleCmdValid 	= 0;


// Output_Data_Set_VCU_RWS_StartupCommand_CH4_0x310
uint8_t		GV_RWS1_310_Arc 			= 0;
uint8_t		GV_RWS1_310_Crc 			= 0;
uint8_t		GV_RWS1_310_ModeCommand 	= 0;
uint8_t		GV_RWS1_310_WakeupCommand 	= 0;


// Output_Data_Set_VCU_RWA_Sister_CH4_0x350
uint8_t		GV_RWS1_350_Arc 		= 0;
uint8_t		GV_RWS1_350_Crc 		= 0;
uint8_t		GV_RWS1_350_EcuPowerMode= 0;
uint8_t		GV_RWS1_350_EcuRole 	= 0;
uint8_t		GV_RWS1_350_EcuStatus 	= 0;




/*------------------------------ CH5 ------------------------------*/
// Output_Data_Set_VCU_RWS_Rack_Cmd_CH5_0x040
uint32_t	GV_RWS2_040_Arc 				= 0;
uint32_t	GV_RWS2_040_Crc 				= 0;
float		GV_RWS2_040_RackAngleCmd 		= 0;
uint8_t		GV_RWS2_040_RackAngleCmdValid 	= 0;


// Output_Data_Set_VCU_RWS_StartupCommand_CH5_0x310
uint8_t		GV_RWS2_310_Arc 			= 0;
uint8_t		GV_RWS2_310_Crc 			= 0;
uint8_t		GV_RWS2_310_ModeCommand 	= 0;
uint8_t		GV_RWS2_310_WakeupCommand 	= 0;


// Output_Data_Set_VCU_RWS_Sister_CH5_0x350
uint32_t	GV_RWS2_350_Arc 		= 0;
uint32_t	GV_RWS2_350_Crc 		= 0;
uint8_t		GV_RWS2_350_EcuPowerMode= 0;
uint8_t		GV_RWS2_350_EcuRole 	= 0;
uint8_t		GV_RWS2_350_EcuStatus 	= 0;




/*======================================== Etc. ========================================*/
uint8_t		GV_Key_Off_Level = 0;
uint8_t 	GV_All_ECU_Ready_Flag = 0;	// 시동 시퀀스 중 사용되는 변수
uint8_t 	GV_ALL_ECU_Off_Flag = 0;	// 시동 시퀀스 중 사용되는 변수

uint8_t 	GV_Charging_Mode = 0; // 충전상태 확인 변수

uint8_t 	GV_EPAM_CMD = 0; // epam 명령 변수
uint8_t 	GV_EPAM_STA = 0; // epam 확인 변수 // epam은 없음 흔적임

uint8_t 	GV_BCM_Init_Status 	= 100; //Input_Data_Set_BCM_VCU_Signal1_CH0_0x570
uint8_t 	GV_BMS_Init_Status 	= 0;
uint8_t 	GV_MCU_Init_Status 	= 0;
uint8_t 	GV_Steer_Init_Status= 0;
uint8_t 	GV_Brake_Init_Status= 0;
uint8_t 	GV_ACU_Init_Status 	= 0;

uint8_t 	GV_Gear_Position = 0;

// Input_Data_Set_BCM_VCU_Signal1_CH0_0x570 , Output_Data_Set_BCM_VCU_ACU_Signal1_CH1_0x570
uint8_t 	GV_VCU_Ignition = 0;	// Ignition
uint8_t 	GV_IG_Process_Status = 1;

uint8_t 	GV_BMS_Fault_Check 	= 0;
uint8_t 	GV_OBC_Fault_Check 	= 0;
uint8_t 	GV_LDC_Fault_Check 	= 0;
uint8_t 	GV_MCU_Fault_Check	= 100;
uint8_t 	GV_HV_Apply_Check 	= 0;	// HV ON Status
uint8_t		GV_LDC_Apply_Check 	= 0;
uint16_t 	Timer_t 			= 0;

uint8_t 	GV_Emergency_Stop_SW = 0;

// Input_Data_Set_ACU_BCM_Signal_1_CH1_0x151, Output_Data_Set_VCU_BCM_Signal_1_CH0_0x151

uint8_t 	GV_PWM_CH1 = 50;
uint8_t 	GV_PWM_CH2 = 80;
uint16_t 	GV_DIN_CH1 = 0;
uint16_t 	GV_DIN_CH2 = 0;
uint16_t 	CE_COMMAND = 0; //CAN ON OFF

//----BMS
uint8_t 	GV_SOC_STAT_Flag= 0;
float 		GV_SOC_Value 	= 0;

uint16_t 	GV_init_M_Torq 				= 0;
uint16_t 	GV_MCU_CNT_NOW 				= 0;
uint16_t 	GV_MCU_CNT_PAST 			= 0;
uint16_t 	GV_No_signal_CH0_0x300_CNT 	= 0;
uint16_t 	GV_No_signal_CH0_0x301_CNT 	= 0;
uint16_t 	GV_CH0_0x300_CNT 			= 0;
uint16_t 	GV_CH0_0x301_CNT 			= 0;
uint16_t 	GV_Any_Signal_MCU 			= 0;
float 		GV_SoC_Torq_Limit 			= 0;

// BCM
uint8_t 	GV_LAMP_ON_OFF_Flag 	= 0;
uint8_t 	GV_WIPER_CMD 			= 0;
uint8_t 	GV_Any_Signal_BCM 		= 0;
uint8_t 	GV_No_signal_CH0_0x570 	= 0;
uint8_t 	GV_No_signal_CH0_0x580 	= 0;
uint8_t 	GV_No_signal_CH0_0x590 	= 0;
uint8_t 	GV_No_signal_CH0_0x595 	= 0;
uint8_t 	GV_No_signal_CH0_0x585 	= 0;
uint8_t 	GV_BCM_CNT_PAST 		= 0;
uint8_t 	GV_BCM_CNT_NOW  		= 0;
uint8_t 	GV_CH0_0x570_CNT  		= 0;
uint8_t 	GV_CH0_0x580_CNT  		= 0;
uint8_t 	GV_CH0_0x590_CNT 		= 0;
uint8_t 	GV_CH0_0x595_CNT  		= 0;
uint8_t 	GV_CH0_0x585_CNT  		= 0;
uint8_t 	GV_can_rx_ldc_v  		= 0;
float 		GV_SoC_Torq_Gain  		= 1;

// Charging_Status
uint8_t 	GV_Charging_Status_val 			= 0;
uint8_t 	GV_Charging_Status_M_Torq 		= 0;
uint8_t 	GV_Charging_Status_Steer_Angle 	= 0;
uint16_t 	GV_Charging_Status_Breack_CMD 	= 0;

// RWA, RWS
uint16_t 	GV_RWA_RackAngleCmd	= 0;
uint16_t 	GV_RWS_RackAngleCmd = 0;

// dirve_mode
uint8_t 	GV_dirve_mode  = 0;

// Emergency
uint8_t 	Emergency_stop_flag = 0;

// CNT for logic
uint16_t 	CNT_GV_HV_ON_CMD = 0;
uint8_t 	CNT_LAMP_CMD  	= 0;
uint8_t 	GV_CNT_LAMP_FLAG= 0;

//T32  ӽ  RWA
float GV_T32_RC_RWA_RackAngleCommand= 0;
float GV_T32_RWA_RackAngleCommand	= 0;

//T32  ӽ  RWS
float GV_RC_RWS_RackAngleCommand	= 0;
float GV_T32_RWS_RackAngleCommand 	= 0;

//MCU
uint16_t 	Emergency_Switch = 0;
float 		GV_T32_BrakeTorqueCommand  = 0;

// HMI
uint32_t 	GV_Lamp_HMI1_CMD = 0;
uint32_t 	GV_Lamp_HMI2_CMD = 0;
uint32_t 	GV_Lamp_HMI3_CMD = 0;
uint32_t 	GV_Lamp_HMI4_CMD = 0;
uint32_t 	GV_Lamp_HMI5_CMD = 0;

// PWM  汤    ۵
uint8_t 	GV_PWM_1 = 0;
uint8_t 	GV_PWM_2 = 0;

//       ޱ۽  ǵ
float    	Cur_RWA_RACK_ANGLE		     	= 0;
float    	Cur_RWS_RACK_ANGLE		    	= 0;
float  		Cur_CLMAP_FORCE		    		= 0;
float  		GV_MASTER_CLMAP_FORCE			= 0;
float  		GV_MASTER_RWA_RackAngleCommand  = 0;
float  		GV_MASTER_RWS_RackAngleCommand  = 0;

// CAN_CHECK
uint32_t 	GV_CAR_RX_Arc		= 0;
uint8_t 	GV_CAN_ERR_TOGGLE  	= 0;

// STEERING_RATE
uint32_t 	GV_Tunning_Slewrate = 400;

//Break_Rate
uint32_t 	GV_Break_Slewrate = 1500;

float 		GV_VCU_Dynamics_TrqCmd = 0;

// Hill_GOIC_VAL
float 		GV_Hiil_BrakeTorqueCommand  = 0;
float 		GV_VCU_Hill_TrqCmd  = 0;
uint8_t 	GV_CAN_ALV_FAULT_FALG  = 0;

// RWA Limit
float 	GV_RWA_Limit = 500.;

// FAULT INJECTION
uint8_t     GV_Act_Fault_Exist = 0;
float       GV_Target_MCU_Out = 0;
float       GV_Target_IDB_Out = 0;
float       GV_Target_RWA_Out = 0;

// ECU Fault check
uint16_t	GV_ACU_ECU_Arc_ErrCnt = 0;
uint16_t	GV_ACU_ECU_Arc_ErrCnt1 = 0;
uint16_t	GV_ACU_ECU_Arc_ErrCnt2 = 0;
uint16_t	GV_ACU_ECU_Arc_ErrCnt3 = 0;
uint16_t	GV_IDB_ECU_Arc_ErrCnt = 0;
uint16_t	GV_RCU_ECU_Arc_ErrCnt = 0;
uint16_t	GV_RWA1_ECU_Arc_ErrCnt = 0;
uint16_t	GV_RWA2_ECU_Arc_ErrCnt = 0;
uint8_t		GV_prev_ACU_ECU_Arc = 0;
uint8_t		GV_prev_ACU_ECU_Arc1 = 0;
uint8_t		GV_prev_ACU_ECU_Arc2 = 0;
uint8_t		GV_prev_ACU_ECU_Arc3 = 0;
uint8_t		GV_prev_IDB_ECU_Arc = 0;
uint8_t		GV_prev_RCU_ECU_Arc = 0;
uint8_t		GV_prev_RWA1_ECU_Arc = 0;
uint8_t		GV_prev_RWA2_ECU_Arc = 0;
uint8_t		GV_ACU_ECU_Fault_Flag = 0;
uint8_t		GV_ACU_ECU_Fault_Flag1 = 0;
uint8_t		GV_ACU_ECU_Fault_Flag2 = 0;
uint8_t		GV_ACU_ECU_Fault_Flag3 = 0;
uint8_t		GV_ACU_ECU_Fault_Flag_Master = 0;
