Commit 1b87c8ef authored by 何锐's avatar 何锐

feat:增加读写UUID功能

parent 945a3bb5
...@@ -49,6 +49,7 @@ uint8_t get_num_buf[34]; ...@@ -49,6 +49,7 @@ uint8_t get_num_buf[34];
uint8_t comparestart; uint8_t comparestart;
uint8_t blename[5]; uint8_t blename[5];
uint8_t btmac[6]; uint8_t btmac[6];
uint8_t uidread[33];
uint8_t firstpowerflag = 0; uint8_t firstpowerflag = 0;
uint16_t lightnumber = 0; uint16_t lightnumber = 0;
uint8_t writeflag = 0; uint8_t writeflag = 0;
...@@ -140,6 +141,11 @@ void datacheck(void) ...@@ -140,6 +141,11 @@ void datacheck(void)
recvflag111 = 1; recvflag111 = 1;
RS485_TX_finish = 0; RS485_TX_finish = 0;
// General_Number_Disp(blename, 3, 165); // General_Number_Disp(blename, 3, 165);
for(int i = 0; i<32; i++)
{
uidread[i] = BarCode[i+17];
}
uidread[32] = 0xFF;
} }
break; break;
case 0x4F: case 0x4F:
......
...@@ -38,5 +38,6 @@ extern uint8_t recvflag111; ...@@ -38,5 +38,6 @@ extern uint8_t recvflag111;
extern uint8_t firstpowerflag; extern uint8_t firstpowerflag;
extern uint16_t lightnumber; extern uint16_t lightnumber;
extern uint8_t btmac[6]; extern uint8_t btmac[6];
extern uint8_t uidread[33];
extern uint8_t writeflag; extern uint8_t writeflag;
#endif #endif
\ No newline at end of file
...@@ -49,6 +49,9 @@ enum DisplayFont ...@@ -49,6 +49,9 @@ enum DisplayFont
extern unsigned int Display_Menu_Type; extern unsigned int Display_Menu_Type;
extern uint32_t odo_val_Back ; extern uint32_t odo_val_Back ;
extern uint8_t uuidmodel;
extern uint8_t UUIDX;
extern uint8_t change;
void GeneralInfoDisp(unsigned char *p, unsigned short x, unsigned short y); void GeneralInfoDisp(unsigned char *p, unsigned short x, unsigned short y);
void Display_Title_Info(void); void Display_Title_Info(void);
void Display_Version_Info(uint32_t ON_OFF); void Display_Version_Info(uint32_t ON_OFF);
...@@ -56,6 +59,7 @@ void Display_Version_Info(uint32_t ON_OFF); ...@@ -56,6 +59,7 @@ void Display_Version_Info(uint32_t ON_OFF);
extern void HW_Static_Current_Check(uint32_t cmd); extern void HW_Static_Current_Check(uint32_t cmd);
void HW_Voltage_Check(uint32_t cmd); void HW_Voltage_Check(uint32_t cmd);
void Display_TFT_Clear(void); void Display_TFT_Clear(void);
void Display_TFT_Clear_UID(void);
void Display_Add(void); void Display_Add(void);
unsigned int Get_Display_Type(void); unsigned int Get_Display_Type(void);
void General_Number_Disp(unsigned char *p, unsigned short x, unsigned short y); void General_Number_Disp(unsigned char *p, unsigned short x, unsigned short y);
...@@ -77,7 +81,7 @@ void Buzzer_Start(void); ...@@ -77,7 +81,7 @@ void Buzzer_Start(void);
void Buzzer_Stop(void); void Buzzer_Stop(void);
extern void Buzzer_Init(void); extern void Buzzer_Init(void);
extern void Buzzer_Warning(void); extern void Buzzer_Warning(void);
extern void UUID_Write(void);
void GUI_General_Digit_Display(uint32_t Digit, const uint8_t *Font[], uint8_t Len, uint8_t Blank, const uint16_t *px, uint16_t y); void GUI_General_Digit_Display(uint32_t Digit, const uint8_t *Font[], uint8_t Len, uint8_t Blank, const uint16_t *px, uint16_t y);
...@@ -90,7 +94,7 @@ extern const uint8_t *Num_09[]; ...@@ -90,7 +94,7 @@ extern const uint8_t *Num_09[];
extern const uint8_t *Num_10_03[]; extern const uint8_t *Num_10_03[];
extern const uint8_t *Num_13[]; extern const uint8_t *Num_13[];
extern const uint8_t *Num_30[]; extern const uint8_t *Num_30[];
extern uint8_t uuidnumber2[21];
extern const uint8_t * Letter_Num_11[]; extern const uint8_t * Letter_Num_11[];
extern uint32_t loc_Current_0; extern uint32_t loc_Current_0;
......
...@@ -5,26 +5,32 @@ ...@@ -5,26 +5,32 @@
#include "Barcode_Scanner.h" #include "Barcode_Scanner.h"
#include "Task.h" #include "Task.h"
#include "string.h" #include "string.h"
#define R485_CLEAR_START 11 // 起始索引
#define R485_CLEAR_LEN 33 // 清零长度(元素个数)
void Key_Operation_SW5(Key_Event_en_t enKeyEvent) void Key_Operation_SW5(Key_Event_en_t enKeyEvent)
{ {
if ( enKeyEvent == KEY_EVENT_SHORT_PRESS ) if ( enKeyEvent == KEY_EVENT_SHORT_PRESS )
{ {
// if ( (LED_Waring == 1) || (UDS_Warning_Voltage ==1)) if(uuidmodel == 0)
// {
// ;
// }
// else
// {
// Display_Add( );
// Display_TFT_Clear( );
// }
if(firstpowerflag == 2)
{ {
MENU_CHECK_STEP_ADD( ); if(firstpowerflag == 2)
{
MENU_CHECK_STEP_ADD( );
}
} }
else
{
if(uuidnumber2[change] < 0x39)
{
uuidnumber2[change]++;
}
else
{
uuidnumber2[change] = 0x30;
}
}
} }
else if ( enKeyEvent == KEY_EVENT_LONG_PRESS ) else if ( enKeyEvent == KEY_EVENT_LONG_PRESS )
{ {
...@@ -41,40 +47,35 @@ void Key_Operation_SW5(Key_Event_en_t enKeyEvent) ...@@ -41,40 +47,35 @@ void Key_Operation_SW5(Key_Event_en_t enKeyEvent)
} }
} }
} }
// else if ( enKeyEvent == KEY_EVENT_SUPER_LONG_PRESS )
// {
// if ( (LED_Waring == 1) || (UDS_Warning_Voltage ==1))
// {
// ;
// }
// else
// {
// Display_Add( );
// Display_TFT_Clear( );
// }
// }
else else
{ {
} }
} }
void Key_Operation_SW4(Key_Event_en_t enKeyEvent) void Key_Operation_SW4(Key_Event_en_t enKeyEvent)
{ {
if ( enKeyEvent == KEY_EVENT_SHORT_PRESS ) if ( enKeyEvent == KEY_EVENT_SHORT_PRESS )
{ {
// if ( (LED_Waring == 1) || (UDS_Warning_Voltage ==1)) if(uuidmodel == 0)
// {
// ;
// }
// else
// {
// Display_Sub( );
// Display_TFT_Clear( );
// }
if(firstpowerflag == 2)
{ {
MENU_CHECK_STEP_SUB(); if(firstpowerflag == 2)
{
MENU_CHECK_STEP_SUB();
}
}
else
{
Display_TFT_Clear_UID();
if(UUIDX > 0)
{
UUIDX -= 10;
change--;
}
else
{
change = 19;
UUIDX = 190;
}
} }
} }
else if ( enKeyEvent == KEY_EVENT_LONG_PRESS ) else if ( enKeyEvent == KEY_EVENT_LONG_PRESS )
...@@ -183,6 +184,17 @@ void Key_Operation_SW2(Key_Event_en_t enKeyEvent) ...@@ -183,6 +184,17 @@ void Key_Operation_SW2(Key_Event_en_t enKeyEvent)
} }
else if ( enKeyEvent == KEY_EVENT_LONG_PRESS ) else if ( enKeyEvent == KEY_EVENT_LONG_PRESS )
{ {
if(firstpowerflag == 2)
{
if(Auto_ONOFF != 0)
{
Auto_ONOFF = 0;
}
else
{
Auto_ONOFF = 1;
}
}
} }
else if ( enKeyEvent == KEY_EVENT_SUPER_LONG_PRESS ) else if ( enKeyEvent == KEY_EVENT_SUPER_LONG_PRESS )
{ {
...@@ -233,21 +245,18 @@ void Key_Operation_SW1(Key_Event_en_t enKeyEvent) ...@@ -233,21 +245,18 @@ void Key_Operation_SW1(Key_Event_en_t enKeyEvent)
/*清零ODO*/ /*清零ODO*/
if ( enKeyEvent == KEY_EVENT_SHORT_PRESS ) if ( enKeyEvent == KEY_EVENT_SHORT_PRESS )
{ {
if(firstpowerflag == 2) if(uuidmodel == 1)
{ {
if(Auto_ONOFF != 0) UUID_Write();
{
Auto_ONOFF = 0;
}
else
{
Auto_ONOFF = 1;
}
} }
uuidmodel = 1;
Display_TFT_Clear();
} }
else if ( enKeyEvent == KEY_EVENT_LONG_PRESS ) else if ( enKeyEvent == KEY_EVENT_LONG_PRESS )
{ {
uuidmodel = 0;
Display_TFT_Clear();
memset(&R485_0x80_msg[R485_CLEAR_START], 0, R485_CLEAR_LEN);
} }
else if ( enKeyEvent == KEY_EVENT_SUPER_LONG_PRESS ) else if ( enKeyEvent == KEY_EVENT_SUPER_LONG_PRESS )
{ {
......
...@@ -631,14 +631,14 @@ void Sys_Exact_100ms_Tasks(void) ...@@ -631,14 +631,14 @@ void Sys_Exact_100ms_Tasks(void)
startIGONtime++; startIGONtime++;
if(startIGONtime % 20 == 0) if(startIGONtime % 20 == 0)
{ {
if(R485_0x80_msg[11] < 5) // if(R485_0x80_msg[11] < 5)
{ // {
R485_0x80_msg[11]++; // R485_0x80_msg[11]++;
} // }
else // else
{ // {
R485_0x80_msg[11] = 0; // R485_0x80_msg[11] = 0;
} // }
} }
} }
...@@ -653,16 +653,16 @@ void Sys_Exact_100ms_Tasks(void) ...@@ -653,16 +653,16 @@ void Sys_Exact_100ms_Tasks(void)
clearodotimeflash++; clearodotimeflash++;
if (clearodotimeflash % 20 == 0) if (clearodotimeflash % 20 == 0)
{ {
if (R485_0x80_msg[11] < 5) // if (R485_0x80_msg[11] < 5)
{ // {
R485_0x80_msg[11]++; // R485_0x80_msg[11]++;
R485_0x80_msg[10]++; // R485_0x80_msg[10]++;
} // }
else // else
{ // {
R485_0x80_msg[11] = 0; // R485_0x80_msg[11] = 0;
R485_0x80_msg[10] = 0; // R485_0x80_msg[10] = 0;
} // }
} }
// CHECK_IPK_COUNT( ); // CHECK_IPK_COUNT( );
} }
......
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