Commit d8863c8a authored by 梁百峰's avatar 梁百峰

feat:最终版之后只需要改版本号判断即可

parent e61771f5
......@@ -72,7 +72,7 @@ void MENU_CHECK_STEP_ADD(void)
{
MENU_CHECK_STEP++;
if(MENU_CHECK_STEP > 15)
if(MENU_CHECK_STEP > 17)
{
MENU_CHECK_STEP = 0;
}
......@@ -292,11 +292,15 @@ uint8_t yibiaoshuju[34];
case 3:
blename[4] = 0xFF;
if(recvflag111 == 1)
// if(recvflag111 == 1)
// {
if((blename[0]+blename[1]+blename[2]+blename[3]) != 0)
{
General_Number_Disp(blename, 3, 165);
recvflag111 = 0;
}
// recvflag111 = 0;
// }
// POWER_CTRL_KL30 = 0u; //B+
// POWER_CTRL_KL15 = 0u; //KL15
......@@ -600,12 +604,14 @@ void Function_Check_Ctrl(uint32_t cmd)
if(Auto_ONOFF == 0)
{
LINE_OUT_NEG_01 = 1;
LINE_OUT_NEG_04 = 1;
}
LINE_OUT_NEG_02 = 1;
LINE_OUT_NEG_03 = 1;
LINE_OUT_NEG_04 = 1;
POWER_CTRL_KL30 = 0;
name1= (devicename) & 0xFF;
name2 = (devicename >> 8) & 0xFF;
break;
}
......@@ -743,10 +749,11 @@ void Function_Check_Ctrl(uint32_t cmd)
if(Auto_ONOFF == 0)
{
LINE_OUT_NEG_01 = 1;
LINE_OUT_NEG_04 = 1;
}
LINE_OUT_NEG_02 = 1;
LINE_OUT_NEG_03 = 1;
LINE_OUT_NEG_04 = 1;
LED3 = 1;
LED4 = 1;
LINE_OUT_NEG_05 = 0;
......@@ -791,14 +798,58 @@ void Function_Check_Ctrl(uint32_t cmd)
if(Auto_ONOFF == 0)
{
LINE_OUT_NEG_01 = 0;
LINE_OUT_NEG_04 = 1;
}
LINE_OUT_NEG_02 = 1;
LINE_OUT_NEG_03 = 1;
LINE_OUT_NEG_04 = 1;
POWER_CTRL_KL30 = 0;
break;
}
case 15:
{
LED3 = 0; //右转
LED4 = 0;
LINE_OUT_NEG_05 = 0;
LINE_OUT_NEG_06 = 1;
LINE_jinguang = 0;
POWER_CTRL_KL30_Current = 0;
if(Auto_ONOFF == 0)
{
LINE_OUT_NEG_01 = 0;
LINE_OUT_NEG_04 = 0;
}
LINE_OUT_NEG_02 = 0;
LINE_OUT_NEG_03 = 0;
POWER_CTRL_KL30 = 0;
break;
}
case 16:
{
LED3 = 0; //右转
LED4 = 0;
LINE_OUT_NEG_05 = 0;
LINE_OUT_NEG_06 = 1;
LINE_jinguang = 0;
POWER_CTRL_KL30_Current = 0;
if(Auto_ONOFF == 0)
{
LINE_OUT_NEG_01 = 1;
LINE_OUT_NEG_04 = 1;
}
LINE_OUT_NEG_02 = 1;
LINE_OUT_NEG_03 = 1;
POWER_CTRL_KL30 = 0;
break;
}
// case 21:
// {
// LINE_OUT_POS_01 = 1;
......
......@@ -3567,16 +3567,12 @@ void HW_Static_Current_Check(uint32_t cmd)
// // loc_ret /= 100;//转化为电流,单位0.001毫安
// loc_ret /= 10;//单位0.1毫安
if(loc_ret1 != 0)
{
TFT_LCD_Draw_Bmp(190, 60, ( uint8_t * )gImage_Number_15_white_PiontX0_Y0);
GUI_General_Digit_Display(loc_ret1, Num_15, 3, 0, CurrentDigitNum09PosX, 60);
loc_ret1 = 0;
}
// loc_ret = 0;
// }
}
}
uint8_t CurrentWrong = 0;
void Get_static_Current(void)
{
static uint32_t loc_Timer = 0;
......@@ -3597,6 +3593,26 @@ void Get_static_Current(void)
loc_ret /= 10;//单位0.1毫安
loc_ret1 = loc_ret;
}
if(loc_ret1 != 0)
{
TFT_LCD_Draw_Bmp(190, 60, ( uint8_t * )gImage_Number_15_white_PiontX0_Y0);
GUI_General_Digit_Display(loc_ret1, Num_15, 3, 0, CurrentDigitNum09PosX, 60);
if(loc_ret1 > 10)
{
MENU_CHECK_STEP = 13;
CurrentWrong = 1;
}
else
{
CurrentWrong = 0;
}
loc_ret1 = 0;
}
else
{
MENU_CHECK_STEP = 13;
// CurrentWrong = 1;
}
}
}
......@@ -3691,7 +3707,7 @@ void Display_Version_Info(uint32_t ON_OFF)
if(R485_ID4Dh.Sig.MaterialCode07 == 0x47)
{
nowbanbenhao = 1;
nowbanbenhaohoumian = 1;
nowbanbenhaohoumian = 9;
}
else if(R485_ID4Dh.Sig.MaterialCode07 == 0x43)
{
......@@ -3743,8 +3759,8 @@ void Display_Version_Info(uint32_t ON_OFF)
{
TFT_LCD_Draw_Bmp(200, 90+25+25+30+30+30, ( uint8_t * )gImage_dui ); //硬线指示灯外发对比 对
}
TFT_LCD_Draw_Bmp(3, 90+25+25+30+30+30, ( uint8_t * )gImage_gImage_LEDwaif1X6_Y16 ); //硬线指示灯外发对比
TFT_LCD_Draw_Bmp(3, 90+25+25+30+25+30+30, ( uint8_t * )gImage_gImage_SV1X6_Y16 ); //软件版本号对比
TFT_LCD_Draw_Bmp(3, 90+25+25+30+30+30+5, ( uint8_t * )gImage_gImage_LEDwaif1X6_Y16 ); //硬线指示灯外发对比
TFT_LCD_Draw_Bmp(3, 90+25+25+30+25+30+30+5, ( uint8_t * )gImage_gImage_SV1X6_Y16 ); //软件版本号对比
if((R485_ID4Dh.Sig.ESP322 != 0) && ( R485_ID4Dh.Sig.G0312 != 0))
{
if((nowbanbenhao == R485_ID4Dh.Sig.ESP322) && (nowbanbenhaohoumian == R485_ID4Dh.Sig.ESP321) && (nowbanbenhao == R485_ID4Dh.Sig.G0312) && (nowbanbenhaohoumian == R485_ID4Dh.Sig.G0311))
......@@ -3757,6 +3773,9 @@ void Display_Version_Info(uint32_t ON_OFF)
TFT_LCD_Draw_Bmp(200, 90+25+25+30+25+30+30, ( uint8_t * )gImage_cuo ); //软件版本号对比 错
firstpowerflag = 3;
MENU_CHECK_STEP = 0;
//正在调试取消版本号对比 想要取消版本号对比将上方注释掉并解开下方注释即可
// TFT_LCD_Draw_Bmp(200, 90+25+25+30+25+30+30, ( uint8_t * )gImage_dui ); //软件版本号对比 对
// firstpowerflag = 2;
}
}
else
......@@ -3780,7 +3799,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(210, 160, ( uint8_t * )gImage_Alarm_13_ImageX222_Y166); //%
TFT_LCD_Draw_Bmp(3, 290, ( uint8_t * )gImage_gImage_checkVX6_Y165 ); //检测台版本号
uint8_t mbuff [4] = {1,0,3,0xff};
uint8_t mbuff [4] = {1,1,0,0xff};
General_Number_Disp(mbuff, 160, 290);
}
......@@ -4226,7 +4245,7 @@ void Display_Send_Vspead(uint8_t menu)
}
if(menu > 0)
{
if(menu != 13)
if(menu < 13 )
{
TFT_LCD_Draw_Bmp(3, 40, ( uint8_t * )gImage_Dey_words_1X6_Y16);
TFT_LCD_Draw_Bmp(180, 40, ( uint8_t * )gImage_Dey_words_5X195_Y16);
......@@ -4235,7 +4254,14 @@ void Display_Send_Vspead(uint8_t menu)
TFT_LCD_Draw_Bmp(3, 40+25+25+25+25+25+25, ( uint8_t * )gImage_gImage_checkComX6_Y165);
}
if(CurrentWrong == 1)
{
MENU_CHECK_STEP = 13;
}
else
{
;
}
switch (menu)
{
case 1:
......@@ -4542,13 +4568,30 @@ void Display_Send_Vspead(uint8_t menu)
HW_Static_Current_Check(1);
break;
case 14:
GUI_Display_Version_Code_Service(25, 20, "Please enter password ", Letter_Num_11, PCodeText_Space_size);
break;
case 15:
// blename[4] = 0xFF;
// if((blename[0]+blename[1]+blename[2]+blename[3]) != 0)
// {
// General_Number_Disp(blename, 3, 165);
// }
memset(blename,0xFF,5);
Display_TFT_Clear();
break;
case 16:
blename[4] = 0xFF;
GUI_Display_Version_Code_Service(3, 150, "BT Name is ", Letter_Num_11, PCodeText_Space_size);
if(((blename[0]+blename[1]+blename[2]+blename[3]) != 0) && (blename[0] != 0xFF) && (blename[1] != 0xFF)&& (blename[2] != 0xFF)&& (blename[3] != 0xFF))
{
General_Number_Disp(blename, 110, 150);
}
break;
default:
MENU_CHECK_STEP = 0;
break;
}
if(menu != 13)
if(menu < 13 && menu != 0)
{
GUI_General_Digit_Display(VSpeed_val, Num_15, 6, 5, ODODigitNum09PosX, 40);
GUI_General_Digit_Display(fuel_val, Num_15, 6, 5, ODODigitNum09PosX, 40+25);
......
......@@ -95,6 +95,7 @@ extern const uint8_t * Letter_Num_11[];
extern uint32_t loc_Current_0;
extern void Get_static_Current(void);
extern uint32_t Get_Display_Type(void);
extern const uint8_t *Num_15[];
#define PCodeText_Space_size 2//故障文字 英文空格的像素数
#endif
......@@ -204,11 +204,13 @@ void Key_Operation_SW3(Key_Event_en_t enKeyEvent)
if(clearOdoFlag == 0)
{
clearOdoFlag = 1;
}
else
{
clearOdoFlag = 0;
}
queren = 0;
}
}
else if ( enKeyEvent == KEY_EVENT_LONG_PRESS )
......
......@@ -113,6 +113,12 @@ void RTE_GPIO_Init(void)
gpio_temp.enGPIODir = GPIO_DIR_IN;
gpio_temp.enGPIOAltFun = GPIO_ALTER_FUN_1;
GPIO_Config(&gpio_temp);
gpio_temp.enGPIOPort = GPIO_PORT_GROUP_10;
gpio_temp.enGPIOPIN = GPIO_PIN_10;
gpio_temp.enGPIOMode = GPIO_MODE_PORT;
gpio_temp.enGPIODir = GPIO_DIR_OUT;
gpio_temp.enGPIOAltFun = GPIO_ALTER_FUN_1;
GPIO_Config(&gpio_temp);
queren = 0;
LINE_OUT_POS_06 = 0;
LINE_OUT_POS_07 = 0;
......
......@@ -19,6 +19,7 @@
#include "../UART/UART.h"
#include "string.h"
#include "api_RS485.h"
#include "RTE_WDT.h"
#include "R485_Communication_Matrix.h"
/*******************************************************************************
* *
......@@ -37,6 +38,7 @@ uint32_t bleOFFtoONtime = 0;
uint8_t startONfalg = 0;
uint32_t startIGONtime = 0;
uint8_t compareresult;
extern uint8_t keyopenble;
const unsigned char gImage_cuo1[] = {24, 24,0X00,0X00,0X00,0X00,0X30,0X70,0XE0,0XC0,0X80,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X80,0XC0,0X70,0X30,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X01,0X83,0XC7,0X66,0X38,0X38,0X7C,0XE6,0XC3,0X81,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X0C,0X0C,0X06,0X03,0X01,0X00,0X00,0X00,0X00,0X00,0X00,0X01,0X03,0X07,0X0E,0X0C,0X00,0X00,0X00,0X00,};
const unsigned char gImage_dui1[] = {24, 24,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X80,0XC0,0XE0,0X40,0X00,0X00,0X00,0X00,0X08,0X18,0X30,0X70,0XC0,0X80,0X00,0X00,0X80,0XC0,0XE0,0X70,0X38,0X1C,0X0E,0X07,0X03,0X01,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X01,0X03,0X07,0X03,0X01,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,};
void Sys_Run_Mode_Pseudo_Real_Time_Tasks(void)
......@@ -75,10 +77,12 @@ void Sys_Run_Mode_5ms_Tasks_Group(void)
/*==============================================================================
10ms����ִ������ ��0��
------------------------------------------------------------------------------*/
uint8_t testdata[3] = {0,1,2};
// uint8_t testdata[3] = {0,1,2};
uint8_t Openble[11] = {0};
uint32_t clearodotime;
uint32_t devicename = 0;
uint8_t sartigon = 0;
uint8_t sendflag = 0;
void Sys_Run_Mode_10ms_Tasks_Group(void)
{
// BusOff_Service( );
......@@ -91,22 +95,6 @@ void Sys_Run_Mode_10ms_Tasks_Group(void)
{
devicename = 0;
}
// Fre_In_Time_Out_Handle(10);
//刷数字、刷英文拼写。
//GUI_General_Digit_Display(123456789, Num_09, 10, 0, BackLightDigitNum09PosX, 79);
//GUI_General_Digit_Display(123456789, Num_10_03, 10, 0, BackLightDigitNum09PosX, 79+24*1);
//GUI_General_Digit_Display(123456789, Num_13, 10, 0, BackLightDigitNum09PosX, 79+24*2);
//GUI_General_Digit_Display(123456789, Num_30, 10, 0, BackLightDigitNum09PosX, 79+24*3);
//GUI_Display_Version_Code_Service((0), (79+24*0), "Please Check the Driver", Letter_Num_11, PCodeText_Space_size);
//GUI_Display_Version_Code_Service((0), (79+24*1), "ABCDEFGHIJKLMNOPQRST", Letter_Num_11, PCodeText_Space_size);
//GUI_Display_Version_Code_Service((0), (79+24*2), "UVWXYZ / ' @ - ", Letter_Num_11, PCodeText_Space_size);
//GUI_Display_Version_Code_Service((0), (79+24*3), "abcdefghijklmnopqrstuvwxyz", Letter_Num_11, PCodeText_Space_size);
//GUI_Display_Version_Code_Service((0), (79+24*4), "0123456789 18FEAB21", Letter_Num_11, PCodeText_Space_size);
// UART_Ch0_Send_Multiple_Byte(testdata,3);
// RS485_User_Tx_Data();
if(firstpowerflag == 2)
{
if(clearOdoFlag == 0)
......@@ -152,12 +140,20 @@ void Sys_Run_Mode_10ms_Tasks_Group(void)
// }
if(RS485_TX_finish == 0)
{
if(startONfalg == 0)
{
if(send0x42time<130)
{
R485_Send_0x42();
Display_TFT_Clear();
// if(sendflag == 1)
// {
R485_Send_0x42();
// sendflag = 0;
// }
queren = 0;
}
else
{
......@@ -180,8 +176,39 @@ void Sys_Run_Mode_10ms_Tasks_Group(void)
LINE_OUT_NEG_04 = 1;
if(startIGONtime >= 100)
{
R485_Send_0x80();
Openble[0] = 0x59;
Openble[1] = 0x44;
Openble[2] = 0xA;
Openble[3] = 0x8A;
Openble[4] = 0xA;
Openble[5] = 0xA;
Openble[6] = name2;
Openble[7] = name1;
Openble[8] = 1;
Openble[9] = 0x4B;
Openble[10] = 0x4A;
// RS485_User_Tx_Data();
if(sendflag == 1)
{
R485_Send_0x41();
sendflag = 0;
}
else
{
R485_Send_0x80();
sendflag = 1;
}
blename[4] = 0xFF;
// if(send0x42time % 20 == 0)
// {
UART_Ch2_Send_Multiple_Byte(Openble,sizeof(Openble));
// if(startIGONtime > 500)
// {
// queren = 1;
// }
// }
}
......@@ -190,6 +217,10 @@ void Sys_Run_Mode_10ms_Tasks_Group(void)
RS485_send_time = 0;
RS485_TX_finish = 1;
}
else
{
}
}
......@@ -213,7 +244,7 @@ void Sys_Run_Mode_10ms_Tasks_Group(void)
}
queren = 0;
}
else
{
......@@ -330,6 +361,7 @@ uint32_t ONOFFtime;
uint8_t compareresult;
uint8_t flashtime = 0;
uint8_t showtime = 0;
uint8_t bleuarttime = 0;
void Sys_Run_Mode_100ms_Tasks_Group(void)
{
static uint32_t loc_timer = 0;
......@@ -341,7 +373,7 @@ void Sys_Run_Mode_100ms_Tasks_Group(void)
Recv_Byte1();
}
Display_PageNum();
// Freln_Duty_HZ_Service();
......@@ -378,7 +410,7 @@ void Sys_Run_Mode_100ms_Tasks_Group(void)
}
if(Auto_ONOFF == 1)
{
if(ONOFFtime <=200)
if(ONOFFtime <=160)
{
ONOFFtime++;
}
......
......@@ -9,6 +9,7 @@ extern uint32_t send0x42time;
extern uint32_t bleOFFtoONtime;
extern uint8_t startONfalg;
extern uint32_t startIGONtime;
extern uint8_t Openble[11];
void Sys_Run_Mode_Pseudo_Real_Time_Tasks(void);
void Sys_Run_Mode_2ms_Tasks_Group(void);
void Sys_Run_Mode_5ms_Tasks_Group(void);
......
......@@ -117,9 +117,12 @@ void Sys_Startup_Init(void)
LINE_OUT_NEG_02 = 1;
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);
firstpowerflag = 2;
Display_TFT_Clear();
GUI_Display_Version_Code_Service(25, 20, "Please Scan The Code ", Letter_Num_11, PCodeText_Space_size);
/*上电扫码校验功能如果需要扫码校验注释掉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