Browse Source

更改为新的UDS诊断协议

CHENJIE-PC\QiXiang_CHENJIE 2 years ago
parent
commit
710d727028

+ 27 - 21
System/Vehicle/AppFunc.c

@@ -21,38 +21,45 @@
 void LockAndUnlockCtrl()
 {
 	static uint16 LockDelay = 0;
+	static uint16 UnlockDelay = 0;
 	static uint8 CtrlFlg = 0;
-	if (!ebcd_flg_ebcEolDone) //下线检测模式
+	if (ebcd_flg_ebcManCtrlEn) //手动控制使能
 	{
-		if(ebcd_st_lockSensor==1)//处于锁紧状态
+		if (ebcd_flg_ebcManCtrlMode==1)
 		{
-			LockDelay = LockDelay + 10;
-			if(LockDelay>5*1000)//锁紧状态超时5s,就解锁
+			if(ebcd_st_lockSensor==1)//处于锁紧状态
 			{
-				Control_Times++;
-				LockDelay = 0;
-				CtrlFlg = Unlock;
+				LockDelay = LockDelay + 10;
+				if(LockDelay>LockDelayTime)//锁紧状态超时就解锁
+				{
+					Control_Times++;
+					LockDelay = 0;
+					CtrlFlg = Unlock;
+				}
+			}
+			else if(ebcd_st_unlockSensor==1)//处于解锁状态
+			{
+				UnlockDelay = UnlockDelay + 10;
+				if(UnlockDelay>UnlockDelayTime)
+				{
+					UnlockDelay = 0;
+					CtrlFlg = Lock;
+				}
 			}
 		}
-		else if(ebcd_st_unlockSensor==1)//处于解锁状态
+		else if(ebcd_flg_ebcManCtrlMode==2)
 		{
 			CtrlFlg = Lock;
 		}
-	}
-	else //正常工作模式
-	{
-		if(bled_flg_lockCmd==1)
-		{
-			CtrlFlg = Lock;
-		}
-		else if(bled_flg_unlockCmd==1)
+		else if(ebcd_flg_ebcManCtrlMode==3)
 		{
 			CtrlFlg = Unlock;
 		}
-		else
-		{
-			CtrlFlg = Lock;
-		}
+
+	}
+	else //正常工作模式,暂时为空
+	{
+
 	}
 	//锁紧解锁执行
 	if(CtrlFlg)
@@ -71,7 +78,6 @@ void LockAndUnlockCtrl()
  */
 void GetHVLockState(void)
 {
-	UINT8 m_flg_HVlock1 = 0, m_flg_HVlock2 = 0;
 	// PWM输出,互锁1检测,频率100HZ,占空比30%
 	uint16 VehCo_fTestUI = 1000;
 	uint16 VehCo_rTestUW = 3000;

+ 255 - 3
System/Vehicle/Communication/BleCanProtocolFunc.c

@@ -624,10 +624,9 @@ void Can2ProtocolDecode(uint32 Can2ID,uint8 Data[])
         }
         break;
     }
-    case 0x1CEF00F1:
+    case 0x1C00ECEA://UDS检测ID
     {
-    	ebcd_flg_ebcEolDone = Data[0];//下线检测完成(取消定时解锁)暂时放这里
-    	EEPROMDrv_bSaveInstantUB = 1;
+    	Uds_Service(Data);
     	break;
     }
     default:
@@ -758,3 +757,256 @@ void Can2DataDecode(uint8 Data[])
         break;
     }
 }
