Commit ea3ba641 authored by 何锐's avatar 何锐

feat:修改UUID32位全部可控

parent 1b87c8ef
...@@ -2904,7 +2904,22 @@ void Display_TFT_Clear(void) ...@@ -2904,7 +2904,22 @@ void Display_TFT_Clear(void)
void Display_TFT_Clear_UID(void) void Display_TFT_Clear_UID(void)
{ {
TFT_LCD_Draw_Box(0, 100, 239, 120, TFT_LCD_FILL_FULL, TFT_LCD_TYPE_CLR); TFT_LCD_Draw_Box(0, 115, 239, 135, TFT_LCD_FILL_FULL, TFT_LCD_TYPE_CLR);
}
void Display_TFT_Clear_UID2(void)
{
TFT_LCD_Draw_Box(0, 67, 239, 92, TFT_LCD_FILL_FULL, TFT_LCD_TYPE_CLR);
}
void Display_TFT_Clear_UID3(void) //清除上半写入主要区域,防止增加数字字母到重叠
{
TFT_LCD_Draw_Box(0, 50, 239, 150, TFT_LCD_FILL_FULL, TFT_LCD_TYPE_CLR);
}
void Display_TFT_Clear_UID4(void) //清除下半读取主要区域,防止增加数字字母到重叠
{
TFT_LCD_Draw_Box(0, 150, 239, 319, TFT_LCD_FILL_FULL, TFT_LCD_TYPE_CLR);
} }
void Display_Add(void) void Display_Add(void)
...@@ -3659,21 +3674,21 @@ void Check_PWM(void) ...@@ -3659,21 +3674,21 @@ void Check_PWM(void)
} }
void uuidnumber2_increment_with_carry(void) void uuidnumber2_increment_with_carry(void)
{ {
for(uint8_t i = 19; i > 1; i--) // for(uint8_t i = 19; i > 1; i--)
{ // {
if(uuidnumber2[i] < 0x39) // if(uuidnumber2[i] < 0x39)
{ // {
uuidnumber2[i] += 1; // uuidnumber2[i] += 1;
return; // return;
} // }
else // else
{ // {
uuidnumber2[i] = 0x30; // uuidnumber2[i] = 0x30;
} // }
} // }
} }
uint8_t uuidnumber1[UUID1_EFFECT_LEN + 1] = {0x54,0x59,0x57,0x31,0x39,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0xFF}; uint8_t uuidnumber1[UUID1_EFFECT_LEN + 1] = {0x33,0x37,0x31,0x30,0x30,0x43,0x30,0x32,0x30,0x30,0x31,0x30,0xFF};
uint8_t uuidnumber2[UUID2_EFFECT_LEN + 1] = {0x32,0x30,0x32,0x35,0x30,0x35,0x31,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x39,0xFF}; uint8_t uuidnumber2[UUID2_EFFECT_LEN + 1] = {0x30,0x33,0x39,0x33,0x32,0x33,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x31,0x32,0x32,0x32,0x32,0x32,0x32,0xFF};
uint8_t uuidmodel = 0; uint8_t uuidmodel = 0;
void UUID_Write(void) void UUID_Write(void)
{ {
...@@ -3696,7 +3711,7 @@ void UUID_Write(void) ...@@ -3696,7 +3711,7 @@ void UUID_Write(void)
R485_0x80_msg[CRC_MSG_POS] = uuidcrc & 0xFF; R485_0x80_msg[CRC_MSG_POS] = uuidcrc & 0xFF;
uuidnumber2_increment_with_carry(); uuidnumber2_increment_with_carry();
} }
uint8_t UUIDX = 190; uint8_t UUIDX = 193;
uint8_t change = 19; uint8_t change = 19;
uint32_t leftvoltage; uint32_t leftvoltage;
uint32_t rightvoltage; uint32_t rightvoltage;
...@@ -3731,15 +3746,24 @@ void Display_Version_Info(uint32_t ON_OFF) ...@@ -3731,15 +3746,24 @@ void Display_Version_Info(uint32_t ON_OFF)
{ {
if(uuidmodel == 1) if(uuidmodel == 1)
{ {
// uuidnumber[33] = 0xFF; uint8_t UUIDY;
if(CursorPosition == 2)
{
UUIDY = 105;
}
else if(CursorPosition == 1)
{
UUIDY = 67;
}
TFT_LCD_Draw_Bmp(3, 25, ( uint8_t * )gImage_Dyy_words_3X6_Y75UID ); //写入UID TFT_LCD_Draw_Bmp(3, 25, ( uint8_t * )gImage_Dyy_words_3X6_Y75UID ); //写入UID
General_Number_Disp(uuidnumber1,3, 50); General_Number_Disp(uuidnumber1,3, 50);
General_Number_Disp(uuidnumber2,3, 75); General_Number_Disp(uuidnumber2,3, 90);
uint8_t UUIDS[2] = {45,0xFF}; uint8_t UUIDS[2] = {45,0xFF};
General_Number_Disp(UUIDS, UUIDX, 92); //UID下—— General_Number_Disp(UUIDS, UUIDX, UUIDY); //UID下——
TFT_LCD_Draw_Bmp(3, 125, ( uint8_t * )gImage_Dyy_words_3X6_Y75UIDRead ); //读取UID TFT_LCD_Draw_Bmp(3, 175, ( uint8_t * )gImage_Dyy_words_3X6_Y75UIDRead ); //读取UID
General_Number_Disp(uidread,3, 150); General_Number_Disp(uidread,3, 200);
} }
else else
{ {
...@@ -3902,7 +3926,7 @@ void Display_Version_Info(uint32_t ON_OFF) ...@@ -3902,7 +3926,7 @@ void Display_Version_Info(uint32_t ON_OFF)
// TFT_LCD_Draw_Bmp(3, 160, ( uint8_t * )gImage_Alarm_12_WordX6_Y165); //24脚输出占空比 // TFT_LCD_Draw_Bmp(3, 160, ( uint8_t * )gImage_Alarm_12_WordX6_Y165); //24脚输出占空比
// TFT_LCD_Draw_Bmp(210, 160, ( uint8_t * )gImage_Alarm_13_ImageX222_Y166); //% // TFT_LCD_Draw_Bmp(210, 160, ( uint8_t * )gImage_Alarm_13_ImageX222_Y166); //%
TFT_LCD_Draw_Bmp(3, 290, ( uint8_t * )gImage_gImage_checkVX6_Y165 ); //检测台版本号 TFT_LCD_Draw_Bmp(3, 290, ( uint8_t * )gImage_gImage_checkVX6_Y165 ); //检测台版本号
uint8_t mbuff [7] = {2,5,1,0,0,7,0xff}; uint8_t mbuff [7] = {2,5,1,1,0,7,0xff};
General_Number_Disp(mbuff, 160, 290); General_Number_Disp(mbuff, 160, 290);
} }
......
...@@ -60,6 +60,9 @@ extern void HW_Static_Current_Check(uint32_t cmd); ...@@ -60,6 +60,9 @@ 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_TFT_Clear_UID(void);
void Display_TFT_Clear_UID2(void);
void Display_TFT_Clear_UID3(void);
void Display_TFT_Clear_UID4(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);
...@@ -88,6 +91,7 @@ void GUI_General_Digit_Display(uint32_t Digit, const uint8_t *Font[], uint8_t Le ...@@ -88,6 +91,7 @@ void GUI_General_Digit_Display(uint32_t Digit, const uint8_t *Font[], uint8_t Le
void GUI_Display_Version_Code_Service(uint8_t StarX, uint16_t PosY, uint8_t * Str, const uint8_t * Version[] , uint8_t SpaceKeySize); void GUI_Display_Version_Code_Service(uint8_t StarX, uint16_t PosY, uint8_t * Str, const uint8_t * Version[] , uint8_t SpaceKeySize);
extern uint8_t UDS_Warning_Voltage; extern uint8_t UDS_Warning_Voltage;
extern uint8_t CursorPosition;
extern const uint16_t BackLightDigitNum09PosX[]; extern const uint16_t BackLightDigitNum09PosX[];
extern const uint8_t *Num_09[]; extern const uint8_t *Num_09[];
...@@ -95,6 +99,7 @@ extern const uint8_t *Num_10_03[]; ...@@ -95,6 +99,7 @@ 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 uint8_t uuidnumber2[21];
extern uint8_t uuidnumber1[13];
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;
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
#define R485_CLEAR_START 11 // 起始索引 #define R485_CLEAR_START 11 // 起始索引
#define R485_CLEAR_LEN 33 // 清零长度(元素个数) #define R485_CLEAR_LEN 33 // 清零长度(元素个数)
uint8_t delayflag;
uint8_t CursorPosition = 2;
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 )
...@@ -22,15 +24,48 @@ void Key_Operation_SW5(Key_Event_en_t enKeyEvent) ...@@ -22,15 +24,48 @@ void Key_Operation_SW5(Key_Event_en_t enKeyEvent)
} }
else else
{ {
if(uuidnumber2[change] < 0x39) if(CursorPosition == 2)
{
if(uuidnumber2[change] < 0x5A)
{
if(uuidnumber2[change] == 0x39)
{
uuidnumber2[change] = 0x41;
Display_TFT_Clear_UID3();
}
else
{ {
uuidnumber2[change]++; uuidnumber2[change]++;
if((uuidnumber2[change] > 0x39) || (uuidnumber2[change] == 0x30))
{
Display_TFT_Clear_UID3();
}
}
} }
else else
{ {
uuidnumber2[change] = 0x30; uuidnumber2[change] = 0x30;
} }
} }
else if(CursorPosition == 1)
{
if(uuidnumber1[change] < 0x5A)
{
if(uuidnumber1[change] == 0x39)
{
uuidnumber1[change] = 0x41;
}
else
{
uuidnumber1[change]++;
}
}
else
{
uuidnumber1[change] = 0x30;
}
}
}
} }
else if ( enKeyEvent == KEY_EVENT_LONG_PRESS ) else if ( enKeyEvent == KEY_EVENT_LONG_PRESS )
{ {
...@@ -66,15 +101,26 @@ void Key_Operation_SW4(Key_Event_en_t enKeyEvent) ...@@ -66,15 +101,26 @@ void Key_Operation_SW4(Key_Event_en_t enKeyEvent)
else else
{ {
Display_TFT_Clear_UID(); Display_TFT_Clear_UID();
if(UUIDX > 0) Display_TFT_Clear_UID2();
if(change > 0)
{ {
UUIDX -= 10; UUIDX -= 10;
change--; change--;
} }
else else
{
if(CursorPosition == 2)
{
change = 11; //第一行最后一位
UUIDX = 113; //第一行坐标
CursorPosition = 1; //配置到第一行
}
else if(CursorPosition == 1)
{ {
change = 19; change = 19;
UUIDX = 190; UUIDX = 193; //第一行坐标
CursorPosition = 2;
}
} }
} }
} }
...@@ -247,7 +293,9 @@ void Key_Operation_SW1(Key_Event_en_t enKeyEvent) ...@@ -247,7 +293,9 @@ void Key_Operation_SW1(Key_Event_en_t enKeyEvent)
{ {
if(uuidmodel == 1) if(uuidmodel == 1)
{ {
Display_TFT_Clear_UID4();
UUID_Write(); UUID_Write();
delayflag = 1;
} }
uuidmodel = 1; uuidmodel = 1;
Display_TFT_Clear(); Display_TFT_Clear();
......
...@@ -408,6 +408,7 @@ uint8_t compareresult; ...@@ -408,6 +408,7 @@ uint8_t compareresult;
uint8_t flashtime = 0; uint8_t flashtime = 0;
uint8_t showtime = 0; uint8_t showtime = 0;
uint8_t bleuarttime = 0; uint8_t bleuarttime = 0;
uint8_t delaytime;
void Sys_Run_Mode_100ms_Tasks_Group(void) void Sys_Run_Mode_100ms_Tasks_Group(void)
{ {
static uint32_t loc_timer = 0; static uint32_t loc_timer = 0;
...@@ -420,6 +421,16 @@ void Sys_Run_Mode_100ms_Tasks_Group(void) ...@@ -420,6 +421,16 @@ void Sys_Run_Mode_100ms_Tasks_Group(void)
} }
Display_PageNum(); Display_PageNum();
if(delayflag == 1)
{
delaytime++;
if(delaytime >= 20)
{
delaytime = 0;
delayflag = 0;
Display_TFT_Clear_UID4();
}
}
// Freln_Duty_HZ_Service(); // Freln_Duty_HZ_Service();
......
...@@ -10,6 +10,7 @@ extern uint32_t bleOFFtoONtime; ...@@ -10,6 +10,7 @@ extern uint32_t bleOFFtoONtime;
extern uint8_t startONfalg; extern uint8_t startONfalg;
extern uint32_t startIGONtime; extern uint32_t startIGONtime;
extern uint8_t Openble[20]; extern uint8_t Openble[20];
extern uint8_t delayflag;
void Sys_Run_Mode_Pseudo_Real_Time_Tasks(void); void Sys_Run_Mode_Pseudo_Real_Time_Tasks(void);
void Sys_Run_Mode_2ms_Tasks_Group(void); void Sys_Run_Mode_2ms_Tasks_Group(void);
void Sys_Run_Mode_5ms_Tasks_Group(void); void Sys_Run_Mode_5ms_Tasks_Group(void);
......
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