Commit 88692e08 authored by 何锐's avatar 何锐

feat:增加上电扫码解锁,单独写入,校验等步骤,增加连接蓝牙时显示蓝牙名称

parent 4a60b863
......@@ -313,7 +313,7 @@ void datacheck(void)
// RS485_TX_finish = 0;
}
break;
case 4:
case 5:
if(BarCode[0] == 0x59 && BarCode[1] == 0x44)
{
if(((BarCode[arraynum]) == 0x4A) && ((BarCode[arraynum-1]) == 0x4B))
......@@ -369,12 +369,12 @@ void BarCodeDataGet(void)
{
memcpy(barcode_Msg,&mDataBufPtr1[6],34);
memcpy(barcode_Msg1,&mDataBufPtr1[6],34);
zhenduanflag = 1;
}
else
{
memcpy(barcode_Msg1,&mDataBufPtr1[6],34);
// memcpy(barcode_Msg1,&mDataBufPtr1[6],34);
memset(barcode_Msg,0,34);
General_Number_Disp(writefail, 3, 250);
}
}
uint8_t GetDataCompare(void)
......
......@@ -189,6 +189,18 @@ uint32_t Get_IPK_Status(void)
{
return NO_IPK_EXIST_Status;
}
uint8_t Datajudgment(void)
{
for(int i = 0; i<34; i++)
{
if(barcode_Msg[i] != mimaread[i])
{
return 0;
}
}
return 1;
}
void Diag_Info_Init(void)
{
NO_IPK_EXIST_Status = 0x11223344;
......@@ -208,11 +220,12 @@ void Diag_Info_Init(void)
}
uint8_t Type_Clear = 0;
extern uint8_t BCM_FLAG_2014 = 0;
uint8_t writefail[5] = {0x46,0x41,0x49,0x4c,0xff};
uint8_t erweima[64] ;
uint32_t loc_Type = 0;
void Total_Check(void)
{
uint8_t erweima[64] ;
uint8_t cmperweima[34];
uint8_t yibiaoshuju[34];
......@@ -230,21 +243,23 @@ uint8_t yibiaoshuju[34];
switch ( loc_Type )
{
case 0:
// Buzzer_Init();
// Function_Check_Ctrl(1); //Excel表格发报文。硬线信号
//Buzzer_Warning();
// TFT_LCD_Draw_Bmp(200, 90+40, ( uint8_t * )gImage_dui12 );
// for(int i = 0;i<34;i++)
// {
// erweima[i] = barcode_Msg[i];
// }
if(saomafinish == 2)
if(saomafinish == 0)
{
for(int i = 0;i<34;i++)
{
if(barcode_Msg[i] != erweima[i])
{
Display_TFT_Clear();
break;
}
}
memcpy(erweima,barcode_Msg,34);
erweima[34] = 0xFF;
General_Number_Disp(erweima, 3, 90);
General_Number_Disp(erweima, 3, 60);
if(writeflag == 1 || writeflag == 3)
{
TFT_LCD_Draw_Bmp(200, 90+40, ( uint8_t * )gImage_dui12 );
......@@ -253,9 +268,55 @@ uint8_t yibiaoshuju[34];
{
TFT_LCD_Draw_Bmp(200, 90+40, ( uint8_t * )gImage_cuo12 );
}
}
else if(saomafinish == 1)
{
memcpy(erweima,barcode_Msg,34);
erweima[34] = 0xFF;
General_Number_Disp(erweima, 3, 60);
if(writeflag == 1 || writeflag == 3)
{
TFT_LCD_Draw_Bmp(200, 90+40-5, ( uint8_t * )gImage_dui12 );
}
else
{
TFT_LCD_Draw_Bmp(200, 90+40-5, ( uint8_t * )gImage_cuo12 );
}
uint8_t writesuccess[8] = {0x53,0x55,0x43,0x43,0x46,0x53,0x53,0xff};
General_Number_Disp(writesuccess, 3, 125);
}
else if(saomafinish == 2)
{
memcpy(erweima,barcode_Msg,34);
erweima[34] = 0xFF;
General_Number_Disp(erweima, 3, 60);
if(writeflag == 1 || writeflag == 3)
{
TFT_LCD_Draw_Bmp(200, 90+40-5, ( uint8_t * )gImage_dui12 );
}
else
{
TFT_LCD_Draw_Bmp(200, 90+40-5, ( uint8_t * )gImage_cuo12 );
}
uint8_t writesuccess[8] = {0x53,0x55,0x43,0x43,0x45,0x53,0x53,0xff};
General_Number_Disp(writesuccess, 3, 125);
mimaread[34] = 0xFF;
General_Number_Disp(mimaread, 3, 200);
if(Datajudgment())
{
saomafinish = 3;
firstpowerflag = 2;
General_Number_Disp(writesuccess, 3, 250);
}
else
{
General_Number_Disp(writefail, 3, 250);
}
}
break;
......@@ -269,14 +330,14 @@ uint8_t yibiaoshuju[34];
// cmperweima[i] = barcode_Msg1[i];
// }
cmperweima[34] = 0xFF;
General_Number_Disp(cmperweima, 3, 90);
memcpy(yibiaoshuju,get_num_buf,34);
General_Number_Disp(cmperweima, 3, 60);
// memcpy(yibiaoshuju,get_num_buf,34);
// for(int i =0;i<34;i++)
// {
// yibiaoshuju[i] = get_num_buf[i];
// }
yibiaoshuju[34] = 0xFF;
General_Number_Disp(yibiaoshuju, 3, 165);
// yibiaoshuju[34] = 0xFF;
// General_Number_Disp(yibiaoshuju, 3, 165);
// zhenduanflag = 3;
// comparestart = 1;
break;
......
......@@ -45,7 +45,7 @@ extern unsigned char KEYBUFFER [ 4 ];
extern unsigned int CAN_Msg_Tx_Enable;
extern uint8_t loc_Type_back;
extern uint8_t LED_Waring ;
extern uint8_t writefail[5];
void SET_IPK_NONE(void);
void Clear_IPK_NONE(void);
void CHECK_IPK_COUNT(void);
......
......@@ -2892,7 +2892,7 @@ uint32_t Get_Display_Type(void)
{
return 2;
}
else if(zhenduanflag == 1)
else if((zhenduanflag == 1) || (zhenduanflag == 2))
{
return 0;
}
......
......@@ -11,15 +11,14 @@ void Key_Operation_SW5(Key_Event_en_t enKeyEvent) //下一步
{
if ( enKeyEvent == KEY_EVENT_SHORT_PRESS )
{
if(zhenduanflag == 1)
{
zhenduanflag = 0;
}
if(firstpowerflag == 2)
{
if(saomafinish == 3)
{
MENU_CHECK_STEP_ADD( );
zhenduansendStep = 0;
zhenduanflag = 0;
}
}
}
else if ( enKeyEvent == KEY_EVENT_LONG_PRESS )
......@@ -45,10 +44,12 @@ void Key_Operation_SW4(Key_Event_en_t enKeyEvent) //上一步
{
if ( enKeyEvent == KEY_EVENT_SHORT_PRESS )
{
if(firstpowerflag == 2)
{
MENU_CHECK_STEP_SUB();
}
// if(firstpowerflag == 2)
// {
// MENU_CHECK_STEP_SUB();
// }
zhenduanflag = 1;
}
else if ( enKeyEvent == KEY_EVENT_LONG_PRESS )
{
......@@ -406,26 +407,11 @@ void Key_Operation_SW10(Key_Event_en_t enKeyEvent)
if(firstpowerflag == 2)
{
// Display_TFT_Clear();
// if(connectbleFlag == 0)
// {
// connectbleFlag = 1;
// name1= (devicename) & 0xFF;
// name2 = (devicename >> 8) & 0xFF;
// }
// else
// {
// name1= (devicename) & 0xFF;
// name2 = (devicename >> 8) & 0xFF;
// startONfalg = 0;
// send0x42time = 0;
// bleOFFtoONtime = 0;
// startONfalg = 0;
// startIGONtime = 0;
// recvflag111 = 0;
// }
clearOdoFlag = 1;
// queren = 1;
// clearOdoFlag = 1;
if(zhenduanflag == 1)
{
zhenduansendStep = 5;
}
}
}
else if ( enKeyEvent == KEY_EVENT_LONG_PRESS )
......
......@@ -483,9 +483,9 @@ uint32_t R485_Send_0x04(void)
length = 37;
break;
case 4:
length = 3;
break;
case 5:
length = 3;
break;
case 6:
length = 3;
......@@ -518,7 +518,7 @@ uint32_t R485_Send_0x04(void)
R485_zhenduan_Msg[2] = 0x0;
memcpy(R485_zhenduan_Msg+3,barcode_Msg,34);
break;
case 4:
case 5:
R485_zhenduan_Msg[0] = 0x22;
R485_zhenduan_Msg[1] = 0x50;
R485_zhenduan_Msg[2] = 0x0;
......@@ -527,10 +527,10 @@ uint32_t R485_Send_0x04(void)
break;
}
RS485_TX_finish = 1;
// if(zhenduansendStep = 4)
// {
if(zhenduansendStep != 4)
{
u32sendendflag = R485_Send(0x04, R485_zhenduan_Msg, length);
// }
}
RS485_send_time = 0;
RS485_TX_finish = 1;
......
......@@ -447,8 +447,6 @@ void Sys_Run_Mode_100ms_Tasks_Group(void)
}
// comparestart = 1;
}
}
else
{
......
......@@ -118,11 +118,11 @@ void Sys_Startup_Init(void)
LINE_OUT_NEG_03 = 1;
LINE_OUT_NEG_04 = 1;
// Display_TFT_Clear();
// GUI_Display_Version_Code_Service(25, 20, "Please Scan The Code ", Letter_Num_11, PCodeText_Space_size);
Display_TFT_Clear();
GUI_Display_Version_Code_Service(25, 20, "Please Scan The Code ", Letter_Num_11, PCodeText_Space_size);
/*上电扫码校验功能如果需要扫码校验注释掉firstpowerflag = 2,打开上面两行的注释即可*/
firstpowerflag = 2;
// firstpowerflag = 2;
}
/***********************************************************************
......
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