+uint8 udsMode = 0;//uds 模式
+uint32 EbcAppSw = 0x00000101;
+void Uds_Service(uint8 *Data)
+{
+	UdsAnsType UdsAns;
+	memset((uint8 *)&UdsAns,0x00,sizeof(UdsAns));
+	UdsAns.UdsSer = *(Data+0);
+	UdsAns.UdsSubSer = *(Data+1);
+	switch(UdsAns.UdsSer)
+	{
+	case 0x10://模式选择
+	{
+		if(*(Data+1)==0x01)
+		{
+			udsMode = 1;
+			UdsPosAns(UdsAns);
+		}
+		else if(*(Data+1)==0x02)
+		{
+			if(udsMode==1||udsMode==2)
+			{
+				udsMode = 2;
+				UdsPosAns(UdsAns);
+			}
+			else
+			{
+				udsMode = 0;
+				UdsNegAns(UdsAns);
+			}
+		}
+		else
+		{
+			udsMode = 0;
+			UdsNegAns(UdsAns);
+		}
+		break;
+	}
+	case 0x22://查询
+	{
+		if(udsMode==2)
+		{
+			switch(UdsAns.UdsSubSer)
+			{
+			case 0x01://版本号查询
+			{
+				UdsAns.Seq = 0;
+				UdsAns.Data1 = EbcAppSw>>24;
+				UdsAns.Data2 = EbcAppSw>>16;
+				UdsAns.Data3 = EbcAppSw>>8;
+				UdsAns.Data4 = EbcAppSw;
+				UdsPosAns(UdsAns);
+				break;
+			}
+			case 0x02://解锁状态查询
+			{
+				UdsAns.Seq = 0;
+				UdsAns.Data1 = ebcd_st_unlockSensor;
+				UdsAns.Data2 = 0x00;
+				UdsAns.Data3 = 0x00;
+				UdsAns.Data4 = 0x00;
+				UdsPosAns(UdsAns);
+				break;
+			}
+			case 0x03://锁紧状态查询
+			{
+				UdsAns.Seq = 0;
+				UdsAns.Data1 = ebcd_st_lockSensor;
+				UdsAns.Data2 = 0x00;
+				UdsAns.Data3 = 0x00;
+				UdsAns.Data4 = 0x00;
+				UdsPosAns(UdsAns);
+				break;
+			}
+			case 0x04://落座状态查询
+			{
+				UdsAns.Seq = 0;
+				UdsAns.Data1 = ebcd_st_pedstSensor;
+				UdsAns.Data2 = 0x00;
+				UdsAns.Data3 = 0x00;
+				UdsAns.Data4 = 0x00;
+				UdsPosAns(UdsAns);
+				break;
+			}
+			case 0x05://互锁状态查询
+			{
+				UdsAns.Seq = 0;
+				UdsAns.Data1 = ((m_flg_HVlock1&0x01)<<1)|(m_flg_HVlock2&0x01);
+				UdsAns.Data2 = 0x00;
+				UdsAns.Data3 = 0x00;
+				UdsAns.Data4 = 0x00;
+				UdsPosAns(UdsAns);
+				break;
+			}
+			case 0x06://气压值查询
+			{
+				UdsAns.Seq = 0;
+				UdsAns.Data1 = ebcd_P_airSensor;
+				UdsAns.Data2 = 0x00;
+				UdsAns.Data3 = 0x00;
+				UdsAns.Data4 = 0x00;
+				UdsPosAns(UdsAns);
+				break;
+			}
+			case 0x07://锁紧压力查询
+			{
+				UdsAns.Seq = 0;
+				UdsAns.Data1 = Test_LockPressure>>8;
+				UdsAns.Data2 = Test_LockPressure;
+				UdsAns.Data3 = 0x00;
+				UdsAns.Data4 = 0x00;
+				UdsPosAns(UdsAns);
+				break;
+			}
+			case 0x08://锁紧次数查询
+			{
+				UdsAns.Seq = 0;
+				UdsAns.Data1 = Test_LockPressure>>8;
+				UdsAns.Data2 = Test_LockPressure;
+				UdsAns.Data3 = 0x00;
+				UdsAns.Data4 = 0x00;
+				UdsPosAns(UdsAns);
+				break;
+			}
+			case 0x09://温度数据查询
+			{
+				UdsAns.Seq = 0;
+				UdsAns.Data1 = ebcd_T_plugin[0];
+				UdsAns.Data2 = ebcd_T_plugin[1];
+				UdsAns.Data3 = ebcd_T_plugin[2];
+				UdsAns.Data4 = ebcd_T_plugin[3];
+				UdsPosAns(UdsAns);
+				break;
+			}
+			default:
+				UdsNegAns(UdsAns);
+				break;
+			}
+		}
+		else
+		{
+			UdsNegAns(UdsAns);
+		}
+		break;
+	}
+	case 0x27://控制
+	{
+		if(udsMode==2)
+		{
+			switch(UdsAns.UdsSubSer)
+			{
+			case 0x01://循环测试开启
+			{
+				ebcd_flg_ebcManCtrlEn = 1;
+				ebcd_flg_ebcManCtrlMode = 1;
+				UdsPosAns(UdsAns);
+				break;
+			}
+			case 0x02:
+			{
+				ebcd_flg_ebcManCtrlEn = 1;
+				ebcd_flg_ebcManCtrlMode = 2;
+				UdsPosAns(UdsAns);
+				break;
+			}
+			case 0x03:
+			{
+				ebcd_flg_ebcManCtrlEn = 1;
+				ebcd_flg_ebcManCtrlMode = 3;
+				UdsPosAns(UdsAns);
+				break;
+			}
+			default:
+				UdsNegAns(UdsAns);
+				break;
+			}
+		}
+		else
+		{
+			UdsNegAns(UdsAns);
+		}
+		break;
+	}
+	case 0x2E://写入
+	{
+		if(udsMode==2)
+		{
+			switch(UdsAns.UdsSubSer)
+			{
+			case 0x01:
+			{
+				LockDelayTime = (*(Data+4)<<8)|*(Data+5);
+				UdsPosAns(UdsAns);
+				EEPROMDrv_bSaveInstantUB = 1;
+				break;
+			}
+			case 0x02:
+			{
+				UnlockDelayTime = (*(Data+4)<<8)|*(Data+5);
+				UdsPosAns(UdsAns);
+				EEPROMDrv_bSaveInstantUB = 1;
+				break;
+			}
+			default:
+				UdsNegAns(UdsAns);
+				break;
+			}
+		}
+		else
+		{
+			UdsNegAns(UdsAns);
+		}
+		break;
+	}
+	default:
+		break;
+	}
+}
+void UdsPosAns(UdsAnsType UdsAnsData)
+{
+	MCANDrv_infoMsgS_TYPE infoMsgS;
+	infoMsgS.infoConfS.infoMsgParU.B.CAN=2;
+	infoMsgS.infoConfS.infoMsgParU.B.DIR = _MCAN_DIR_TX;
+	infoMsgS.infoConfS.infoMsgParU.B.DLC = 8;
+	infoMsgS.infoConfS.infoMsgParU.B.IDE = _MCAN_IDE_EXT;
+	infoMsgS.infoConfS.infoMsgIDUI = 0x1C00EAECUL;
+	infoMsgS.datMsgUBA[0] = 0x78;
+	infoMsgS.datMsgUBA[1] = UdsAnsData.UdsSer;
+	infoMsgS.datMsgUBA[2] = UdsAnsData.UdsSubSer;
+	infoMsgS.datMsgUBA[3] = UdsAnsData.Seq;
+	infoMsgS.datMsgUBA[4] = UdsAnsData.Data1;
+	infoMsgS.datMsgUBA[5] = UdsAnsData.Data2;
+	infoMsgS.datMsgUBA[6] = UdsAnsData.Data3;
+	infoMsgS.datMsgUBA[7] = UdsAnsData.Data4;
+	MCANDrv_SendMsg(infoMsgS);
+}
+void UdsNegAns(UdsAnsType UdsAnsData)
+{
+	MCANDrv_infoMsgS_TYPE infoMsgS;
+	infoMsgS.infoConfS.infoMsgParU.B.CAN=2;
+	infoMsgS.infoConfS.infoMsgParU.B.DIR = _MCAN_DIR_TX;
+	infoMsgS.infoConfS.infoMsgParU.B.DLC = 8;
+	infoMsgS.infoConfS.infoMsgParU.B.IDE = _MCAN_IDE_EXT;
+	infoMsgS.infoConfS.infoMsgIDUI = 0x1C00EAECUL;
+	infoMsgS.datMsgUBA[0] = 0x7F;
+	infoMsgS.datMsgUBA[1] = UdsAnsData.UdsSer;
+	infoMsgS.datMsgUBA[2] = UdsAnsData.UdsSubSer;
+	infoMsgS.datMsgUBA[3] = 0x00;
+	infoMsgS.datMsgUBA[4] = 0x00;
+	infoMsgS.datMsgUBA[5] = 0x00;
+	infoMsgS.datMsgUBA[6] = 0x00;
+	infoMsgS.datMsgUBA[7] = 0x00;
+	MCANDrv_SendMsg(infoMsgS);
+}

