Commit 86f96416 authored by 梁百峰's avatar 梁百峰

feat:增加发送步数

parent 5682ac8c
...@@ -2,62 +2,26 @@ ...@@ -2,62 +2,26 @@
void R485_Send_0x40(void) void R485_Send_0x40(void)
{ {
memset(R485_ID40h.Msg, 0, 64); memset(R485_ID40h.Msg, 0xFF, 64);
switch (HJ_OtherKeyCurrent.count) switch (HJ_OtherKeyCurrent.count)
{ {
case 0: case 0:
R485_ID40h.Sig.BackupZoneMainSoftwareVer = 1;
R485_ID40h.Sig.BOOTSoftwareUnderlyingVer = 1;
R485_ID40h.Sig.FlowCode4th = 1;
R485_ID40h.Sig.ProductModel1 = 1;
break; break;
case 1: case 1:
R485_ID40h.Sig.BackupZoneMainSoftwareVer = 0;
R485_ID40h.Sig.BOOTSoftwareUnderlyingVer = 0;
R485_ID40h.Sig.FlowCode4th = 0;
R485_ID40h.Sig.ProductModel1 = 0;
break; break;
case 2: case 2:
R485_ID40h.Sig.BackupZoneMainSoftwareVer = 1;
R485_ID40h.Sig.BOOTSoftwareUnderlyingVer = 1;
R485_ID40h.Sig.FlowCode4th = 1;
R485_ID40h.Sig.ProductModel1 = 1;
break; break;
case 3: case 3:
R485_ID40h.Sig.BackupZoneMainSoftwareVer = 0;
R485_ID40h.Sig.BOOTSoftwareUnderlyingVer = 0;
R485_ID40h.Sig.FlowCode4th = 0;
R485_ID40h.Sig.ProductModel1 = 0;
break; break;
case 4: case 4:
R485_ID40h.Sig.BackupZoneMainSoftwareVer = 1;
R485_ID40h.Sig.BOOTSoftwareUnderlyingVer = 1;
R485_ID40h.Sig.FlowCode4th = 1;
R485_ID40h.Sig.ProductModel1 = 1;
break; break;
case 5: case 5:
R485_ID40h.Sig.BackupZoneMainSoftwareVer = 0;
R485_ID40h.Sig.BOOTSoftwareUnderlyingVer = 0;
R485_ID40h.Sig.FlowCode4th = 0;
R485_ID40h.Sig.ProductModel1 = 0;
break; break;
case 6: case 6:
R485_ID40h.Sig.BackupZoneMainSoftwareVer = 1;
R485_ID40h.Sig.BOOTSoftwareUnderlyingVer = 1;
R485_ID40h.Sig.FlowCode4th = 1;
R485_ID40h.Sig.ProductModel1 = 1;
break; break;
case 7: case 7:
R485_ID40h.Sig.BackupZoneMainSoftwareVer = 0;
R485_ID40h.Sig.BOOTSoftwareUnderlyingVer = 0;
R485_ID40h.Sig.FlowCode4th = 0;
R485_ID40h.Sig.ProductModel1 = 0;
break; break;
case 8: case 8:
R485_ID40h.Sig.BackupZoneMainSoftwareVer = 1;
R485_ID40h.Sig.BOOTSoftwareUnderlyingVer = 1;
R485_ID40h.Sig.FlowCode4th = 1;
R485_ID40h.Sig.ProductModel1 = 1;
break; break;
case 9: case 9:
...@@ -70,106 +34,560 @@ void R485_Send_0x40(void) ...@@ -70,106 +34,560 @@ void R485_Send_0x40(void)
void R485_Send_0x41(void) void R485_Send_0x41(void)
{ {
memset(R485_ID41h.Msg, 0, 64); /**************0.437*********** */
/*wtemp *= 9177l;
wtemp /= 100;
wtemp *= 157;
wtemp /= 1000;*/
memset(R485_ID41h.Msg, 0xFF, 64);
R485_ID41h.Sig.VehicleStatus = 0x2;
R485_ID41h.Sig.MetricImperialSetting = 0;
R485_ID41h.Sig.CartMode = 0;
R485_ID41h.Sig.ReverseMode = 0;
R485_ID41h.Sig.RecuperationStatusFeedback = 0;
switch (HJ_OtherKeyCurrent.count) switch (HJ_OtherKeyCurrent.count)
{ {
case 0: case 0:
R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x0; // 自动大灯
R485_ID41h.Sig.ChargeState = 0x0; //充电状态
R485_ID41h.Sig.SlopePattern = 0x0; //跛行
R485_ID41h.Sig.CushionSensorStatus = 0x1; //坐垫压力
R485_ID41h.Sig.SlopeDescentFunctionStatus = 0x0; //陡坡缓降
R485_ID41h.Sig.TCSActivation = 0x1; //TCS激活
R485_ID41h.Sig.TCSFunctionalStatus = 0x0; //TCS状态
R485_ID41h.Sig.ElectronicCushionStatus = 0x1; //座桶开关
R485_ID41h.Sig.SupportSwitchSignalFeedback = 0x0; //边撑
R485_ID41h.Sig.CruiseMode = 0x0; //巡航
R485_ID41h.Sig.ICMCalculatesVehicleSpeed = 0; //速度 = (X * 0.512 * 3.14 * 1.05) / 30
// R485_ID41h.Sig.TotalBatterySOC = 0x0; //电量
// R485_ID41h.Sig.VehicleStatus = 0x0; //整车状态
// R485_ID41h.Sig.SpeedGear = 0x2; //挡位
R485_ID41h.Sig.IOTRealTime_Hour = 0; //时间:时
R485_ID41h.Sig.IOTRealTime_Minute = 0; //时间:分
R485_ID41h.Sig.IOTRealTime_Second = 0; //时间:秒
R485_ID41h.Sig.HandlebarFaultIndicator = 0;
R485_ID41h.Sig.UUpBridgeArmMosFault = 0;
R485_ID41h.Sig.UDownBridgeArmMosFault = 0;
R485_ID41h.Sig.VUpBridgeArmMosFault = 0;
R485_ID41h.Sig.VDownBridgeArmMosFault = 0;
R485_ID41h.Sig.WUpBridgeArmMosFault = 0;
R485_ID41h.Sig.WDownBridgeArmMosFault = 0;
R485_ID41h.Sig.MCUFaultStateU_PhaseHallFault = 0;
R485_ID41h.Sig.MCUFaultStateV_PhaseHallFault = 0;
R485_ID41h.Sig.MCUFaultStateW_PhaseHallFault = 0;
R485_ID41h.Sig.MCUFaultStatus_HandlebarFault = 0;
R485_ID41h.Sig.BMS_0CommunicationStatus = 0;
R485_ID41h.Sig.MCUCommunicationStatus = 0;
R485_ID41h.Sig.ALMCommunicationStatus = 0;
R485_ID41h.Sig.ICMCommunicationStatus = 0;
R485_ID41h.Sig.BrakeLeverFault = 0;
R485_ID41h.Sig.PhaseLossFault = 0;
R485_ID41h.Sig.MCUOverTempProtection = 0;
R485_ID41h.Sig.MotorOvertempProtection = 0;
R485_ID41h.Sig.RotorLocked = 0;
break; break;
case 1: case 1:
R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x0; // 自动大灯
R485_ID41h.Sig.ChargeState = 0x0; //充电状态
R485_ID41h.Sig.SlopePattern = 0x0; //跛行
R485_ID41h.Sig.CushionSensorStatus = 0x1; //坐垫压力
R485_ID41h.Sig.SlopeDescentFunctionStatus = 0x0; //陡坡缓降
R485_ID41h.Sig.TCSActivation = 0x1; //TCS激活
R485_ID41h.Sig.TCSFunctionalStatus = 0x0; //TCS状态
R485_ID41h.Sig.ElectronicCushionStatus = 0x1; //座桶开关
R485_ID41h.Sig.SupportSwitchSignalFeedback = 0x0; //边撑
R485_ID41h.Sig.CruiseMode = 0x0; //巡航
R485_ID41h.Sig.ICMCalculatesVehicleSpeed = 0; //速度 = (X * 0.512 * 3.14 * 1.05) / 30 R485_ID41h.Sig.ICMCalculatesVehicleSpeed = 0; //速度 = (X * 0.512 * 3.14 * 1.05) / 30
R485_ID41h.Sig.TotalBatterySOC = 0x2; //电量 R485_ID41h.Sig.TotalBatterySOC = 0x2; //电量
R485_ID41h.Sig.VehicleStatus = 0x3; //整车状态 R485_ID41h.Sig.VehicleStatus = 0x3; //整车状态
R485_ID41h.Sig.SpeedGear = 0x2; //挡位 R485_ID41h.Sig.SpeedGear = 0x2; //挡位
//功率暂空一会做
R485_ID41h.Sig.TotalBatteryVoltage = 0x4B; //总电池电压
R485_ID41h.Sig.IOTRealTime_Hour = 0; //时间:时 R485_ID41h.Sig.IOTRealTime_Hour = 0; //时间:时
R485_ID41h.Sig.IOTRealTime_Minute = 0; //时间:分 R485_ID41h.Sig.IOTRealTime_Minute = 0; //时间:分
R485_ID41h.Sig.IOTRealTime_Second = 0; //时间:秒 R485_ID41h.Sig.IOTRealTime_Second = 0; //时间:秒
R485_ID41h.Sig.HandlebarFaultIndicator = 0;
R485_ID41h.Sig.UUpBridgeArmMosFault = 0;
R485_ID41h.Sig.UDownBridgeArmMosFault = 0;
R485_ID41h.Sig.VUpBridgeArmMosFault = 0;
R485_ID41h.Sig.VDownBridgeArmMosFault = 0;
R485_ID41h.Sig.WUpBridgeArmMosFault = 0;
R485_ID41h.Sig.WDownBridgeArmMosFault = 0;
R485_ID41h.Sig.MCUFaultStateU_PhaseHallFault = 0;
R485_ID41h.Sig.MCUFaultStateV_PhaseHallFault = 0;
R485_ID41h.Sig.MCUFaultStateW_PhaseHallFault = 0;
R485_ID41h.Sig.MCUFaultStatus_HandlebarFault = 0;
R485_ID41h.Sig.BMS_0CommunicationStatus = 0;
R485_ID41h.Sig.MCUCommunicationStatus = 0;
R485_ID41h.Sig.ALMCommunicationStatus = 0;
R485_ID41h.Sig.ICMCommunicationStatus = 0;
R485_ID41h.Sig.BrakeLeverFault = 0;
R485_ID41h.Sig.PhaseLossFault = 0;
R485_ID41h.Sig.MCUOverTempProtection = 0;
R485_ID41h.Sig.MotorOvertempProtection = 0;
R485_ID41h.Sig.RotorLocked = 0;
break; break;
case 2: case 2:
R485_ID41h.Sig.ICMCalculatesVehicleSpeed = 0xC3; //速度 = (X * 0.512 * 3.14 * 1.05) / 30 R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x0; // 自动大灯
R485_ID41h.Sig.ChargeState = 0x0; //充电状态
R485_ID41h.Sig.SlopePattern = 0x0; //跛行
R485_ID41h.Sig.CushionSensorStatus = 0x1; //坐垫压力
R485_ID41h.Sig.SlopeDescentFunctionStatus = 0x0; //陡坡缓降
R485_ID41h.Sig.TCSActivation = 0x1; //TCS激活
R485_ID41h.Sig.TCSFunctionalStatus = 0x0; //TCS状态
R485_ID41h.Sig.ElectronicCushionStatus = 0x1; //座桶开关
R485_ID41h.Sig.SupportSwitchSignalFeedback = 0x0; //边撑
R485_ID41h.Sig.CruiseMode = 0x0; //巡航
R485_ID41h.Sig.ICMCalculatesVehicleSpeed = 0x46; //速度 = (X * 0.512 * 3.14 * 1.05) / 30 11km
R485_ID41h.Sig.TotalBatterySOC = 0x1E; //电量 R485_ID41h.Sig.TotalBatterySOC = 0x1E; //电量
R485_ID41h.Sig.VehicleStatus = 0x3; //整车状态 R485_ID41h.Sig.VehicleStatus = 0x3; //整车状态
R485_ID41h.Sig.SpeedGear = 0x3; //挡位 R485_ID41h.Sig.SpeedGear = 0x3; //挡位
//功率暂空一会做
R485_ID41h.Sig.TotalBatteryVoltage = 0x4B; //总电池电压
R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x1; // 自动大灯 R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x1; // 自动大灯
R485_ID41h.Sig.IOTRealTime_Hour = 0xB; //时间:时 R485_ID41h.Sig.IOTRealTime_Hour = 0xB; //时间:时
R485_ID41h.Sig.IOTRealTime_Minute = 0xB; //时间:分 R485_ID41h.Sig.IOTRealTime_Minute = 0xB; //时间:分
R485_ID41h.Sig.IOTRealTime_Second = 0; //时间:秒 R485_ID41h.Sig.IOTRealTime_Second = 0; //时间:秒
R485_ID41h.Sig.CartMode = 0;
R485_ID41h.Sig.HandlebarFaultIndicator = 0;
R485_ID41h.Sig.UUpBridgeArmMosFault = 0;
R485_ID41h.Sig.UDownBridgeArmMosFault = 0;
R485_ID41h.Sig.VUpBridgeArmMosFault = 0;
R485_ID41h.Sig.VDownBridgeArmMosFault = 0;
R485_ID41h.Sig.WUpBridgeArmMosFault = 0;
R485_ID41h.Sig.WDownBridgeArmMosFault = 0;
R485_ID41h.Sig.MCUFaultStateU_PhaseHallFault = 0;
R485_ID41h.Sig.MCUFaultStateV_PhaseHallFault = 0;
R485_ID41h.Sig.MCUFaultStateW_PhaseHallFault = 0;
R485_ID41h.Sig.MCUFaultStatus_HandlebarFault = 0;
R485_ID41h.Sig.BMS_0CommunicationStatus = 0;
R485_ID41h.Sig.MCUCommunicationStatus = 0;
R485_ID41h.Sig.ALMCommunicationStatus = 0;
R485_ID41h.Sig.ICMCommunicationStatus = 0;
R485_ID41h.Sig.BrakeLeverFault = 0;
R485_ID41h.Sig.PhaseLossFault = 0;
R485_ID41h.Sig.MCUOverTempProtection = 0;
R485_ID41h.Sig.MotorOvertempProtection = 0;
R485_ID41h.Sig.RotorLocked = 0;
break; break;
case 3: case 3:
R485_ID41h.Sig.ICMCalculatesVehicleSpeed = 0x186; //速度 = (X * 0.512 * 3.14 * 1.05) / 30 R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x0; // 自动大灯
R485_ID41h.Sig.ChargeState = 0x0; //充电状态
R485_ID41h.Sig.SlopePattern = 0x0; //跛行
R485_ID41h.Sig.CushionSensorStatus = 0x1; //坐垫压力
R485_ID41h.Sig.SlopeDescentFunctionStatus = 0x0; //陡坡缓降
R485_ID41h.Sig.TCSActivation = 0x1; //TCS激活
R485_ID41h.Sig.TCSFunctionalStatus = 0x0; //TCS状态
R485_ID41h.Sig.ElectronicCushionStatus = 0x1; //座桶开关
R485_ID41h.Sig.SupportSwitchSignalFeedback = 0x0; //边撑
R485_ID41h.Sig.CruiseMode = 0x0; //巡航
R485_ID41h.Sig.ICMCalculatesVehicleSpeed = 0x95; //速度 = (X * 0.512 * 3.14 * 1.05) / 30 22km
R485_ID41h.Sig.TotalBatterySOC = 0x2C; //电量 R485_ID41h.Sig.TotalBatterySOC = 0x2C; //电量
R485_ID41h.Sig.VehicleStatus = 0x3; //整车状态 R485_ID41h.Sig.VehicleStatus = 0x3; //整车状态
R485_ID41h.Sig.SpeedGear = 0x1; //挡位 R485_ID41h.Sig.SpeedGear = 0x1; //挡位
//功率暂空一会做
R485_ID41h.Sig.TotalBatteryVoltage = 0x4B; //总电池电压
R485_ID41h.Sig.IOTRealTime_Hour = 0x16; //时间:时 R485_ID41h.Sig.IOTRealTime_Hour = 0x16; //时间:时
R485_ID41h.Sig.IOTRealTime_Minute = 0x16; //时间:分 R485_ID41h.Sig.IOTRealTime_Minute = 0x16; //时间:分
R485_ID41h.Sig.IOTRealTime_Second = 0; //时间:秒 R485_ID41h.Sig.IOTRealTime_Second = 0; //时间:秒
R485_ID41h.Sig.HandlebarFaultIndicator = 0;
R485_ID41h.Sig.UUpBridgeArmMosFault = 0;
R485_ID41h.Sig.UDownBridgeArmMosFault = 0;
R485_ID41h.Sig.VUpBridgeArmMosFault = 0;
R485_ID41h.Sig.VDownBridgeArmMosFault = 0;
R485_ID41h.Sig.WUpBridgeArmMosFault = 0;
R485_ID41h.Sig.WDownBridgeArmMosFault = 0;
R485_ID41h.Sig.MCUFaultStateU_PhaseHallFault = 0;
R485_ID41h.Sig.MCUFaultStateV_PhaseHallFault = 0;
R485_ID41h.Sig.MCUFaultStateW_PhaseHallFault = 0;
R485_ID41h.Sig.MCUFaultStatus_HandlebarFault = 0;
R485_ID41h.Sig.BMS_0CommunicationStatus = 0;
R485_ID41h.Sig.MCUCommunicationStatus = 0;
R485_ID41h.Sig.ALMCommunicationStatus = 0;
R485_ID41h.Sig.ICMCommunicationStatus = 0;
R485_ID41h.Sig.BrakeLeverFault = 0;
R485_ID41h.Sig.PhaseLossFault = 0;
R485_ID41h.Sig.MCUOverTempProtection = 0;
R485_ID41h.Sig.MotorOvertempProtection = 0;
R485_ID41h.Sig.RotorLocked = 0;
break; break;
case 4: case 4:
R485_ID41h.Sig.ICMCalculatesVehicleSpeed = 0x240; //速度 = (X * 0.512 * 3.14 * 1.05) / 30 R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x0; // 自动大灯
R485_ID41h.Sig.ChargeState = 0x0; //充电状态
R485_ID41h.Sig.SlopePattern = 0x0; //跛行
R485_ID41h.Sig.CushionSensorStatus = 0x1; //坐垫压力
R485_ID41h.Sig.SlopeDescentFunctionStatus = 0x0; //陡坡缓降
R485_ID41h.Sig.TCSActivation = 0x1; //TCS激活
R485_ID41h.Sig.TCSFunctionalStatus = 0x0; //TCS状态
R485_ID41h.Sig.ElectronicCushionStatus = 0x1; //座桶开关
R485_ID41h.Sig.SupportSwitchSignalFeedback = 0x0; //边撑
R485_ID41h.Sig.CruiseMode = 0x0; //巡航
R485_ID41h.Sig.ICMCalculatesVehicleSpeed = 0xE2; //速度 = (X * 0.512 * 3.14 * 1.05) / 30 33km
R485_ID41h.Sig.TotalBatterySOC = 0x42; //电量 R485_ID41h.Sig.TotalBatterySOC = 0x42; //电量
R485_ID41h.Sig.VehicleStatus = 0x3; //整车状态 R485_ID41h.Sig.VehicleStatus = 0x3; //整车状态
R485_ID41h.Sig.SpeedGear = 0x0; //挡位 R485_ID41h.Sig.SpeedGear = 0x0; //挡位
//功率暂空一会做 //功率暂空一会做
R485_ID41h.Sig.IOTRealTime_Hour = 0xD; //时间:时 R485_ID41h.Sig.IOTRealTime_Hour = 0xD; //时间:时
R485_ID41h.Sig.IOTRealTime_Minute = 21; //时间:分 R485_ID41h.Sig.IOTRealTime_Minute = 0x21; //时间:分
R485_ID41h.Sig.IOTRealTime_Second = 0; //时间:秒 R485_ID41h.Sig.IOTRealTime_Second = 0; //时间:秒
R485_ID41h.Sig.SupportSwitchSignalFeedback = 0x1; //边撑
R485_ID41h.Sig.CruiseMode = 0x1; //巡航
R485_ID41h.Sig.HandlebarFaultIndicator = 0;
R485_ID41h.Sig.UUpBridgeArmMosFault = 0;
R485_ID41h.Sig.UDownBridgeArmMosFault = 0;
R485_ID41h.Sig.VUpBridgeArmMosFault = 0;
R485_ID41h.Sig.VDownBridgeArmMosFault = 0;
R485_ID41h.Sig.WUpBridgeArmMosFault = 0;
R485_ID41h.Sig.WDownBridgeArmMosFault = 0;
R485_ID41h.Sig.MCUFaultStateU_PhaseHallFault = 0;
R485_ID41h.Sig.MCUFaultStateV_PhaseHallFault = 0;
R485_ID41h.Sig.MCUFaultStateW_PhaseHallFault = 0;
R485_ID41h.Sig.MCUFaultStatus_HandlebarFault = 0;
R485_ID41h.Sig.BMS_0CommunicationStatus = 0;
R485_ID41h.Sig.MCUCommunicationStatus = 0;
R485_ID41h.Sig.ALMCommunicationStatus = 0;
R485_ID41h.Sig.ICMCommunicationStatus = 0;
R485_ID41h.Sig.BrakeLeverFault = 0;
R485_ID41h.Sig.PhaseLossFault = 0;
R485_ID41h.Sig.MCUOverTempProtection = 0;
R485_ID41h.Sig.MotorOvertempProtection = 0;
R485_ID41h.Sig.RotorLocked = 0;
break; break;
case 5: case 5:
R485_ID41h.Sig.ICMCalculatesVehicleSpeed = 0xC3; //速度 = (X * 0.512 * 3.14 * 1.05) / 30 R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x0; // 自动大灯
R485_ID41h.Sig.TotalBatterySOC = 0x1E; //电量 R485_ID41h.Sig.ChargeState = 0x0; //充电状态
R485_ID41h.Sig.VehicleStatus = 0x1; //整车状态 R485_ID41h.Sig.SlopePattern = 0x0; //跛行
R485_ID41h.Sig.SpeedGear = 0x3; //挡位 R485_ID41h.Sig.CushionSensorStatus = 0x1; //坐垫压力
R485_ID41h.Sig.SlopeDescentFunctionStatus = 0x0; //陡坡缓降
R485_ID41h.Sig.TCSActivation = 0x0; //TCS激活
R485_ID41h.Sig.TCSFunctionalStatus = 0x0; //TCS状态
R485_ID41h.Sig.ElectronicCushionStatus = 0x1; //座桶开关
R485_ID41h.Sig.SupportSwitchSignalFeedback = 0x0; //边撑
R485_ID41h.Sig.CruiseMode = 0x0; //巡航
R485_ID41h.Sig.ICMCalculatesVehicleSpeed = 0x12F; //速度 = (X * 0.512 * 3.14 * 1.05) / 30 44km
R485_ID41h.Sig.TotalBatterySOC = 0x58; //电量
R485_ID41h.Sig.VehicleStatus = 0x3; //整车状态
R485_ID41h.Sig.SpeedGear = 0x0; //挡位
//功率暂空一会做 //功率暂空一会做
R485_ID41h.Sig.IOTRealTime_Hour = 0; //时间:时 R485_ID41h.Sig.IOTRealTime_Hour = 0xE; //时间:时
R485_ID41h.Sig.IOTRealTime_Minute = 0; //时间:分 R485_ID41h.Sig.IOTRealTime_Minute = 0x2C; //时间:分
R485_ID41h.Sig.IOTRealTime_Second = 0; //时间:秒 R485_ID41h.Sig.IOTRealTime_Second = 0; //时间:秒
R485_ID41h.Sig.TCSActivation = 0x1; //TCS激活
R485_ID41h.Sig.TCSFunctionalStatus = 0x1; //TCS状态
R485_ID41h.Sig.ElectronicCushionStatus = 0x0; //座桶开关
R485_ID41h.Sig.HandlebarFaultIndicator = 0;
R485_ID41h.Sig.UUpBridgeArmMosFault = 0;
R485_ID41h.Sig.UDownBridgeArmMosFault = 0;
R485_ID41h.Sig.VUpBridgeArmMosFault = 0;
R485_ID41h.Sig.VDownBridgeArmMosFault = 0;
R485_ID41h.Sig.WUpBridgeArmMosFault = 0;
R485_ID41h.Sig.WDownBridgeArmMosFault = 0;
R485_ID41h.Sig.MCUFaultStateU_PhaseHallFault = 0;
R485_ID41h.Sig.MCUFaultStateV_PhaseHallFault = 0;
R485_ID41h.Sig.MCUFaultStateW_PhaseHallFault = 0;
R485_ID41h.Sig.MCUFaultStatus_HandlebarFault = 0;
R485_ID41h.Sig.BMS_0CommunicationStatus = 0;
R485_ID41h.Sig.MCUCommunicationStatus = 0;
R485_ID41h.Sig.ALMCommunicationStatus = 0;
R485_ID41h.Sig.ICMCommunicationStatus = 0;
R485_ID41h.Sig.BrakeLeverFault = 0;
R485_ID41h.Sig.PhaseLossFault = 0;
R485_ID41h.Sig.MCUOverTempProtection = 0;
R485_ID41h.Sig.MotorOvertempProtection = 0;
R485_ID41h.Sig.RotorLocked = 0;
break; break;
case 6: case 6:
R485_ID41h.Sig.ICMCalculatesVehicleSpeed = 0xC3; //速度 = (X * 0.512 * 3.14 * 1.05) / 30 R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x0; // 自动大灯
R485_ID41h.Sig.TotalBatterySOC = 0x1E; //电量 R485_ID41h.Sig.ChargeState = 0x0; //充电状态
R485_ID41h.Sig.VehicleStatus = 0x1; //整车状态 R485_ID41h.Sig.SlopePattern = 0x0; //跛行
R485_ID41h.Sig.CushionSensorStatus = 0x1; //坐垫压力
R485_ID41h.Sig.SlopeDescentFunctionStatus = 0x0; //陡坡缓降
R485_ID41h.Sig.TCSActivation = 0x1; //TCS激活
R485_ID41h.Sig.TCSFunctionalStatus = 0x0; //TCS状态
R485_ID41h.Sig.ElectronicCushionStatus = 0x1; //座桶开关
R485_ID41h.Sig.SupportSwitchSignalFeedback = 0x0; //边撑
R485_ID41h.Sig.CruiseMode = 0x0; //巡航
R485_ID41h.Sig.ICMCalculatesVehicleSpeed = 0x17A; //速度 = (X * 0.512 * 3.14 * 1.05) / 30 55km
R485_ID41h.Sig.TotalBatterySOC = 0x6E; //电量
R485_ID41h.Sig.VehicleStatus = 0x3; //整车状态
R485_ID41h.Sig.SpeedGear = 0x3; //挡位 R485_ID41h.Sig.SpeedGear = 0x3; //挡位
//功率暂空一会做 //功率暂空一会做
R485_ID41h.Sig.IOTRealTime_Hour = 0; //时间:时 R485_ID41h.Sig.IOTRealTime_Hour = 0xF; //时间:时
R485_ID41h.Sig.IOTRealTime_Minute = 0; //时间:分 R485_ID41h.Sig.IOTRealTime_Minute = 0x37; //时间:分
R485_ID41h.Sig.IOTRealTime_Second = 0; //时间:秒 R485_ID41h.Sig.IOTRealTime_Second = 0; //时间:秒
R485_ID41h.Sig.CushionSensorStatus = 0x0; //坐垫压力
R485_ID41h.Sig.SlopeDescentFunctionStatus = 0x1; //陡坡缓降
R485_ID41h.Sig.HandlebarFaultIndicator = 0;
R485_ID41h.Sig.UUpBridgeArmMosFault = 0;
R485_ID41h.Sig.UDownBridgeArmMosFault = 0;
R485_ID41h.Sig.VUpBridgeArmMosFault = 0;
R485_ID41h.Sig.VDownBridgeArmMosFault = 0;
R485_ID41h.Sig.WUpBridgeArmMosFault = 0;
R485_ID41h.Sig.WDownBridgeArmMosFault = 0;
R485_ID41h.Sig.MCUFaultStateU_PhaseHallFault = 0;
R485_ID41h.Sig.MCUFaultStateV_PhaseHallFault = 0;
R485_ID41h.Sig.MCUFaultStateW_PhaseHallFault = 0;
R485_ID41h.Sig.MCUFaultStatus_HandlebarFault = 0;
R485_ID41h.Sig.BMS_0CommunicationStatus = 0;
R485_ID41h.Sig.MCUCommunicationStatus = 0;
R485_ID41h.Sig.ALMCommunicationStatus = 0;
R485_ID41h.Sig.ICMCommunicationStatus = 0;
R485_ID41h.Sig.BrakeLeverFault = 0;
R485_ID41h.Sig.PhaseLossFault = 0;
R485_ID41h.Sig.MCUOverTempProtection = 0;
R485_ID41h.Sig.MotorOvertempProtection = 0;
R485_ID41h.Sig.RotorLocked = 0;
break; break;
case 7: case 7:
R485_ID41h.Sig.ICMCalculatesVehicleSpeed = 0xC3; //速度 = (X * 0.512 * 3.14 * 1.05) / 30 R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x0; // 自动大灯
R485_ID41h.Sig.TotalBatterySOC = 0x1E; //电量 R485_ID41h.Sig.ChargeState = 0x0; //充电状态
R485_ID41h.Sig.VehicleStatus = 0x1; //整车状态 R485_ID41h.Sig.SlopePattern = 0x0; //跛行
R485_ID41h.Sig.CushionSensorStatus = 0x1; //坐垫压力
R485_ID41h.Sig.SlopeDescentFunctionStatus = 0x0; //陡坡缓降
R485_ID41h.Sig.TCSActivation = 0x1; //TCS激活
R485_ID41h.Sig.TCSFunctionalStatus = 0x0; //TCS状态
R485_ID41h.Sig.ElectronicCushionStatus = 0x1; //座桶开关
R485_ID41h.Sig.SupportSwitchSignalFeedback = 0x0; //边撑
R485_ID41h.Sig.CruiseMode = 0x0; //巡航
R485_ID41h.Sig.ICMCalculatesVehicleSpeed = 0x1C4; //速度 = (X * 0.512 * 3.14 * 1.05) / 30 66km
R485_ID41h.Sig.TotalBatterySOC = 0x84; //电量
R485_ID41h.Sig.VehicleStatus = 0x3; //整车状态
R485_ID41h.Sig.SpeedGear = 0x3; //挡位 R485_ID41h.Sig.SpeedGear = 0x3; //挡位
//功率暂空一会做 //功率暂空一会做
R485_ID41h.Sig.IOTRealTime_Hour = 0; //时间:时 R485_ID41h.Sig.IOTRealTime_Hour = 0x10; //时间:时
R485_ID41h.Sig.IOTRealTime_Minute = 0; //时间:分 R485_ID41h.Sig.IOTRealTime_Minute = 0x6; //时间:分
R485_ID41h.Sig.IOTRealTime_Second = 0; //时间:秒 R485_ID41h.Sig.IOTRealTime_Second = 0; //时间:秒
R485_ID41h.Sig.SlopePattern = 0x1; //跛行
R485_ID41h.Sig.HandlebarFaultIndicator = 0;
R485_ID41h.Sig.UUpBridgeArmMosFault = 0;
R485_ID41h.Sig.UDownBridgeArmMosFault = 0;
R485_ID41h.Sig.VUpBridgeArmMosFault = 0;
R485_ID41h.Sig.VDownBridgeArmMosFault = 0;
R485_ID41h.Sig.WUpBridgeArmMosFault = 0;
R485_ID41h.Sig.WDownBridgeArmMosFault = 0;
R485_ID41h.Sig.MCUFaultStateU_PhaseHallFault = 0;
R485_ID41h.Sig.MCUFaultStateV_PhaseHallFault = 0;
R485_ID41h.Sig.MCUFaultStateW_PhaseHallFault = 0;
R485_ID41h.Sig.MCUFaultStatus_HandlebarFault = 0;
R485_ID41h.Sig.BMS_0CommunicationStatus = 0;
R485_ID41h.Sig.MCUCommunicationStatus = 0;
R485_ID41h.Sig.ALMCommunicationStatus = 0;
R485_ID41h.Sig.ICMCommunicationStatus = 0;
R485_ID41h.Sig.BrakeLeverFault = 0;
R485_ID41h.Sig.PhaseLossFault = 0;
R485_ID41h.Sig.MCUOverTempProtection = 0;
R485_ID41h.Sig.MotorOvertempProtection = 0;
R485_ID41h.Sig.RotorLocked = 0;
break; break;
case 8: case 8:
R485_ID41h.Sig.ICMCalculatesVehicleSpeed = 0xC3; //速度 = (X * 0.512 * 3.14 * 1.05) / 30 R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x0; // 自动大灯
R485_ID41h.Sig.TotalBatterySOC = 0x1E; //电量 R485_ID41h.Sig.ChargeState = 0x0; //充电状态
R485_ID41h.Sig.VehicleStatus = 0x1; //整车状态 R485_ID41h.Sig.SlopePattern = 0x0; //跛行
R485_ID41h.Sig.SpeedGear = 0x3; //挡位 R485_ID41h.Sig.CushionSensorStatus = 0x1; //坐垫压力
R485_ID41h.Sig.SlopeDescentFunctionStatus = 0x0; //陡坡缓降
R485_ID41h.Sig.TCSActivation = 0x1; //TCS激活
R485_ID41h.Sig.TCSFunctionalStatus = 0x0; //TCS状态
R485_ID41h.Sig.ElectronicCushionStatus = 0x1; //座桶开关
R485_ID41h.Sig.SupportSwitchSignalFeedback = 0x0; //边撑
R485_ID41h.Sig.CruiseMode = 0x0; //巡航
R485_ID41h.Sig.ICMCalculatesVehicleSpeed = 0x210; //速度 = (X * 0.512 * 3.14 * 1.05) / 30 77km
R485_ID41h.Sig.TotalBatterySOC = 0x9A; //电量
R485_ID41h.Sig.VehicleStatus = 0x3; //整车状态
R485_ID41h.Sig.SpeedGear = 0x1; //挡位
//功率暂空一会做 //功率暂空一会做
R485_ID41h.Sig.IOTRealTime_Hour = 0; //时间:时 R485_ID41h.Sig.IOTRealTime_Hour = 0x11; //时间:时
R485_ID41h.Sig.IOTRealTime_Minute = 0; //时间:分 R485_ID41h.Sig.IOTRealTime_Minute = 0x7; //时间:分
R485_ID41h.Sig.IOTRealTime_Second = 0; //时间:秒 R485_ID41h.Sig.IOTRealTime_Second = 0; //时间:秒
R485_ID41h.Sig.HandlebarFaultIndicator = 0x1;
R485_ID41h.Sig.UUpBridgeArmMosFault = 0;
R485_ID41h.Sig.UDownBridgeArmMosFault = 0;
R485_ID41h.Sig.VUpBridgeArmMosFault = 0;
R485_ID41h.Sig.VDownBridgeArmMosFault = 0;
R485_ID41h.Sig.WUpBridgeArmMosFault = 0;
R485_ID41h.Sig.WDownBridgeArmMosFault = 0;
R485_ID41h.Sig.MCUFaultStateU_PhaseHallFault = 0;
R485_ID41h.Sig.MCUFaultStateV_PhaseHallFault = 0;
R485_ID41h.Sig.MCUFaultStateW_PhaseHallFault = 0;
R485_ID41h.Sig.MCUFaultStatus_HandlebarFault = 0;
R485_ID41h.Sig.BMS_0CommunicationStatus = 0;
R485_ID41h.Sig.MCUCommunicationStatus = 0;
R485_ID41h.Sig.ALMCommunicationStatus = 0;
R485_ID41h.Sig.ICMCommunicationStatus = 0;
R485_ID41h.Sig.BrakeLeverFault = 0;
R485_ID41h.Sig.PhaseLossFault = 0;
R485_ID41h.Sig.MCUOverTempProtection = 0;
R485_ID41h.Sig.MotorOvertempProtection = 0;
R485_ID41h.Sig.RotorLocked = 0;
break; break;
case 9: case 9:
R485_ID41h.Sig.ICMCalculatesVehicleSpeed = 0xC3; //速度 = (X * 0.512 * 3.14 * 1.05) / 30
R485_ID41h.Sig.TotalBatterySOC = 0x1E; //电量 R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x0; // 自动大灯
R485_ID41h.Sig.VehicleStatus = 0x1; //整车状态 R485_ID41h.Sig.ChargeState = 0x0; //充电状态
R485_ID41h.Sig.SpeedGear = 0x3; //挡位 R485_ID41h.Sig.SlopePattern = 0x0; //跛行
R485_ID41h.Sig.CushionSensorStatus = 0x1; //坐垫压力
R485_ID41h.Sig.SlopeDescentFunctionStatus = 0x0; //陡坡缓降
R485_ID41h.Sig.TCSActivation = 0x1; //TCS激活
R485_ID41h.Sig.TCSFunctionalStatus = 0x0; //TCS状态
R485_ID41h.Sig.ElectronicCushionStatus = 0x1; //座桶开关
R485_ID41h.Sig.SupportSwitchSignalFeedback = 0x0; //边撑
R485_ID41h.Sig.CruiseMode = 0x0; //巡航
R485_ID41h.Sig.ICMCalculatesVehicleSpeed = 0x25F; //速度 = (X * 0.512 * 3.14 * 1.05) / 30 88km
R485_ID41h.Sig.TotalBatterySOC = 0xB0; //电量
R485_ID41h.Sig.VehicleStatus = 0x3; //整车状态
R485_ID41h.Sig.SpeedGear = 0; //挡位
//功率暂空一会做 //功率暂空一会做
R485_ID41h.Sig.IOTRealTime_Hour = 0; //时间:时 R485_ID41h.Sig.IOTRealTime_Hour = 0x12; //时间:时
R485_ID41h.Sig.IOTRealTime_Minute = 0; //时间:分 R485_ID41h.Sig.IOTRealTime_Minute = 0x8; //时间:分
R485_ID41h.Sig.IOTRealTime_Second = 0; //时间:秒 R485_ID41h.Sig.IOTRealTime_Second = 0; //时间:秒
R485_ID41h.Sig.ChargeState = 0x1; //充电状态
R485_ID41h.Sig.HandlebarFaultIndicator = 0;
R485_ID41h.Sig.UUpBridgeArmMosFault = 0;
R485_ID41h.Sig.UDownBridgeArmMosFault = 0;
R485_ID41h.Sig.VUpBridgeArmMosFault = 0;
R485_ID41h.Sig.VDownBridgeArmMosFault = 0;
R485_ID41h.Sig.WUpBridgeArmMosFault = 0;
R485_ID41h.Sig.WDownBridgeArmMosFault = 0;
R485_ID41h.Sig.MCUFaultStateU_PhaseHallFault = 0;
R485_ID41h.Sig.MCUFaultStateV_PhaseHallFault = 0;
R485_ID41h.Sig.MCUFaultStateW_PhaseHallFault = 0;
R485_ID41h.Sig.MCUFaultStatus_HandlebarFault = 0;
R485_ID41h.Sig.BMS_0CommunicationStatus = 0;
R485_ID41h.Sig.MCUCommunicationStatus = 0;
R485_ID41h.Sig.ALMCommunicationStatus = 0;
R485_ID41h.Sig.ICMCommunicationStatus = 0;
R485_ID41h.Sig.BrakeLeverFault = 0;
R485_ID41h.Sig.PhaseLossFault = 0;
R485_ID41h.Sig.MCUOverTempProtection = 0;
R485_ID41h.Sig.MotorOvertempProtection = 0;
R485_ID41h.Sig.RotorLocked = 0;
break; break;
case 10: case 10:
R485_ID41h.Sig.ICMCalculatesVehicleSpeed = 0x300; //速度 = (X * 0.512 * 3.14 * 1.05) / 30 88km
R485_ID41h.Sig.TotalBatterySOC = 0xC6; //电量
R485_ID41h.Sig.VehicleStatus = 0x3; //整车状态
R485_ID41h.Sig.SpeedGear = 0; //挡位
//功率暂空一会做
R485_ID41h.Sig.IOTRealTime_Hour = 0x12; //时间:时
R485_ID41h.Sig.IOTRealTime_Minute = 0x8; //时间:分
R485_ID41h.Sig.IOTRealTime_Second = 0; //时间:秒
R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x1; // 自动大灯
R485_ID41h.Sig.ChargeState = 0x1; //充电状态
R485_ID41h.Sig.SlopePattern = 0x1; //跛行
R485_ID41h.Sig.CushionSensorStatus = 0x1; //坐垫压力
R485_ID41h.Sig.SlopeDescentFunctionStatus = 0x1; //陡坡缓降
R485_ID41h.Sig.TCSActivation = 0x1; //TCS激活
R485_ID41h.Sig.TCSFunctionalStatus = 0x1; //TCS状态
R485_ID41h.Sig.ElectronicCushionStatus = 0x0; //座桶开关
R485_ID41h.Sig.SupportSwitchSignalFeedback = 0x1; //边撑
R485_ID41h.Sig.CruiseMode = 0x1; //巡航
R485_ID41h.Sig.HandlebarFaultIndicator = 1;
R485_ID41h.Sig.UUpBridgeArmMosFault = 0;
R485_ID41h.Sig.UDownBridgeArmMosFault = 0;
R485_ID41h.Sig.VUpBridgeArmMosFault = 0;
R485_ID41h.Sig.VDownBridgeArmMosFault = 0;
R485_ID41h.Sig.WUpBridgeArmMosFault = 0;
R485_ID41h.Sig.WDownBridgeArmMosFault = 0;
R485_ID41h.Sig.MCUFaultStateU_PhaseHallFault = 0;
R485_ID41h.Sig.MCUFaultStateV_PhaseHallFault = 0;
R485_ID41h.Sig.MCUFaultStateW_PhaseHallFault = 0;
R485_ID41h.Sig.MCUFaultStatus_HandlebarFault = 0;
R485_ID41h.Sig.BMS_0CommunicationStatus = 0;
R485_ID41h.Sig.MCUCommunicationStatus = 0;
R485_ID41h.Sig.ALMCommunicationStatus = 0;
R485_ID41h.Sig.ICMCommunicationStatus = 0;
R485_ID41h.Sig.BrakeLeverFault = 0;
R485_ID41h.Sig.PhaseLossFault = 0;
R485_ID41h.Sig.MCUOverTempProtection = 0;
R485_ID41h.Sig.MotorOvertempProtection = 0;
R485_ID41h.Sig.RotorLocked = 0;
break; break;
default: default:
R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x0; // 自动大灯
R485_ID41h.Sig.ChargeState = 0x0; //充电状态
R485_ID41h.Sig.SlopePattern = 0x0; //跛行
R485_ID41h.Sig.CushionSensorStatus = 0x1; //坐垫压力
R485_ID41h.Sig.SlopeDescentFunctionStatus = 0x0; //陡坡缓降
R485_ID41h.Sig.TCSActivation = 0x1; //TCS激活
R485_ID41h.Sig.TCSFunctionalStatus = 0x0; //TCS状态
R485_ID41h.Sig.ElectronicCushionStatus = 0x1; //座桶开关
R485_ID41h.Sig.SupportSwitchSignalFeedback = 0x0; //边撑
R485_ID41h.Sig.CruiseMode = 0x0; //巡航
R485_ID41h.Sig.HandlebarFaultIndicator = 0;
R485_ID41h.Sig.UUpBridgeArmMosFault = 0;
R485_ID41h.Sig.UDownBridgeArmMosFault = 0;
R485_ID41h.Sig.VUpBridgeArmMosFault = 0;
R485_ID41h.Sig.VDownBridgeArmMosFault = 0;
R485_ID41h.Sig.WUpBridgeArmMosFault = 0;
R485_ID41h.Sig.WDownBridgeArmMosFault = 0;
R485_ID41h.Sig.MCUFaultStateU_PhaseHallFault = 0;
R485_ID41h.Sig.MCUFaultStateV_PhaseHallFault = 0;
R485_ID41h.Sig.MCUFaultStateW_PhaseHallFault = 0;
R485_ID41h.Sig.MCUFaultStatus_HandlebarFault = 0;
R485_ID41h.Sig.BMS_0CommunicationStatus = 0;
R485_ID41h.Sig.MCUCommunicationStatus = 0;
R485_ID41h.Sig.ALMCommunicationStatus = 0;
R485_ID41h.Sig.ICMCommunicationStatus = 0;
R485_ID41h.Sig.BrakeLeverFault = 0;
R485_ID41h.Sig.PhaseLossFault = 0;
R485_ID41h.Sig.MCUOverTempProtection = 0;
R485_ID41h.Sig.MotorOvertempProtection = 0;
R485_ID41h.Sig.RotorLocked = 0;
break; break;
} }
R485_Send(0x41, R485_ID41h.Msg, sizeof(R485_ID41h.Msg)); R485_Send(0x41, R485_ID41h.Msg, sizeof(R485_ID41h.Msg));
...@@ -178,6 +596,41 @@ void R485_Send_0x41(void) ...@@ -178,6 +596,41 @@ void R485_Send_0x41(void)
void R485_Send_0x42(void) void R485_Send_0x42(void)
{ {
memset(R485_ID42h.Msg, 0, 64); memset(R485_ID42h.Msg, 0xFF, 64);
R485_ID42h.Sig.TPower = 0; //T动力状态
R485_ID42h.Sig.TotalBatteryCurrent = 0;
switch (HJ_OtherKeyCurrent.count)
{
case 0:
break;
case 1:
R485_ID42h.Sig.TotalBatteryCurrent = 0x34; //母线电流
break;
case 2:
R485_ID42h.Sig.TotalBatteryCurrent = 0x96; //母线电流
break;
case 3:
R485_ID42h.Sig.TotalBatteryCurrent = 0xFA; //母线电流
break;
case 4:
// R485_ID42h.Sig.TotalBatteryCurrent = 0x46;
R485_ID42h.Sig.SuperTPower = 0x0; //超级T动力模式
R485_ID42h.Sig.TPower = 0x1; //T动力状态
break;
case 5:
break;
case 6:
break;
case 7:
break;
case 8:
break;
case 9:
break;
default:
break;
}
R485_Send(0x42, R485_ID42h.Msg, sizeof(R485_ID42h.Msg)); R485_Send(0x42, R485_ID42h.Msg, sizeof(R485_ID42h.Msg));
} }
\ No newline at end of file
...@@ -691,9 +691,9 @@ void Button_Statu_Manage(void) ...@@ -691,9 +691,9 @@ void Button_Statu_Manage(void)
Botton.Other.Time += IntervalTimerDelta; Botton.Other.Time += IntervalTimerDelta;
if(Botton.Other.Time >= 1000 && CheckClusterValid == 0u){ if(Botton.Other.Time >= 1000 && CheckClusterValid == 0u){
if(Botton.Other.Statu != 3) { // if(Botton.Other.Statu != 3) {
Botton.Other.Statu = 2; // Botton.Other.Statu = 2;
} // }
Button_Press= 1; Button_Press= 1;
Err_Flag = 1; Err_Flag = 1;
} }
...@@ -2691,7 +2691,7 @@ void Stage_Manage() ...@@ -2691,7 +2691,7 @@ void Stage_Manage()
ClearOtherFlagFun(); ClearOtherFlagFun();
Othercount = 0; Othercount = 0;
if(HJ_OtherKeyCurrent.count > 11) { if(HJ_OtherKeyCurrent.count > 11) {
HJ_OtherKeyCurrent.count = 1; HJ_OtherKeyCurrent.count = 0;
} }
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment