Commit 875f7566 authored by 梁百峰's avatar 梁百峰

:sparkles: feat:扫码枪读取以及外发检验值对比

parent 9f0bd79e
......@@ -603,7 +603,7 @@ uint32_t R485_Send_0x41(void)
R485_ID41h.Sig.RotorLocked = 0;
break;
}
u32sendendflag = R485_Send(0x41, R485_ID41h.Msg, sizeof(R485_ID41h.Msg));
u32sendendflag = R485_Send(0x48, R485_ID41h.Msg, sizeof(R485_ID41h.Msg));
return u32sendendflag;
}
......
......@@ -1097,7 +1097,162 @@ typedef union
}_ID0X4Dh_Data;
typedef union
{
uint8_t Msg[64];
struct
{
/* Byte 0*/
uint8_t Clear: 1; /*清零信号*/
/* Byte 1 */
uint8_t : 8; /* Vin号1位 */
/* Byte 2 */
uint8_t : 8; /* Vin号2位 */
/* Byte 3 */
uint8_t : 8; /* Vin号3位 */
/* Byte 4 */
uint8_t : 8; /* Vin号4位 */
/* Byte 5 */
uint8_t : 8; /* Vin号5位 */
/* Byte 6 */
uint8_t : 8; /* Vin号6位 */
/* Byte 7 */
uint8_t : 8; /* Vin号7位 */
/* Byte 8 */
uint8_t : 8; /* Vin号8位 */
/* Byte 9 */
uint8_t : 8; /* Vin号9位 */
/* Byte 10 */
uint8_t : 8; /* Vin号10位 */
/* Byte 11 */
uint8_t : 8; /* Vin号11位 */
/* Byte 12 */
uint8_t : 8; /* Vin号12 */
/* Byte 13 */
uint8_t : 8; /* Vin号13 */
/* Byte 14 */
uint8_t : 8; /* Vin号14 */
/* Byte 15 */
uint8_t : 8; /* Vin号15 */
/* Byte 16 */
uint8_t : 8; /* Vin号16 */
/* Byte 17 */
uint8_t : 8; /* Vin号17 */
/* Byte 18 */
uint8_t : 2; /* 转向优先开关设置指令 */
uint8_t : 6; /* 预留 */
/* Byte 19 */
uint8_t : 8; /* 预警天气类型 */
/* Byte 20 */
uint8_t : 8; /* 当前天气类型 */
/* Byte 21 */
uint8_t : 8; /* 当前天气温度 */
/* Byte 22 */
uint8_t : 8; /* 恶劣天气类型 */
/* Byte 23*/
uint8_t : 3; /* 天气预警等级 */
uint8_t : 5; /* 恶劣天气发生时间 */
/* Byte 24 */
uint8_t : 2; /* 仪表密码解锁唤醒指令 */
uint8_t : 2; /* 密码认证结果 */
uint8_t : 3; /* 密码可输入剩余次数 */
uint8_t : 1; /* 故障修复模式 */
/* Byte 25 - 26*/
uint8_t : 8; /* 总电池电量剩余充满时间L 与通信协议出入 */
uint8_t : 8; /* 总电池电量剩余充满时间H 与通信协议出入 */
/* Byte 27*/
uint8_t : 2; /* 故障修复模式 */
uint8_t : 2; /* 边撑功能设置反馈 */
uint8_t : 2; /* 座垫感应功能设置反馈 */
uint8_t : 2; /* 预留 */
/* Byte 28-63*/
uint8_t : 8; /* 28预留 */
/* Byte 29*/
uint8_t : 8; /* 母线电流 */
/* Byte 30-35*/
uint8_t : 8; /* BLEMAC地址 */
uint8_t : 8; /* BLEMAC地址 */
uint8_t : 8; /* BLEMAC地址 */
uint8_t : 8; /* BLEMAC地址 */
uint8_t : 8; /* BLEMAC地址 */
uint8_t : 8; /* BLEMAC地址 */
/* Byte 36*/
uint8_t : 5; /* 36预留 */
uint8_t : 2; /* 超级T动力状态 */
uint8_t : 1; /* 36预留 */
uint8_t : 8; /* 37预留 */
uint8_t : 4; /* 38预留 */
uint8_t : 2; /*导购模式*/
uint8_t : 2; /* 38预留 */
uint8_t:8; /* 39预留 */
uint8_t : 8; /* 40预留 */
uint8_t : 8; /* 41预留 */
uint8_t : 8; /* 42预留 */
uint8_t : 8; /* 43预留 */
uint8_t : 8; /* 44预留 */
uint8_t : 8; /* 45预留 */
uint8_t : 8; /* 46预留 */
uint8_t : 8; /* 47预留 */
uint8_t : 8; /* 48预留 */
uint8_t : 8; /* 49预留 */
uint8_t : 8; /* 50预留 */
uint8_t : 8; /* 51预留 */
uint8_t : 8; /* 52预留 */
uint8_t : 8; /* 53预留 */
uint8_t : 8; /* 54预留 */
uint8_t : 8; /* 55预留 */
uint8_t : 8; /* 56预留 */
uint8_t : 8; /* 57预留 */
uint8_t : 8; /* 58预留 */
uint8_t : 8; /* 59预留 */
/* Byte 60*/
uint8_t : 6; /* 60预留 */
uint8_t : 2;
uint8_t : 8; /* 61预留 */
uint8_t : 8; /* 62预留 */
uint8_t : 8; /* 63预留 */
}Sig;
}_ID0X80h_Data;
extern _ID0X40h_Data R485_ID40h;
extern _ID0X48h_Data R485_ID48h;
extern _ID0X41h_Data R485_ID41h;
......@@ -1105,7 +1260,7 @@ extern _ID0X49h_Data R485_ID49h;
extern _ID0X42h_Data R485_ID42h;
extern _ID0X4Ah_Data R485_ID4Ah;
extern _ID0X4Dh_Data R485_ID4Dh;
extern _ID0X80h_Data R485_ID80h;
extern uint32_t R485_Send_0x40(void);
......
......@@ -55,4 +55,5 @@ extern uint32_t RS485_send_time;
extern uint8_t RS485_TX_finish;
extern uint32_t RS485_send_num;
extern uint32_t R485_Send(const uint16_t cmdID, const uint8_t* pData, uint8_t len);
extern uint8_t Yadi_CAL_Data_Sum(uint8_t* pu8LinData, uint16_t u8LinLen);
#endif /* API_ADC_H_ */
......@@ -100,6 +100,9 @@ unsigned int g_RPM_Val;
#define CHECK_VERSION_X 1
#define CHECK_VERSION_Y 295
uint8_t corenum[100];
uint8_t corenum1[100];
uint8_t corenum2[100];
......@@ -2092,13 +2095,15 @@ void AUTO_Step1(void)
SetDisplayStaticItemW2(YD_ruanjian , 2, SW_HJHW_Y, DRAW_LUMIN_ICOM_WINDOW);
uint8_t uiDspInfo_NUM5[16+1];
uiDspInfo_NUM5[0]=0;
sprintf(uiDspInfo_NUM5,":%2d.%2d",0x01,0x0c);//软件版本号
// sprintf(uiDspInfo_NUM5,":%2d.%2d",0x01,0x0c);//软件版本号
sprintf(uiDspInfo_NUM5,":%2d.%2d",R485_ID48h.Sig.MCUMainSoftwareVer,R485_ID48h.Sig.MCUSecSoftwareVer);
DspOneLineDynamicStr(uiDspInfo_NUM5,120, SW_HJHW_Y+2);
SetDisplayStaticItemW2(YD_yingjian , 2, SW_HJHW_Y+25, DRAW_LUMIN_ICOM_WINDOW);
uint8_t uiDspInfo_NUM6[16+1];
uiDspInfo_NUM6[0]=0;
sprintf(uiDspInfo_NUM6,": %3d",0x8C);
sprintf(uiDspInfo_NUM6,": %3d",R485_ID48h.Sig.HardwareVer);
DspOneLineDynamicStr(uiDspInfo_NUM6,120, SW_HJHW_Y+25+2);
SetDisplayStaticItemW2(YD_yingxianwaifan , 2, SW_HJHW_Y+25+25, DRAW_LUMIN_ICOM_WINDOW);
......@@ -2109,8 +2114,18 @@ void AUTO_Step1(void)
SetDisplayStaticItemW2(YD_yibiao , 2, SW_HJHW_Y+25+25+20, DRAW_LUMIN_ICOM_WINDOW);
DspOneLineDynamicStr(uiDspInfo_NUM2,120, SW_HJHW_Y+25+25+20);
SetDisplayStaticItemW2(YD_zhichisaom , 2, SW_HJHW_Y+25+25+20+20, DRAW_LUMIN_ICOM_WINDOW);
// SetDisplayStaticItemW2(YD_zhichisaom , 2, SW_HJHW_Y+25+25+20+20, DRAW_LUMIN_ICOM_WINDOW);//支持扫码功能
uint8_t uiDspInfo_NUM4[16+1];
uiDspInfo_NUM4[0]=0;
sprintf(uiDspInfo_NUM4,": NO",SW_Data);
if(checknumwrong)
{
DspOneLineDynamicStr(uiDspInfo_NUM4,120, SW_HJHW_Y+25+25+20);
}
else
{
DspOneLineDynamicStr(uiDspInfo_NUM2,120, SW_HJHW_Y+25+25+20);
}
SetDisplayStaticItemW2(YD_dianyuanwaifa , 2, SW_HJHW_Y+25+25+20+20+25, DRAW_LUMIN_ICOM_WINDOW);
DspOneLineDynamicStr(uiDspInfo_NUM2,120, SW_HJHW_Y+25+25+20+20+25+15);
SetDisplayStaticItemW2(YD_jiancetai, 2, SW_HJHW_Y+25+25+20+20+25+45, DRAW_LUMIN_ICOM_WINDOW);//�����:����
......@@ -3199,6 +3214,9 @@ void UpdateCenterTripC(void)
break;
case STAGE_AutoCheck: //�Լ�
// AUTO_Display();
DspOneLineDynamicStr(corenum ,0, 70);
DspOneLineDynamicStr(corenum1 ,0, 90);
DspOneLineDynamicStr(corenum2 ,0, 110);
break;
case STAGE_Led_Telltale_Check: //双闪
......
......@@ -345,6 +345,9 @@ extern uint8_t NUM8Flag;
extern uint8_t HJ_HJYBStateFlag;
extern uint8_t HJ_DAYFlag;
extern uint16_t FuelResTest;
extern uint8_t corenum[100];
extern uint8_t corenum1[100];
extern uint8_t corenum2[100];
enum
{
HJ_UDSStateSuc = 1,
......
......@@ -28,6 +28,8 @@ uint8_t GetPartNumFinish = 0;
uint16_t GetPartNumTimerCnts = 0;
uint8_t Freque_Flag;
uint8_t g_uiCuntDownFlag = 0;
uint8_t Auto_add_flag = 0;
uint8_t Auto_reducte_flag = 0;
#if (SEMI_AUTOMATIC_STAGE)
#define STAGE_COUNT_EOL 4
......@@ -223,6 +225,12 @@ void Get_Button_Value()//��ȡ����AD
else
Botton.FuelWaterDown.Flag = 0;
#endif
GET_BUTTON_IOL_UP_LEVEL;
GET_BUTTON_SPEED_DOWN_LEVEL;
if(BUTTON_IOL_UP_IN == 0 && BUTTON_SPEED_DOWN_IN == 0)
Botton.Auto_AddBegin.Flag = 1;
else
Botton.Auto_AddBegin.Flag = 0;
#if (FUNCTION_KEY_TFT_UP)
GET_BUTTON_TFT_UP_LEVEL;
if(BUTTON_TFT_UP_IN == 0)
......@@ -687,7 +695,7 @@ void Button_Statu_Manage(void)
}
if(Botton.Other.Flag == 1){ //ELSE
if(Botton.Other.Time < 3000)
if(Botton.Other.Time < 6000)
Botton.Other.Time += IntervalTimerDelta;
if(Botton.Other.Time >= 1000 && CheckClusterValid == 0u){
......@@ -696,12 +704,14 @@ void Button_Statu_Manage(void)
// }
Button_Press= 1;
Err_Flag = 1;
}
}else{
if(Botton.Other.Time > 100 && Botton.Other.Time < 1000){
if(Botton.Other.Time > 3000 ){
Botton.Other.Statu = 1;
Button_Press= 1;
Button_Value=11;
//ElseCurrent.enable = 1;
}
Botton.Other.Time = 0;
......@@ -2588,7 +2598,18 @@ void Stage_Manage()
// }
#endif
}
if((Botton.SpeedDown.Statu == 1) && (Botton.FuelWaterUp.Statu == 1))
{
if(Auto_add_flag == 1)
{
Auto_add_flag = 0;
}
else
{
Auto_add_flag = 1;
}
}
if(Botton.FuelWaterDown.Statu == 1){
Botton.FuelWaterDown.Statu = 0;
#if (SEMI_AUTOMATIC_STAGE)
......@@ -2722,8 +2743,11 @@ void Stage_Manage()
#if ((PRO_CN7C) || (PRO_QYC) || (PRO_BDC_PE) || (PRO_SQFL) || (PRO_DL3C))
ACU14.msg.bits.CF_SWL_Ind = 0x1;
#endif
Port_SetPortPinLevel(2, 3, PortGpioLow);//��ȫ��
Port_SetPortPinLevel(2, 20, PortGpioLow);//����ѹ��
// Port_SetPortPinLevel(2, 3, PortGpioLow);//��ȫ��
// Port_SetPortPinLevel(2, 20, PortGpioLow);//����ѹ��
//Port_SetPortPinLevel(0, 0, PortGpioLow);//���ر���
// Port_SetPortPinLevel(2, 1, PortGpioLow);//WaterSeparator
#if (CAN_2ND)
......
......@@ -100,6 +100,7 @@ typedef struct//union
Class Down ; // ��
Class OK ; // OK
Class EOLClear ; // EOL����ȫ0
Class Auto_AddBegin ;
}_BUTTON;
extern _BUTTON Botton;
......
This diff is collapsed.
......@@ -124,4 +124,5 @@ extern uint32_t CluClusterID;
extern uint32_t CluBarcodeDate;
extern uint8_t CluSerialNumber[4];
extern uint8_t CluWriteCompleteFlag[8];
extern uint8_t checknumwrong;
#endif /* __MAIN_H__ */
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