+ 11 - 0
System/Vehicle/Communication/BleCanProtocolFunc.h

@@ -17,6 +17,17 @@
 #include "CanVar.h"
 #ifndef SYSTEM_VEHICLE_CANPROTOCOL_H_
 #define SYSTEM_VEHICLE_CANPROTOCOL_H_
+typedef struct
+{
+	uint8 UdsSer;
+	uint8 UdsSubSer;
+	uint8 Seq;
+	uint8 Data1;
+	uint8 Data2;
+	uint8 Data3;
+	uint8 Data4;
+} UdsAnsType;
+void UdsPosAns(UdsAnsType UdsAnsData);
 void Can2ProtocolCode(uint8 CmdIdx,uint8 DataIdx,uint8 Byte0Num,uint32 *InnerCanID,uint8 *Data);
 void Can2ProtocolDecode(uint32 Can2ID,uint8 Data[]);
 void Can2DataCode(uint8 DataIdx, uint8 Byte0Num,uint8 Data[]);

+ 2 - 159
System/Vehicle/Communication/CANNet.c

@@ -49,7 +49,7 @@ void CANNet_Init(void)
 	CANNet_InfoRxMsgConfSA[0].infoMsgParU.B.IDE = _MCAN_IDE_EXT;
 	MCANDrv_SetMsgObj(CANNet_InfoRxMsgConfSA[0], CANNet_RecvMsgCAN2);
 
-	CANNet_InfoRxMsgConfSA[1].infoMsgIDUI = 0x1CEF00F1UL;
+	CANNet_InfoRxMsgConfSA[1].infoMsgIDUI = 0x1C00ECEAUL;
 	CANNet_InfoRxMsgConfSA[1].infoMsgParU.B.CAN = 2;
 	CANNet_InfoRxMsgConfSA[1].infoMsgParU.B.MO = 4;
 	CANNet_InfoRxMsgConfSA[1].infoMsgParU.B.DIR = _MCAN_DIR_RX;
@@ -85,67 +85,17 @@ void CANNet_Init(void)
 // CAN0接收消息处理函数 VCU
 void CANNet_RecvMsgCAN0(MCANDrv_infoMsgS_TYPE infoMsgS)
 {
-	// CAN接收样例
-	//	uint8 idxIncUB, idxByteUB;
-	//	for (idxIncUB = 0; idxIncUB < 128; idxIncUB++)
-	//	{
-	//		if (infoMsgS.infoConfS.infoMsgIDUI == CANNet_InfoRxMsgConfSA[idxIncUB].infoMsgIDUI)
-	//		{
-	//			for (idxByteUB = 0; idxByteUB < 8; idxByteUB++)
-	//			{
-	//				CANNet_datRxMsgBufM[idxIncUB][idxByteUB] = infoMsgS.datMsgUBA[idxByteUB];
-	//			}
-	//			CANNet_datRxMsgBufM[idxIncUB][8]++;
-	//		}
-	//	}
 	VcuDecodeFunction(infoMsgS.infoConfS.infoMsgIDUI, infoMsgS.datMsgUBA);
 }
 // CAN1接收消息处理函数
 void CANNet_RecvMsgCAN1(MCANDrv_infoMsgS_TYPE infoMsgS)
 {
-	// CAN接收样例
-	//	uint8 idxIncUB, idxByteUB;
-	//	for (idxIncUB = 0; idxIncUB < 128; idxIncUB++)
-	//	{
-	//		if (infoMsgS.infoConfS.infoMsgIDUI == CANNet_InfoRxMsgConfSA[idxIncUB].infoMsgIDUI)
-	//		{
-	//			for (idxByteUB = 0; idxByteUB < 8; idxByteUB++)
-	//			{
-	//				CANNet_datRxMsgBufM[idxIncUB][idxByteUB] = infoMsgS.datMsgUBA[idxByteUB];
-	//			}
-	//
-	//			CANNet_datRxMsgBufM[idxIncUB][8]++;
-	//		}
-	//	}
 	BcuDecodeFunction(infoMsgS.infoConfS.infoMsgIDUI, infoMsgS.datMsgUBA);
 }
 /*备注,CAN2接收报文时,需要配置接收报文的MO号,如果不配置,将进入不了CAN中断*/
 void CANNet_RecvMsgCAN2(MCANDrv_infoMsgS_TYPE infoMsgS)
 {
-#ifdef _APP_RELEASE_CODE
 	Can2ProtocolDecode(infoMsgS.infoConfS.infoMsgIDUI, infoMsgS.datMsgUBA);
-#endif
-#ifdef _APP_TEST_MOTOR_CODE
-	switch (infoMsgS.infoConfS.infoMsgIDUI)
-	{
-	case 0x0000007E3:
-	{
-		MotorControlEnable = infoMsgS.datMsgUBA[0] & 0x0F;
-		MotorControlCmd = (infoMsgS.datMsgUBA[0] & 0xF0) >> 4;
-		MotorDebugCmd = infoMsgS.datMsgUBA[1] & 0xFF;
-		MotorLifeTestCmd = infoMsgS.datMsgUBA[2] & 0xFF;
-		break;
-	}
-	case 0x0000007E4:
-	{
-		LockDelay = MAX((UINT16)((infoMsgS.datMsgUBA[1] << 8) | (infoMsgS.datMsgUBA[0])), 100);
-		RunFailedDelay = MAX((UINT16)(((infoMsgS.datMsgUBA[3] << 8) | infoMsgS.datMsgUBA[2])), 1000);
-		break;
-	}
-	default:
-		break;
-	}
-#endif
 }
 //发送消息管理
 void CAN0Net_Manage1ms(void)
@@ -211,7 +161,7 @@ void CAN2Net_Manage1ms(void)
 	MCANDrv_infoMsgS_TYPE infoMsgS;
 	static UINT32 Can2TimerCounter = 0;
 	Can2TimerCounter = Can2TimerCounter + 1;
-#ifdef _APP_RELEASE_CODE
+
 	uint8 cmdIdx = 0x00;
 	uint8 DataIdx = 0x00;
 	static uint8 AnsNum = 0x00; //应答次数
@@ -235,111 +185,4 @@ void CAN2Net_Manage1ms(void)
 			ebcd_flg_Can2SendEnbale = FALSE;
 		}
 	}
-	else if (Can2TimerCounter % 100 == 1)
-	{
-		CANNet_infoMsgTxConfSA[2].infoMsgIDUI = 0x1CEE00F0;
-		infoMsgS.infoConfS = CANNet_infoMsgTxConfSA[2];
-		infoMsgS.datMsgUBA[0] = (uint8)(ebcd_st_lockSensor | (ebcd_st_unlockSensor << 4));
-		infoMsgS.datMsgUBA[1] = ebcd_st_pedstSensor;
-		infoMsgS.datMsgUBA[2] = ebcd_P_airSensor;
-		infoMsgS.datMsgUBA[3] = ebcd_flg_ebcEolDone;
-		infoMsgS.datMsgUBA[4] = ebcd_T_plugin[0];
-		infoMsgS.datMsgUBA[5] = ebcd_T_plugin[1];
-		infoMsgS.datMsgUBA[6] = ebcd_T_plugin[2];
-		infoMsgS.datMsgUBA[7] = ebcd_T_plugin[3];
-		MCANDrv_SendMsg(infoMsgS);
-	}
-	else if (Can2TimerCounter % 100 == 2)
-	{
-		CANNet_infoMsgTxConfSA[2].infoMsgIDUI = 0x1CEE00F1;
-		infoMsgS.infoConfS = CANNet_infoMsgTxConfSA[2];
-		infoMsgS.datMsgUBA[0] = Control_Times;
-		infoMsgS.datMsgUBA[1] = Control_Times>>8;
-		infoMsgS.datMsgUBA[2] = Control_Times>>16;
-		infoMsgS.datMsgUBA[3] = Control_Times>>24;
-		infoMsgS.datMsgUBA[4] = Test_LockPressure;
-		infoMsgS.datMsgUBA[5] = Test_LockPressure>>8;
-		infoMsgS.datMsgUBA[6] = 0;
-		infoMsgS.datMsgUBA[7] = 0;
-		MCANDrv_SendMsg(infoMsgS);
-	}
-#endif
-#ifdef _APP_TEST_MOTOR_CODE
-	if (Can2TimerCounter % 100 == 1)
-	{
-		CANNet_infoMsgTxConfSA[2].infoMsgIDUI = 0x7F3;
-		infoMsgS.infoConfS = CANNet_infoMsgTxConfSA[2];
-		infoMsgS.datMsgUBA[0] = (uint8)(ebcd_st_lockSensor | (ebcd_st_unlockSensor << 4));
-		infoMsgS.datMsgUBA[1] = MotorControlEnable;
-		infoMsgS.datMsgUBA[2] = MotorControlCmd;
-		infoMsgS.datMsgUBA[3] = MotorDebugCmd;
-		infoMsgS.datMsgUBA[4] = MotorControlLockNum;
-		infoMsgS.datMsgUBA[5] = MotorControlunLockNum;
-		infoMsgS.datMsgUBA[6] = ebcd_P_airSensor;
-		infoMsgS.datMsgUBA[7] = ebcd_P_airSensor >> 8;
-		MCANDrv_SendMsg(infoMsgS);
-	}
-	else if (Can2TimerCounter % 100 == 2)
-	{
-		CANNet_infoMsgTxConfSA[2].infoMsgIDUI = 0x7F4;
-		infoMsgS.infoConfS = CANNet_infoMsgTxConfSA[2];
-		infoMsgS.datMsgUBA[0] = LockDelay;
-		infoMsgS.datMsgUBA[1] = LockDelay >> 8;
-		infoMsgS.datMsgUBA[2] = RunFailedDelay;
-		infoMsgS.datMsgUBA[3] = RunFailedDelay >> 8;
-		infoMsgS.datMsgUBA[4] = LifeTestCounter;
-		infoMsgS.datMsgUBA[5] = LifeTestCounter >> 8;
-		infoMsgS.datMsgUBA[6] = 0x00;
-		infoMsgS.datMsgUBA[7] = 0x00;
-		MCANDrv_SendMsg(infoMsgS);
-	}
-	Can2TimerCounter = Can2TimerCounter + 1;
-#endif
-#ifdef _APP_TEST_CODE
-	switch (CANNet_idxSchedUB)
-	{
-	case 0:
-		CANNet_infoMsgTxConfSA[2].infoMsgIDUI = 0x7F0;
-		infoMsgS.infoConfS = CANNet_infoMsgTxConfSA[2];
-		infoMsgS.datMsgUBA[0] = (uint8)(PressureValue >> 24);
-		infoMsgS.datMsgUBA[1] = (uint8)(PressureValue >> 16);
-		infoMsgS.datMsgUBA[2] = (uint8)(PressureValue >> 8);
-		infoMsgS.datMsgUBA[3] = (uint8)(PressureValue >> 0);
-		infoMsgS.datMsgUBA[4] = (uint8)(Distence1 >> 8);
-		infoMsgS.datMsgUBA[5] = (uint8)(Distence1);
-		infoMsgS.datMsgUBA[6] = (uint8)(Distence2 >> 8);
-		infoMsgS.datMsgUBA[7] = (uint8)(Distence2);
-		MCANDrv_SendMsg(infoMsgS);
-		break;
-	case 1:
-		CANNet_infoMsgTxConfSA[2].infoMsgIDUI = 0x7F1;
-		infoMsgS.infoConfS = CANNet_infoMsgTxConfSA[2];
-		infoMsgS.datMsgUBA[0] = (uint8)(Switch1);
-		infoMsgS.datMsgUBA[1] = (uint8)(Switch2);
-		infoMsgS.datMsgUBA[2] = 0xFF;
-		infoMsgS.datMsgUBA[3] = 0xFF;
-		infoMsgS.datMsgUBA[4] = (uint8)(PressureValue >> 24);
-		infoMsgS.datMsgUBA[5] = (uint8)(PressureValue >> 16);
-		infoMsgS.datMsgUBA[6] = (uint8)(PressureValue >> 8);
-		infoMsgS.datMsgUBA[7] = (uint8)(PressureValue >> 0);
-		MCANDrv_SendMsg(infoMsgS);
-		break;
-	case 2:
-		CANNet_infoMsgTxConfSA[2].infoMsgIDUI = 0x7F2;
-		infoMsgS.infoConfS = CANNet_infoMsgTxConfSA[2];
-		infoMsgS.datMsgUBA[0] = ControlState;
-		infoMsgS.datMsgUBA[1] = 0xFF;
-		infoMsgS.datMsgUBA[2] = 0xFF;
-		infoMsgS.datMsgUBA[3] = 0xFF;
-		infoMsgS.datMsgUBA[4] = (uint8)(Control_Times >> 24);
-		infoMsgS.datMsgUBA[5] = (uint8)(Control_Times >> 16);
-		infoMsgS.datMsgUBA[6] = (uint8)(Control_Times >> 8);
-		infoMsgS.datMsgUBA[7] = (uint8)(Control_Times);
-		MCANDrv_SendMsg(infoMsgS);
-		break;
-	default:
-		break;
-	}
-	CANNet_idxSchedUB = (uint16)((CANNet_idxSchedUB + 1) % 100); // 100ms一个完整循环
-#endif
 }

+ 6 - 2
System/Vehicle/Communication/CanVar.c

@@ -730,13 +730,17 @@ uint8 ebcd_st_pedstSucJug;			 //
 uint8 ebcd_st_pluginLockSig;		 //互锁接插件信号具体状态,1-触发,0-无触发
 uint8 ebcd_st_unlockSensor;			 //解锁传感器信号:bit0-bit3:传感器0-3的状态每,bit:1-触发,0-不触发
 uint8 ebcd_st_unlockSucJug;			 //解锁完成判断:0-完全未解锁,1-完全解锁,2-未完全解锁
-
+uint8 m_flg_HVlock1 = 0;//互锁状态1
+uint8 m_flg_HVlock2 = 0;//互锁状态2
 uint16 Test_LockPressure = 0;//锁紧力测试
 
 #define EEPDATA_START_SEC_VAR
 #include "MemMap.h"
 uint32 Control_Times = 0;
-uint8 ebcd_flg_ebcEolDone = 0;		 // EBC下线检测状态完成标志位
+uint8 ebcd_flg_ebcManCtrlEn = 0;		 // EBC手动控制使能
+uint8 ebcd_flg_ebcManCtrlMode = 0;		 // EBC手动控制模式
+uint16 LockDelayTime = 0;//锁定延时时间(传感器到位以后延时多少时间确定为锁定成功
+uint16 UnlockDelayTime = 0;//解锁延时时间(传感器到位以后延时多少时间确定为解锁成功
 #define EEPDATA_STOP_SEC_VAR
 #include "MemMap.h"
 #define APPLAYERVER_START_SEC_VAR

+ 6 - 2
System/Vehicle/Communication/CanVar.h

@@ -557,12 +557,16 @@ extern uint8 ebcd_Num_faultCode;  // ebc
 extern uint8 ebcd_st_chargingMod; //充电模式,1-车载充电,2-换电站充电
 extern uint8 ebdc_st_lockUpState; //锁止机构状态,0-故障,1-解锁成功,2-上锁成功
 extern uint8 ebdc_st_ConnecState; //换电连接器状态(充电回路&放电回路同时闭合代表闭合,有一路断开则为断开),0_未连接 1_连接
-
+extern uint8 m_flg_HVlock1;//互锁状态1
+extern uint8 m_flg_HVlock2;//互锁状态2
 extern uint16 Test_LockPressure;
 
 #define EEPDATA_START_SEC_VAR
 #include "MemMap.h"
-extern uint8 ebcd_flg_ebcEolDone;		 // EBC下线检测状态完成标志位
+extern uint8 ebcd_flg_ebcManCtrlEn;		 // EBC手动控制使能
+extern uint8 ebcd_flg_ebcManCtrlMode;		 // EBC手动控制模式
+extern uint16 LockDelayTime;//锁定延时时间(传感器到位以后延时多少时间确定为锁定成功
+extern uint16 UnlockDelayTime;//解锁延时时间(传感器到位以后延时多少时间确定为解锁成功
 extern uint32 Control_Times;
 #define EEPDATA_STOP_SEC_VAR
 #include "MemMap.h"