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

feat:16843最终版(可能是)

parent 437e8804
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#include "api_RS485.h" #include "api_RS485.h"
#include "string.h" #include "string.h"
#include "init.h" #include "init.h"
#include "Display_Info.h"
#include "R485_Communication_Matrix.h" #include "R485_Communication_Matrix.h"
#define UART_RX_MAX_DEPTH (1024) // 4K #define UART_RX_MAX_DEPTH (1024) // 4K
...@@ -45,7 +46,7 @@ uint8_t line_stdio = 2; ...@@ -45,7 +46,7 @@ uint8_t line_stdio = 2;
uint8_t powerstdio = 0; uint8_t powerstdio = 0;
uint8_t get_num_buf[34]; uint8_t get_num_buf[34];
uint8_t comparestart; uint8_t comparestart;
uint8_t blename[4]; uint8_t blename[5];
void get_key(void) void get_key(void)
{ {
key_array[0] = seed_value[0] | seed_value[3]; key_array[0] = seed_value[0] | seed_value[3];
...@@ -112,13 +113,19 @@ void datacheck(void) ...@@ -112,13 +113,19 @@ void datacheck(void)
checknumwrong = 1; checknumwrong = 1;
} }
break; break;
case 0x4D:
memcpy(R485_ID4Dh.Msg,RS485_data,64);
break;
case 0x81: case 0x81:
{ {
blename[0] = RS485_data[6]; blename[0] = RS485_data[6];
blename[1] = RS485_data[7]; blename[1] = RS485_data[7];
blename[2] = RS485_data[8]; blename[2] = RS485_data[8];
blename[3] = RS485_data[9]; blename[3] = RS485_data[9];
blename[4] = 0xff;
recvflag111 = 1; recvflag111 = 1;
RS485_TX_finish = 0;
// General_Number_Disp(blename, 3, 165);
} }
break; break;
case 0x4F: case 0x4F:
...@@ -252,10 +259,15 @@ void datacheck(void) ...@@ -252,10 +259,15 @@ void datacheck(void)
zhenduansendStep++; zhenduansendStep++;
RS485_TX_finish = 0; RS485_TX_finish = 0;
} }
else else if(BarCode[4] != 0x67)
{ {
zhenduansendStep = 0;
RS485_TX_finish = 0; RS485_TX_finish = 0;
} }
else
{
;
}
} }
break; break;
case 3: case 3:
...@@ -266,16 +278,20 @@ void datacheck(void) ...@@ -266,16 +278,20 @@ void datacheck(void)
zhenduansendStep++; zhenduansendStep++;
RS485_TX_finish = 0; RS485_TX_finish = 0;
} }
if(BarCode[4] == 0x7F) if(BarCode[4] == 0x7F && BarCode[5] == 0x2E && BarCode[6] == 0x78 )
{ {
// wait_write_flag = 1;
RS485_TX_finish = 1; RS485_TX_finish = 1;
// zhenduansendStep = 0;
// ;
}
if(BarCode[4] == 0x7F && BarCode[5] == 0x2E && BarCode[6] == 0x31 )
{
RS485_TX_finish = 0;
} }
} }
else else
{ {
RS485_TX_finish = 0; // RS485_TX_finish = 0;
} }
break; break;
default: default:
...@@ -285,7 +301,7 @@ void datacheck(void) ...@@ -285,7 +301,7 @@ void datacheck(void)
} }
else else
{ {
RS485_TX_finish = 0x0; // RS485_TX_finish = 0x0;
} }
} }
} }
...@@ -326,6 +342,7 @@ void BarCodeDataGet(void) ...@@ -326,6 +342,7 @@ void BarCodeDataGet(void)
else else
{ {
memcpy(barcode_Msg1,&mDataBufPtr1[6],34); memcpy(barcode_Msg1,&mDataBufPtr1[6],34);
memset(barcode_Msg,0,34);
} }
} }
uint8_t GetDataCompare(void) uint8_t GetDataCompare(void)
...@@ -370,6 +387,7 @@ void UART_Put(uint32_t Value) ...@@ -370,6 +387,7 @@ void UART_Put(uint32_t Value)
// LINE_OUT_NEG_09 = 1; // LINE_OUT_NEG_09 = 1;
// RS485_TX_finish = 0; // RS485_TX_finish = 0;
// RS485_send_time = 0; // RS485_send_time = 0;
RS485_send_time = 0;
return; return;
} }
void UART_Put1(uint32_t Value) void UART_Put1(uint32_t Value)
...@@ -493,10 +511,10 @@ void Recv_Byte1(void) ...@@ -493,10 +511,10 @@ void Recv_Byte1(void)
int j = 0; int j = 0;
uint32_t len; uint32_t len;
readNum1 = Protocol_UartRead1(mDataBufPtr1 + mDataBufLen1, 1024 - mDataBufLen1); readNum1 = Protocol_UartRead1(mDataBufPtr1 + mDataBufLen1, 1024 - mDataBufLen1);
if (readNum1 > 0) // if (readNum1 > 0)
{ // {
BarCodeDataGet(); // BarCodeDataGet();
} // }
if (readNum1 > 0) if (readNum1 > 0)
{ {
mDataBufLen1 += readNum1; mDataBufLen1 += readNum1;
......
...@@ -31,6 +31,6 @@ extern uint8_t Auto_ONOFF; ...@@ -31,6 +31,6 @@ extern uint8_t Auto_ONOFF;
extern uint8_t comparestart; extern uint8_t comparestart;
extern uint8_t connectbleFlag; extern uint8_t connectbleFlag;
extern uint8_t get_num_buf[34]; extern uint8_t get_num_buf[34];
extern uint8_t blename[4]; extern uint8_t blename[5];
extern uint8_t recvflag111; extern uint8_t recvflag111;
#endif #endif
\ No newline at end of file
...@@ -535,6 +535,7 @@ void Read_IPK_Session_Type(void)//请求仪表发送 软硬件版本号 等数 ...@@ -535,6 +535,7 @@ void Read_IPK_Session_Type(void)//请求仪表发送 软硬件版本号 等数
} }
} }
uint8_t LED_Waring = 0; uint8_t LED_Waring = 0;
uint8_t ABStime = 0;
void Function_Check_Ctrl(uint32_t cmd) void Function_Check_Ctrl(uint32_t cmd)
{ {
uint8_t p [ 20 ]; uint8_t p [ 20 ];
...@@ -588,7 +589,7 @@ void Function_Check_Ctrl(uint32_t cmd) ...@@ -588,7 +589,7 @@ void Function_Check_Ctrl(uint32_t cmd)
LED3 = 0; //右转 LED3 = 0; //右转
LED4 = 0; LED4 = 0;
LINE_OUT_NEG_05 = 0; LINE_OUT_NEG_05 = 0;
LINE_OUT_NEG_06 = 0; LINE_OUT_NEG_06 = 1;
LINE_jinguang = 0; LINE_jinguang = 0;
POWER_CTRL_KL30_Current = 0; POWER_CTRL_KL30_Current = 0;
if(Auto_ONOFF == 0) if(Auto_ONOFF == 0)
...@@ -599,6 +600,7 @@ void Function_Check_Ctrl(uint32_t cmd) ...@@ -599,6 +600,7 @@ void Function_Check_Ctrl(uint32_t cmd)
LINE_OUT_NEG_02 = 1; LINE_OUT_NEG_02 = 1;
LINE_OUT_NEG_03 = 1; LINE_OUT_NEG_03 = 1;
LINE_OUT_NEG_04 = 1; LINE_OUT_NEG_04 = 1;
POWER_CTRL_KL30 = 0;
break; break;
} }
...@@ -609,7 +611,8 @@ void Function_Check_Ctrl(uint32_t cmd) ...@@ -609,7 +611,8 @@ void Function_Check_Ctrl(uint32_t cmd)
LINE_OUT_NEG_05 = 1; LINE_OUT_NEG_05 = 1;
LINE_OUT_NEG_06 = 0; LINE_OUT_NEG_06 = 0;
POWER_CTRL_KL30_Current = 0; POWER_CTRL_KL30_Current = 0;
LINE_jinguang = 1; LINE_jinguang = 1;
POWER_CTRL_KL30 = 0;
break; break;
} }
case 2: case 2:
...@@ -630,11 +633,12 @@ void Function_Check_Ctrl(uint32_t cmd) ...@@ -630,11 +633,12 @@ void Function_Check_Ctrl(uint32_t cmd)
case 3: case 3:
{ {
LED3 = 1; LED3 = 1;
LINE_OUT_NEG_06 = 1; LINE_OUT_NEG_06 = 0;
LINE_OUT_NEG_05 = 1; LINE_OUT_NEG_05 = 1;
LINE_jinguang = 0; LINE_jinguang = 0;
POWER_CTRL_KL30_Current = 0; POWER_CTRL_KL30_Current = 0;
LED4 = 0; LED4 = 0;
POWER_CTRL_KL30 = 0;
break; break;
} }
case 4: case 4:
...@@ -644,7 +648,8 @@ void Function_Check_Ctrl(uint32_t cmd) ...@@ -644,7 +648,8 @@ void Function_Check_Ctrl(uint32_t cmd)
LINE_OUT_NEG_05 = 1; LINE_OUT_NEG_05 = 1;
LINE_jinguang = 0; LINE_jinguang = 0;
POWER_CTRL_KL30_Current = 0; POWER_CTRL_KL30_Current = 0;
LED4 = 0; LED4 = 0;
POWER_CTRL_KL30 = 0;
break; break;
} }
...@@ -655,7 +660,10 @@ void Function_Check_Ctrl(uint32_t cmd) ...@@ -655,7 +660,10 @@ void Function_Check_Ctrl(uint32_t cmd)
LINE_OUT_NEG_05 = 1; LINE_OUT_NEG_05 = 1;
LINE_jinguang = 0; LINE_jinguang = 0;
POWER_CTRL_KL30_Current = 0; POWER_CTRL_KL30_Current = 0;
LED4 = 0; LED4 = 0;
POWER_CTRL_KL30 = 0;
queren = 0 ;
// ABStime = 0;
break; break;
} }
case 6: case 6:
...@@ -665,17 +673,31 @@ void Function_Check_Ctrl(uint32_t cmd) ...@@ -665,17 +673,31 @@ void Function_Check_Ctrl(uint32_t cmd)
LINE_OUT_NEG_05 = 1; LINE_OUT_NEG_05 = 1;
LINE_jinguang = 0; LINE_jinguang = 0;
POWER_CTRL_KL30_Current = 0; POWER_CTRL_KL30_Current = 0;
LED4 = 0; LED4 = 0;
POWER_CTRL_KL30 = 0;
if(ABStime < 30)
{
ABStime++;
}
else
{
queren = 1;
ABStime = 0;
}
break; break;
} }
case 7: case 7:
{ {
LED3 = 0; LED3 = 0;
LINE_OUT_NEG_06 = 0; LINE_OUT_NEG_06 = 0;
LINE_OUT_NEG_05 = 0; LINE_OUT_NEG_05 = 0;
LINE_jinguang = 0; LINE_jinguang = 0;
POWER_CTRL_KL30_Current = 0; POWER_CTRL_KL30_Current = 0;
LED4 = 0; LED4 = 0;
POWER_CTRL_KL30 = 0;
queren = 0;
// ABStime = 0;
break; break;
} }
case 8: case 8:
...@@ -685,7 +707,8 @@ void Function_Check_Ctrl(uint32_t cmd) ...@@ -685,7 +707,8 @@ void Function_Check_Ctrl(uint32_t cmd)
LINE_OUT_NEG_05 = 1; LINE_OUT_NEG_05 = 1;
LINE_jinguang = 0; LINE_jinguang = 0;
LED4 = 0; LED4 = 0;
POWER_CTRL_KL30_Current = 1; POWER_CTRL_KL30_Current = 1;
POWER_CTRL_KL30 = 0;
break; break;
} }
case 9: case 9:
...@@ -696,6 +719,7 @@ void Function_Check_Ctrl(uint32_t cmd) ...@@ -696,6 +719,7 @@ void Function_Check_Ctrl(uint32_t cmd)
LINE_jinguang = 0; LINE_jinguang = 0;
LED4 = 0; LED4 = 0;
POWER_CTRL_KL30_Current = 0; POWER_CTRL_KL30_Current = 0;
POWER_CTRL_KL30 = 0;
break; break;
} }
case 10: case 10:
...@@ -705,7 +729,8 @@ void Function_Check_Ctrl(uint32_t cmd) ...@@ -705,7 +729,8 @@ void Function_Check_Ctrl(uint32_t cmd)
LINE_OUT_NEG_05 = 0; LINE_OUT_NEG_05 = 0;
LINE_OUT_NEG_06 = 1; LINE_OUT_NEG_06 = 1;
LINE_jinguang = 1; LINE_jinguang = 1;
POWER_CTRL_KL30_Current = 1; POWER_CTRL_KL30_Current = 1;
POWER_CTRL_KL30 = 1;
break; break;
} }
case 11: case 11:
...@@ -722,6 +747,7 @@ void Function_Check_Ctrl(uint32_t cmd) ...@@ -722,6 +747,7 @@ void Function_Check_Ctrl(uint32_t cmd)
LINE_OUT_NEG_05 = 0; LINE_OUT_NEG_05 = 0;
LINE_OUT_NEG_06 = 1; LINE_OUT_NEG_06 = 1;
LINE_jinguang = 1; LINE_jinguang = 1;
POWER_CTRL_KL30 = 1;
POWER_CTRL_KL30_Current = 1; POWER_CTRL_KL30_Current = 1;
break; break;
} }
......
...@@ -2884,20 +2884,24 @@ uint32_t Get_Display_Type(void) ...@@ -2884,20 +2884,24 @@ uint32_t Get_Display_Type(void)
{ {
return 3; return 3;
} }
if(zhenduanflag == 0)
{
return 2;
}
else if(zhenduanflag == 1)
{
return 0;
}
else else
{ {
return 1; if(zhenduanflag == 0)
{
return 2;
}
else if(zhenduanflag == 1)
{
return 0;
}
else
{
return 1;
}
} }
} }
...@@ -3576,6 +3580,9 @@ void Check_PWM(void) ...@@ -3576,6 +3580,9 @@ void Check_PWM(void)
} }
uint32_t leftvoltage; uint32_t leftvoltage;
uint32_t rightvoltage; uint32_t rightvoltage;
const uint16_t banebenhao1[] = {35,25};
const uint16_t banebenhao2[] = {190,180};
const uint16_t banebenhao3[] = {105,95};
void Display_Version_Info(uint32_t ON_OFF) void Display_Version_Info(uint32_t ON_OFF)
{ {
uint8_t pbuff [ 40 ]; uint8_t pbuff [ 40 ];
...@@ -3609,15 +3616,26 @@ void Display_Version_Info(uint32_t ON_OFF) ...@@ -3609,15 +3616,26 @@ void Display_Version_Info(uint32_t ON_OFF)
TFT_LCD_Draw_Bmp(3, 25, ( uint8_t * )gImage_Dyy_words_1X6_Y16 ); //软件版本号 TFT_LCD_Draw_Bmp(3, 25, ( uint8_t * )gImage_Dyy_words_1X6_Y16 ); //软件版本号
// uint8_t mbuffruanjian[2] = {R485_ID48h.Sig.MCUMainSoftwareVer,0xff}; // uint8_t mbuffruanjian[2] = {R485_ID48h.Sig.MCUMainSoftwareVer,0xff};
uint8_t banbenhao = R485_ID48h.Sig.MCUMainSoftwareVer; uint8_t banbenhao = R485_ID48h.Sig.MCUMainSoftwareVer;
uint8_t mbuffruanjian[4] = {R485_ID48h.Sig.MCUMainSoftwareVer,0x2E,R485_ID48h.Sig.MCUSecSoftwareVer,0xff}; uint8_t esp32banben[3] = {R485_ID4Dh.Sig.ESP322,0x2E,0xff};
General_Number_Disp(mbuffruanjian, 160, 25); uint8_t esp32houmian = R485_ID4Dh.Sig.ESP321;
// uint8_t esp32houmian = 0xA;
General_Number_Disp(esp32banben, 5, 50);
GUI_General_Digit_Display(esp32houmian, Num_15, 2, 0, banebenhao1, 50);
uint8_t mbuffruanjian[3] = {R485_ID48h.Sig.MCUMainSoftwareVer,0x2E,0xff};
uint8_t wifihoumian = R485_ID48h.Sig.MCUSecSoftwareVer;
GUI_General_Digit_Display(wifihoumian, Num_15, 2, 0, banebenhao2, 50);
General_Number_Disp(mbuffruanjian, 160, 50);
uint8_t guominbanben[3] = {R485_ID4Dh.Sig.G0312,0x2E,0xff};
uint8_t guominhoumian = R485_ID4Dh.Sig.G0311;
GUI_General_Digit_Display(guominhoumian, Num_15, 2, 0, banebenhao3, 50);
General_Number_Disp(guominbanben, 75, 50);
// uint8_t mbuffyingjian[3] = {R485_ID48h.Sig.HardwareVer & 0xF0,R485_ID48h.Sig.HardwareVer & 0x0F ,0xff}; // uint8_t mbuffyingjian[3] = {R485_ID48h.Sig.HardwareVer & 0xF0,R485_ID48h.Sig.HardwareVer & 0x0F ,0xff};
// uint8_t numtesy = 0x55; // uint8_t numtesy = 0x55;
// uint8_t mbuffyingjian[2] = {numtesy,0xff}; // uint8_t mbuffyingjian[2] = {numtesy,0xff};
// General_Number_Disp___No_Wrap(mbuffyingjian, 160, 65); // General_Number_Disp___No_Wrap(mbuffyingjian, 160, 65);
const uint16_t Currenttest[] = {180,170}; const uint16_t Currenttest[] = {180,170};
GUI_General_Digit_Display(R485_ID48h.Sig.HardwareVer, Num_15, 2, 0, Currenttest, 50); GUI_General_Digit_Display(R485_ID48h.Sig.HardwareVer, Num_15, 2, 0, Currenttest, 50+30);
uint8_t wuliao[16]; uint8_t wuliao[16];
// for(int i =0;i < 16; i++) // for(int i =0;i < 16; i++)
// { // {
...@@ -3639,50 +3657,50 @@ void Display_Version_Info(uint32_t ON_OFF) ...@@ -3639,50 +3657,50 @@ void Display_Version_Info(uint32_t ON_OFF)
wuliao[13] = 0x30; wuliao[13] = 0x30;
wuliao[14] = 0x30; wuliao[14] = 0x30;
wuliao[15] = 0xFF; wuliao[15] = 0xFF;
General_Number_Disp(wuliao, 3, 90); General_Number_Disp(wuliao, 3, 90+30);
TFT_LCD_Draw_Bmp(3, 50, ( uint8_t * )gImage_Dyy_words_2X6_Y46 ); //硬件版本号 TFT_LCD_Draw_Bmp(3, 50+30, ( uint8_t * )gImage_Dyy_words_2X6_Y46 ); //硬件版本号
TFT_LCD_Draw_Bmp(0, 70, ( uint8_t * )gImage_Dyy_words_3X6_Y75 ); //零件号 TFT_LCD_Draw_Bmp(0, 70+30, ( uint8_t * )gImage_Dyy_words_3X6_Y75 ); //零件号
TFT_LCD_Draw_Bmp(3, 90+30, ( uint8_t * )gImage_gImage_dianyuanwaifX6_Y165 ); //仪表电电源检测外发对比检验 TFT_LCD_Draw_Bmp(3, 90+30+30, ( uint8_t * )gImage_gImage_dianyuanwaifX6_Y165 ); //仪表电电源检测外发对比检验
if(powerstdio == 1) if(powerstdio == 1)
{ {
TFT_LCD_Draw_Bmp(200, 90+40, ( uint8_t * )gImage_cuo ); //仪表电电源检测外发对比检验 错 TFT_LCD_Draw_Bmp(200, 90+40+30, ( uint8_t * )gImage_cuo ); //仪表电电源检测外发对比检验 错
} }
else else
{ {
TFT_LCD_Draw_Bmp(200, 90+40, ( uint8_t * )gImage_dui ); //仪表电电源检测外发对比检验 对 TFT_LCD_Draw_Bmp(200, 90+40+30, ( uint8_t * )gImage_dui ); //仪表电电源检测外发对比检验 对
} }
TFT_LCD_Draw_Bmp(3, 90+25+25+35, ( uint8_t * )gImage_gImage_yibiaowaif1X6_Y16 ); //仪表外发对比检验 TFT_LCD_Draw_Bmp(3, 90+25+25+35+30, ( uint8_t * )gImage_gImage_yibiaowaif1X6_Y16 ); //仪表外发对比检验
if(checknumwrong == 1) if(checknumwrong == 1)
{ {
TFT_LCD_Draw_Bmp(200, 90+25+25+35, ( uint8_t * )gImage_cuo ); //仪表外发对比检验 错 TFT_LCD_Draw_Bmp(200, 90+25+25+35+30, ( uint8_t * )gImage_cuo ); //仪表外发对比检验 错
} }
else if(checknumwrong == 0) else if(checknumwrong == 0)
{ {
TFT_LCD_Draw_Bmp(200, 90+25+25+35, ( uint8_t * )gImage_dui ); //仪表外发对比检验 对 TFT_LCD_Draw_Bmp(200, 90+25+25+35+30, ( uint8_t * )gImage_dui ); //仪表外发对比检验 对
} }
else else
{ {
TFT_LCD_Draw_Bmp(200, 90+25+25+35, ( uint8_t * )gImage_dui ); //仪表外发对比检验 对 TFT_LCD_Draw_Bmp(200, 90+25+25+35+30, ( uint8_t * )gImage_dui ); //仪表外发对比检验 对
} }
if(line_stdio == 0) if(line_stdio == 0)
{ {
TFT_LCD_Draw_Bmp(200, 90+25+25+30+30, ( uint8_t * )gImage_cuo ); //硬线指示灯外发对比 错 TFT_LCD_Draw_Bmp(200, 90+25+25+30+30+30, ( uint8_t * )gImage_cuo ); //硬线指示灯外发对比 错
} }
else if(line_stdio == 1) else if(line_stdio == 1)
{ {
TFT_LCD_Draw_Bmp(200, 90+25+25+30+30, ( uint8_t * )gImage_dui ); //硬线指示灯外发对比 对 TFT_LCD_Draw_Bmp(200, 90+25+25+30+30+30, ( uint8_t * )gImage_dui ); //硬线指示灯外发对比 对
} }
else else
{ {
TFT_LCD_Draw_Bmp(200, 90+25+25+30+30, ( uint8_t * )gImage_dui ); //硬线指示灯外发对比 对 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, ( uint8_t * )gImage_gImage_LEDwaif1X6_Y16 ); //硬线指示灯外发对比 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, ( uint8_t * )gImage_gImage_SV1X6_Y16 ); //软件版本号对比 TFT_LCD_Draw_Bmp(3, 90+25+25+30+25+30+30, ( uint8_t * )gImage_gImage_SV1X6_Y16 ); //软件版本号对比
TFT_LCD_Draw_Bmp(200, 90+25+25+30+25+30, ( uint8_t * )gImage_dui ); //软件版本号对比 对 TFT_LCD_Draw_Bmp(200, 90+25+25+30+25+30+30, ( uint8_t * )gImage_dui ); //软件版本号对比 对
// TFT_LCD_Draw_Bmp(200, 90+25+25+30+25+25, ( uint8_t * )gImage_cuo ); //软件版本号对比 错 // TFT_LCD_Draw_Bmp(200, 90+25+25+30+25+25, ( uint8_t * )gImage_cuo ); //软件版本号对比 错
// TFT_LCD_Draw_Bmp(3, 90+25+25+25+25+25, ( uint8_t * )gImage_gImage_SV1X6_Y16 ); //支持扫码功能个 // TFT_LCD_Draw_Bmp(3, 90+25+25+25+25+25, ( uint8_t * )gImage_gImage_SV1X6_Y16 ); //支持扫码功能个
// TFT_LCD_Draw_Bmp(3, 130, ( uint8_t * )gImage_Dyy_words_4X6_Y107); //供应商编码 // TFT_LCD_Draw_Bmp(3, 130, ( uint8_t * )gImage_Dyy_words_4X6_Y107); //供应商编码
TFT_LCD_Draw_Bmp(0, 90+25+25+30+25+25+30, ( uint8_t * )gImage_Dyy_words_6X6_Y165); //10V电压输出 // TFT_LCD_Draw_Bmp(0, 90+25+25+30+25+25+30, ( uint8_t * )gImage_Dyy_words_6X6_Y165); //10V电压输出
// leftvoltage = ADC_Read_Signal(ADC_CH_left_VOLTAGE); // leftvoltage = ADC_Read_Signal(ADC_CH_left_VOLTAGE);
// rightvoltage = ADC_Read_Signal(ADC_CH_right_VOLTAGE); // rightvoltage = ADC_Read_Signal(ADC_CH_right_VOLTAGE);
...@@ -3696,7 +3714,7 @@ void Display_Version_Info(uint32_t ON_OFF) ...@@ -3696,7 +3714,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 [4] = {1,0,0,0xff}; uint8_t mbuff [4] = {1,0,1,0xff};
General_Number_Disp(mbuff, 160, 290); General_Number_Disp(mbuff, 160, 290);
...@@ -4249,7 +4267,7 @@ void Display_Send_Vspead(uint8_t menu) ...@@ -4249,7 +4267,7 @@ void Display_Send_Vspead(uint8_t menu)
TFT_LCD_Draw_Bmp(180, 40+25+25+25, ( uint8_t * )NO_K); TFT_LCD_Draw_Bmp(180, 40+25+25+25, ( uint8_t * )NO_K);
TFT_LCD_Draw_Bmp(180+18, 40+25+25+25, ( uint8_t * )NO_W); TFT_LCD_Draw_Bmp(180+18, 40+25+25+25, ( uint8_t * )NO_W);
GUI_General_Digit_Display(10, Num_15, 6, 5, ODODigitNum09PosX, 40+25+25+25+5); GUI_General_Digit_Display(0, Num_15, 6, 5, ODODigitNum09PosX, 40+25+25+25+5);
// GUI_Display_Version_Code_Service(3, 40+25+25+25, "Power", Letter_Num_11, PCodeText_Space_size); // GUI_Display_Version_Code_Service(3, 40+25+25+25, "Power", Letter_Num_11, PCodeText_Space_size);
// GUI_Display_Version_Code_Service(160, 40+25+25+25, "10kW", Letter_Num_11, PCodeText_Space_size); // GUI_Display_Version_Code_Service(160, 40+25+25+25, "10kW", Letter_Num_11, PCodeText_Space_size);
...@@ -4308,7 +4326,7 @@ void Display_Send_Vspead(uint8_t menu) ...@@ -4308,7 +4326,7 @@ void Display_Send_Vspead(uint8_t menu)
TFT_LCD_Draw_Bmp(20, 40+25+25+25+25+25+25+25, ( uint8_t * )gImage_gImage_turnRight1X6_Y16); TFT_LCD_Draw_Bmp(20, 40+25+25+25+25+25+25+25, ( uint8_t * )gImage_gImage_turnRight1X6_Y16);
TFT_LCD_Draw_Bmp(70, 40+25+25+25+25+25+25+25, ( uint8_t * )gImage_gImage_AutoX6_Y165); TFT_LCD_Draw_Bmp(70, 40+25+25+25+25+25+25+25, ( uint8_t * )gImage_gImage_AutoX6_Y165);
TFT_LCD_Draw_Bmp(150, 40+25+25+25+25+25+25+25, ( uint8_t * )gImage_gImage_position1X6_Y16); // TFT_LCD_Draw_Bmp(150, 40+25+25+25+25+25+25+25, ( uint8_t * )gImage_gImage_position1X6_Y16);
// GUI_Display_Version_Code_Service(160, 40, "22", Letter_Num_11, PCodeText_Space_size); // GUI_Display_Version_Code_Service(160, 40, "22", Letter_Num_11, PCodeText_Space_size);
// GUI_Display_Version_Code_Service(160, 40+25, "22", Letter_Num_11, PCodeText_Space_size); // GUI_Display_Version_Code_Service(160, 40+25, "22", Letter_Num_11, PCodeText_Space_size);
...@@ -4373,9 +4391,11 @@ void Display_Send_Vspead(uint8_t menu) ...@@ -4373,9 +4391,11 @@ void Display_Send_Vspead(uint8_t menu)
VSpeed_val = 44; VSpeed_val = 44;
// GUI_Display_Version_Code_Service(3, 40+25+25+25, "ePower", Letter_Num_11, PCodeText_Space_size); // GUI_Display_Version_Code_Service(3, 40+25+25+25, "ePower", Letter_Num_11, PCodeText_Space_size);
// GUI_Display_Version_Code_Service(160, 40+25+25+25, "1", Letter_Num_11, PCodeText_Space_size); // GUI_Display_Version_Code_Service(160, 40+25+25+25, "1", Letter_Num_11, PCodeText_Space_size);
TFT_LCD_Draw_Bmp(180, 40+25+25+25, ( uint8_t * )NO_G); // TFT_LCD_Draw_Bmp(180, 40+25+25+25, ( uint8_t * )NO_G);
GUI_General_Digit_Display(1, Num_15, 6, 5, ODODigitNum09PosX, 40+25+25+25+5); // TFT_LCD_Draw_Bmp(180, 40+25+25+25, ( uint8_t * )NO_K);
TFT_LCD_Draw_Bmp(180, 40+25+25+25, ( uint8_t * )NO_W);
TFT_LCD_Draw_Bmp(180+25, 40+25+25+25, ( uint8_t * )gImage_Dey_words_8X224_Y107);
GUI_Display_Version_Code_Service(155, 40+25+25+25, "-10", Letter_Num_11, PCodeText_Space_size);
// GUI_Display_Version_Code_Service(3, 40+25+25+25+25+25, "Time", Letter_Num_11, PCodeText_Space_size); // GUI_Display_Version_Code_Service(3, 40+25+25+25+25+25, "Time", Letter_Num_11, PCodeText_Space_size);
// GUI_Display_Version_Code_Service(160, 40+25+25+25+25+25, "14-44", Letter_Num_11, PCodeText_Space_size); // GUI_Display_Version_Code_Service(160, 40+25+25+25+25+25, "14-44", Letter_Num_11, PCodeText_Space_size);
TFT_LCD_Draw_Bmp(140, 40+25+25+25+25+25, ( uint8_t * )NO_1); TFT_LCD_Draw_Bmp(140, 40+25+25+25+25+25, ( uint8_t * )NO_1);
...@@ -4396,8 +4416,9 @@ void Display_Send_Vspead(uint8_t menu) ...@@ -4396,8 +4416,9 @@ void Display_Send_Vspead(uint8_t menu)
VSpeed_val = 55; VSpeed_val = 55;
// GUI_Display_Version_Code_Service(3, 40+25+25+25, "ePower", Letter_Num_11, PCodeText_Space_size); // GUI_Display_Version_Code_Service(3, 40+25+25+25, "ePower", Letter_Num_11, PCodeText_Space_size);
// GUI_Display_Version_Code_Service(160, 40+25+25+25, "5", Letter_Num_11, PCodeText_Space_size); // GUI_Display_Version_Code_Service(160, 40+25+25+25, "5", Letter_Num_11, PCodeText_Space_size);
TFT_LCD_Draw_Bmp(180, 40+25+25+25, ( uint8_t * )NO_G); TFT_LCD_Draw_Bmp(180, 40+25+25+25, ( uint8_t * )NO_W);
GUI_General_Digit_Display(5, Num_15, 6, 5, ODODigitNum09PosX, 40+25+25+25+5); TFT_LCD_Draw_Bmp(180+25, 40+25+25+25, ( uint8_t * )gImage_Dey_words_8X224_Y107);
GUI_Display_Version_Code_Service(155, 40+25+25+25, "-50", Letter_Num_11, PCodeText_Space_size);
// GUI_Display_Version_Code_Service(3, 40+25+25+25+25+25, "Time", Letter_Num_11, PCodeText_Space_size); // GUI_Display_Version_Code_Service(3, 40+25+25+25+25+25, "Time", Letter_Num_11, PCodeText_Space_size);
// GUI_Display_Version_Code_Service(160, 40+25+25+25+25+25, "15-55", Letter_Num_11, PCodeText_Space_size); // GUI_Display_Version_Code_Service(160, 40+25+25+25+25+25, "15-55", Letter_Num_11, PCodeText_Space_size);
...@@ -4419,8 +4440,9 @@ void Display_Send_Vspead(uint8_t menu) ...@@ -4419,8 +4440,9 @@ void Display_Send_Vspead(uint8_t menu)
VSpeed_val = 66; VSpeed_val = 66;
// GUI_Display_Version_Code_Service(3, 40+25+25+25, "ePower", Letter_Num_11, PCodeText_Space_size); // GUI_Display_Version_Code_Service(3, 40+25+25+25, "ePower", Letter_Num_11, PCodeText_Space_size);
// GUI_Display_Version_Code_Service(160, 40+25+25+25, "10", Letter_Num_11, PCodeText_Space_size); // GUI_Display_Version_Code_Service(160, 40+25+25+25, "10", Letter_Num_11, PCodeText_Space_size);
TFT_LCD_Draw_Bmp(180, 40+25+25+25, ( uint8_t * )NO_G); TFT_LCD_Draw_Bmp(180, 40+25+25+25, ( uint8_t * )NO_W);
GUI_General_Digit_Display(10, Num_15, 6, 5, ODODigitNum09PosX, 40+25+25+25+5); TFT_LCD_Draw_Bmp(180+25, 40+25+25+25, ( uint8_t * )gImage_Dey_words_8X224_Y107);
GUI_Display_Version_Code_Service(145, 40+25+25+25, "-100", Letter_Num_11, PCodeText_Space_size);
// GUI_Display_Version_Code_Service(3, 40+25+25+25+25+25, "Time", Letter_Num_11, PCodeText_Space_size); // GUI_Display_Version_Code_Service(3, 40+25+25+25+25+25, "Time", Letter_Num_11, PCodeText_Space_size);
// GUI_Display_Version_Code_Service(160, 40+25+25+25+25+25, "16-06", Letter_Num_11, PCodeText_Space_size); // GUI_Display_Version_Code_Service(160, 40+25+25+25+25+25, "16-06", Letter_Num_11, PCodeText_Space_size);
......
...@@ -336,7 +336,7 @@ void Key_Operation_SW10(Key_Event_en_t enKeyEvent) ...@@ -336,7 +336,7 @@ void Key_Operation_SW10(Key_Event_en_t enKeyEvent)
/*清零ODO*/ /*清零ODO*/
if ( enKeyEvent == KEY_EVENT_SHORT_PRESS ) if ( enKeyEvent == KEY_EVENT_SHORT_PRESS )
{ {
Display_TFT_Clear();
if(connectbleFlag == 0) if(connectbleFlag == 0)
{ {
connectbleFlag = 1; connectbleFlag = 1;
...@@ -345,6 +345,7 @@ void Key_Operation_SW10(Key_Event_en_t enKeyEvent) ...@@ -345,6 +345,7 @@ void Key_Operation_SW10(Key_Event_en_t enKeyEvent)
} }
else else
{ {
Display_TFT_Clear();
name1= (devicename) & 0xFF; name1= (devicename) & 0xFF;
name2 = (devicename >> 8) & 0xFF; name2 = (devicename >> 8) & 0xFF;
startONfalg = 0; startONfalg = 0;
...@@ -359,7 +360,7 @@ void Key_Operation_SW10(Key_Event_en_t enKeyEvent) ...@@ -359,7 +360,7 @@ void Key_Operation_SW10(Key_Event_en_t enKeyEvent)
} }
else if ( enKeyEvent == KEY_EVENT_SUPER_LONG_PRESS ) else if ( enKeyEvent == KEY_EVENT_SUPER_LONG_PRESS )
{ {
connectbleFlag = 0;
} }
else else
{ {
......
...@@ -65,7 +65,7 @@ uint32_t R485_Send_0x41(void) ...@@ -65,7 +65,7 @@ uint32_t R485_Send_0x41(void)
case 0: case 0:
R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x0; // 自动大灯 R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x0; // 自动大灯
R485_ID41h.Sig.ChargeState = 0x0; //充电状态 R485_ID41h.Sig.ChargeState = 0x0; //充电状态
R485_ID41h.Sig.SlopePattern = 0x1; //跛行 R485_ID41h.Sig.SlopePattern = 0x0; //跛行
R485_ID41h.Sig.CushionSensorStatus = 0x1; //坐垫压力 R485_ID41h.Sig.CushionSensorStatus = 0x1; //坐垫压力
R485_ID41h.Sig.SlopeDescentFunctionStatus = 0x0; //陡坡缓降 R485_ID41h.Sig.SlopeDescentFunctionStatus = 0x0; //陡坡缓降
R485_ID41h.Sig.TCSActivation = 0x1; //TCS激活 R485_ID41h.Sig.TCSActivation = 0x1; //TCS激活
...@@ -109,7 +109,7 @@ uint32_t R485_Send_0x41(void) ...@@ -109,7 +109,7 @@ uint32_t R485_Send_0x41(void)
case 1: case 1:
R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x0; // 自动大灯 R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x0; // 自动大灯
R485_ID41h.Sig.ChargeState = 0x0; //充电状态 R485_ID41h.Sig.ChargeState = 0x0; //充电状态
R485_ID41h.Sig.SlopePattern = 0x1; //跛行 R485_ID41h.Sig.SlopePattern = 0x0; //跛行
R485_ID41h.Sig.CushionSensorStatus = 0x1; //坐垫压力 R485_ID41h.Sig.CushionSensorStatus = 0x1; //坐垫压力
R485_ID41h.Sig.SlopeDescentFunctionStatus = 0x0; //陡坡缓降 R485_ID41h.Sig.SlopeDescentFunctionStatus = 0x0; //陡坡缓降
R485_ID41h.Sig.TCSActivation = 0x1; //TCS激活 R485_ID41h.Sig.TCSActivation = 0x1; //TCS激活
...@@ -124,7 +124,7 @@ uint32_t R485_Send_0x41(void) ...@@ -124,7 +124,7 @@ uint32_t R485_Send_0x41(void)
R485_ID41h.Sig.VehicleStatus = 0x3; //整车状态 R485_ID41h.Sig.VehicleStatus = 0x3; //整车状态
R485_ID41h.Sig.SpeedGear = 0x4; //挡位 R485_ID41h.Sig.SpeedGear = 0x4; //挡位
R485_ID41h.Sig.TotalBatteryVoltage = 0x4B; //总电池电压 R485_ID41h.Sig.TotalBatteryVoltage = 0x6D; //总电池电压
R485_ID41h.Sig.IOTRealTime_Hour = 0; //时间:时 R485_ID41h.Sig.IOTRealTime_Hour = 0; //时间:时
R485_ID41h.Sig.IOTRealTime_Minute = 0; //时间:分 R485_ID41h.Sig.IOTRealTime_Minute = 0; //时间:分
...@@ -155,7 +155,7 @@ uint32_t R485_Send_0x41(void) ...@@ -155,7 +155,7 @@ uint32_t R485_Send_0x41(void)
case 2: case 2:
R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x0; // 自动大灯 R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x0; // 自动大灯
R485_ID41h.Sig.ChargeState = 0x0; //充电状态 R485_ID41h.Sig.ChargeState = 0x0; //充电状态
R485_ID41h.Sig.SlopePattern = 0x1; //跛行 R485_ID41h.Sig.SlopePattern = 0x0; //跛行
R485_ID41h.Sig.CushionSensorStatus = 0x1; //坐垫压力 R485_ID41h.Sig.CushionSensorStatus = 0x1; //坐垫压力
R485_ID41h.Sig.SlopeDescentFunctionStatus = 0x0; //陡坡缓降 R485_ID41h.Sig.SlopeDescentFunctionStatus = 0x0; //陡坡缓降
R485_ID41h.Sig.TCSActivation = 0x1; //TCS激活 R485_ID41h.Sig.TCSActivation = 0x1; //TCS激活
...@@ -172,7 +172,7 @@ uint32_t R485_Send_0x41(void) ...@@ -172,7 +172,7 @@ uint32_t R485_Send_0x41(void)
R485_ID41h.Sig.VehicleStatus = 0x3; //整车状态 R485_ID41h.Sig.VehicleStatus = 0x3; //整车状态
R485_ID41h.Sig.SpeedGear = 0x3; //挡位 R485_ID41h.Sig.SpeedGear = 0x3; //挡位
R485_ID41h.Sig.TotalBatteryVoltage = 0x4B; //总电池电压 R485_ID41h.Sig.TotalBatteryVoltage = 0x5A; //总电池电压
R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x1; // 自动大灯 R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x1; // 自动大灯
R485_ID41h.Sig.IOTRealTime_Hour = 0xB; //时间:时 R485_ID41h.Sig.IOTRealTime_Hour = 0xB; //时间:时
...@@ -207,7 +207,7 @@ uint32_t R485_Send_0x41(void) ...@@ -207,7 +207,7 @@ uint32_t R485_Send_0x41(void)
{ {
R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x1; // 自动大灯 R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x1; // 自动大灯
R485_ID41h.Sig.ChargeState = 0x0; //充电状态 R485_ID41h.Sig.ChargeState = 0x0; //充电状态
R485_ID41h.Sig.SlopePattern = 0x1; //跛行 R485_ID41h.Sig.SlopePattern = 0x0; //跛行
R485_ID41h.Sig.CushionSensorStatus = 0x1; //坐垫压力 R485_ID41h.Sig.CushionSensorStatus = 0x1; //坐垫压力
R485_ID41h.Sig.SlopeDescentFunctionStatus = 0x0; //陡坡缓降 R485_ID41h.Sig.SlopeDescentFunctionStatus = 0x0; //陡坡缓降
R485_ID41h.Sig.TCSActivation = 0x1; //TCS激活 R485_ID41h.Sig.TCSActivation = 0x1; //TCS激活
...@@ -222,7 +222,7 @@ uint32_t R485_Send_0x41(void) ...@@ -222,7 +222,7 @@ uint32_t R485_Send_0x41(void)
R485_ID41h.Sig.VehicleStatus = 0x3; //整车状态 R485_ID41h.Sig.VehicleStatus = 0x3; //整车状态
R485_ID41h.Sig.SpeedGear = 0x1; //挡位 R485_ID41h.Sig.SpeedGear = 0x1; //挡位
R485_ID41h.Sig.TotalBatteryVoltage = 0x4B; //总电池电压 R485_ID41h.Sig.TotalBatteryVoltage = 0x5E; //总电池电压
R485_ID41h.Sig.IOTRealTime_Hour = 0x16; //时间:时 R485_ID41h.Sig.IOTRealTime_Hour = 0x16; //时间:时
R485_ID41h.Sig.IOTRealTime_Minute = 0x16; //时间:分 R485_ID41h.Sig.IOTRealTime_Minute = 0x16; //时间:分
...@@ -254,7 +254,7 @@ uint32_t R485_Send_0x41(void) ...@@ -254,7 +254,7 @@ uint32_t R485_Send_0x41(void)
{ {
R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x1; // 自动大灯 R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x1; // 自动大灯
R485_ID41h.Sig.ChargeState = 0x0; //充电状态 R485_ID41h.Sig.ChargeState = 0x0; //充电状态
R485_ID41h.Sig.SlopePattern = 0x1; //跛行 R485_ID41h.Sig.SlopePattern = 0x0; //跛行
R485_ID41h.Sig.CushionSensorStatus = 0x1; //坐垫压力 R485_ID41h.Sig.CushionSensorStatus = 0x1; //坐垫压力
R485_ID41h.Sig.SlopeDescentFunctionStatus = 0x0; //陡坡缓降 R485_ID41h.Sig.SlopeDescentFunctionStatus = 0x0; //陡坡缓降
R485_ID41h.Sig.TCSActivation = 0x1; //TCS激活 R485_ID41h.Sig.TCSActivation = 0x1; //TCS激活
...@@ -302,7 +302,7 @@ uint32_t R485_Send_0x41(void) ...@@ -302,7 +302,7 @@ uint32_t R485_Send_0x41(void)
case 4: case 4:
R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x0; // 自动大灯 R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x0; // 自动大灯
R485_ID41h.Sig.ChargeState = 0x0; //充电状态 R485_ID41h.Sig.ChargeState = 0x0; //充电状态
R485_ID41h.Sig.SlopePattern = 0x1; //跛行 R485_ID41h.Sig.SlopePattern = 0x0; //跛行
R485_ID41h.Sig.CushionSensorStatus = 0x1; //坐垫压力 R485_ID41h.Sig.CushionSensorStatus = 0x1; //坐垫压力
R485_ID41h.Sig.SlopeDescentFunctionStatus = 0x0; //陡坡缓降 R485_ID41h.Sig.SlopeDescentFunctionStatus = 0x0; //陡坡缓降
R485_ID41h.Sig.TCSActivation = 0x1; //TCS激活 R485_ID41h.Sig.TCSActivation = 0x1; //TCS激活
...@@ -352,7 +352,7 @@ uint32_t R485_Send_0x41(void) ...@@ -352,7 +352,7 @@ uint32_t R485_Send_0x41(void)
case 5: case 5:
R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x0; // 自动大灯 R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x0; // 自动大灯
R485_ID41h.Sig.ChargeState = 0x0; //充电状态 R485_ID41h.Sig.ChargeState = 0x0; //充电状态
R485_ID41h.Sig.SlopePattern = 0x1; //跛行 R485_ID41h.Sig.SlopePattern = 0x0; //跛行
R485_ID41h.Sig.CushionSensorStatus = 0x1; //坐垫压力 R485_ID41h.Sig.CushionSensorStatus = 0x1; //坐垫压力
R485_ID41h.Sig.SlopeDescentFunctionStatus = 0x0; //陡坡缓降 R485_ID41h.Sig.SlopeDescentFunctionStatus = 0x0; //陡坡缓降
R485_ID41h.Sig.TCSActivation = 0x0; //TCS激活 R485_ID41h.Sig.TCSActivation = 0x0; //TCS激活
...@@ -362,7 +362,7 @@ uint32_t R485_Send_0x41(void) ...@@ -362,7 +362,7 @@ uint32_t R485_Send_0x41(void)
R485_ID41h.Sig.CruiseMode = 0x0; //巡航 R485_ID41h.Sig.CruiseMode = 0x0; //巡航
R485_ID41h.Sig.RecuperationStatusFeedback = 0x1; //能量回收设置 R485_ID41h.Sig.RecuperationStatusFeedback = 0x1; //能量回收设置
R485_ID41h.Sig.TotalBatteryVoltage = 0xC8; //总电池电压 R485_ID41h.Sig.TotalBatteryVoltage = 0x2A; //总电池电压
R485_ID41h.Sig.ICMCalculatesVehicleSpeed = 0x140; //速度 = (X * 0.512 * 3.14 * 1.05) / 30 44km R485_ID41h.Sig.ICMCalculatesVehicleSpeed = 0x140; //速度 = (X * 0.512 * 3.14 * 1.05) / 30 44km
R485_ID41h.Sig.TotalBatterySOC = 0x58; //电量 R485_ID41h.Sig.TotalBatterySOC = 0x58; //电量
...@@ -402,7 +402,7 @@ uint32_t R485_Send_0x41(void) ...@@ -402,7 +402,7 @@ uint32_t R485_Send_0x41(void)
case 6: case 6:
R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x0; // 自动大灯 R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x0; // 自动大灯
R485_ID41h.Sig.ChargeState = 0x0; //充电状态 R485_ID41h.Sig.ChargeState = 0x0; //充电状态
R485_ID41h.Sig.SlopePattern = 0x1; //跛行 R485_ID41h.Sig.SlopePattern = 0x0; //跛行
R485_ID41h.Sig.CushionSensorStatus = 0x1; //坐垫压力 R485_ID41h.Sig.CushionSensorStatus = 0x1; //坐垫压力
R485_ID41h.Sig.SlopeDescentFunctionStatus = 0x0; //陡坡缓降 R485_ID41h.Sig.SlopeDescentFunctionStatus = 0x0; //陡坡缓降
R485_ID41h.Sig.TCSActivation = 0x1; //TCS激活 R485_ID41h.Sig.TCSActivation = 0x1; //TCS激活
...@@ -452,7 +452,7 @@ uint32_t R485_Send_0x41(void) ...@@ -452,7 +452,7 @@ uint32_t R485_Send_0x41(void)
case 7: case 7:
R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x0; // 自动大灯 R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x0; // 自动大灯
R485_ID41h.Sig.ChargeState = 0x0; //充电状态 R485_ID41h.Sig.ChargeState = 0x0; //充电状态
R485_ID41h.Sig.SlopePattern = 0x0; //跛行 R485_ID41h.Sig.SlopePattern = 0x1; //跛行
R485_ID41h.Sig.CushionSensorStatus = 0x1; //坐垫压力 R485_ID41h.Sig.CushionSensorStatus = 0x1; //坐垫压力
R485_ID41h.Sig.SlopeDescentFunctionStatus = 0x0; //陡坡缓降 R485_ID41h.Sig.SlopeDescentFunctionStatus = 0x0; //陡坡缓降
R485_ID41h.Sig.TCSActivation = 0x1; //TCS激活 R485_ID41h.Sig.TCSActivation = 0x1; //TCS激活
...@@ -462,7 +462,7 @@ uint32_t R485_Send_0x41(void) ...@@ -462,7 +462,7 @@ uint32_t R485_Send_0x41(void)
R485_ID41h.Sig.CruiseMode = 0x0; //巡航 R485_ID41h.Sig.CruiseMode = 0x0; //巡航
R485_ID41h.Sig.RecuperationStatusFeedback = 0x1; //能量回收设置 R485_ID41h.Sig.RecuperationStatusFeedback = 0x1; //能量回收设置
R485_ID41h.Sig.TotalBatteryVoltage = 0xC8; //总电池电压 R485_ID41h.Sig.TotalBatteryVoltage = 0xFF; //总电池电压
R485_ID41h.Sig.ICMCalculatesVehicleSpeed = 0x1E0; //速度 = (X * 0.512 * 3.14 * 1.05) / 30 66km R485_ID41h.Sig.ICMCalculatesVehicleSpeed = 0x1E0; //速度 = (X * 0.512 * 3.14 * 1.05) / 30 66km
...@@ -499,7 +499,7 @@ uint32_t R485_Send_0x41(void) ...@@ -499,7 +499,7 @@ uint32_t R485_Send_0x41(void)
case 8: case 8:
R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x0; // 自动大灯 R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x0; // 自动大灯
R485_ID41h.Sig.ChargeState = 0x0; //充电状态 R485_ID41h.Sig.ChargeState = 0x0; //充电状态
R485_ID41h.Sig.SlopePattern = 0x1; //跛行 R485_ID41h.Sig.SlopePattern = 0x0; //跛行
R485_ID41h.Sig.CushionSensorStatus = 0x1; //坐垫压力 R485_ID41h.Sig.CushionSensorStatus = 0x1; //坐垫压力
R485_ID41h.Sig.SlopeDescentFunctionStatus = 0x0; //陡坡缓降 R485_ID41h.Sig.SlopeDescentFunctionStatus = 0x0; //陡坡缓降
R485_ID41h.Sig.TCSActivation = 0x1; //TCS激活 R485_ID41h.Sig.TCSActivation = 0x1; //TCS激活
...@@ -544,7 +544,7 @@ uint32_t R485_Send_0x41(void) ...@@ -544,7 +544,7 @@ uint32_t R485_Send_0x41(void)
R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x0; // 自动大灯 R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x0; // 自动大灯
R485_ID41h.Sig.ChargeState = 0x0; //充电状态 R485_ID41h.Sig.ChargeState = 0x0; //充电状态
R485_ID41h.Sig.SlopePattern = 0x1; //跛行 R485_ID41h.Sig.SlopePattern = 0x0; //跛行
R485_ID41h.Sig.CushionSensorStatus = 0x1; //坐垫压力 R485_ID41h.Sig.CushionSensorStatus = 0x1; //坐垫压力
R485_ID41h.Sig.SlopeDescentFunctionStatus = 0x0; //陡坡缓降 R485_ID41h.Sig.SlopeDescentFunctionStatus = 0x0; //陡坡缓降
R485_ID41h.Sig.TCSActivation = 0x1; //TCS激活 R485_ID41h.Sig.TCSActivation = 0x1; //TCS激活
...@@ -597,7 +597,7 @@ uint32_t R485_Send_0x41(void) ...@@ -597,7 +597,7 @@ uint32_t R485_Send_0x41(void)
R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x1; // 自动大灯 R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x1; // 自动大灯
R485_ID41h.Sig.ChargeState = 0x1; //充电状态 R485_ID41h.Sig.ChargeState = 0x1; //充电状态
R485_ID41h.Sig.SlopePattern = 0x0; //跛行 R485_ID41h.Sig.SlopePattern = 0x1; //跛行
R485_ID41h.Sig.CushionSensorStatus = 0x1; //坐垫压力 R485_ID41h.Sig.CushionSensorStatus = 0x1; //坐垫压力
R485_ID41h.Sig.SlopeDescentFunctionStatus = 0x1; //陡坡缓降 R485_ID41h.Sig.SlopeDescentFunctionStatus = 0x1; //陡坡缓降
R485_ID41h.Sig.TCSActivation = 0x1; //TCS激活 R485_ID41h.Sig.TCSActivation = 0x1; //TCS激活
...@@ -616,7 +616,7 @@ uint32_t R485_Send_0x41(void) ...@@ -616,7 +616,7 @@ uint32_t R485_Send_0x41(void)
R485_ID41h.Sig.MCUFaultStateU_PhaseHallFault = 0; R485_ID41h.Sig.MCUFaultStateU_PhaseHallFault = 0;
R485_ID41h.Sig.MCUFaultStateV_PhaseHallFault = 0; R485_ID41h.Sig.MCUFaultStateV_PhaseHallFault = 0;
R485_ID41h.Sig.MCUFaultStateW_PhaseHallFault = 0; R485_ID41h.Sig.MCUFaultStateW_PhaseHallFault = 0;
R485_ID41h.Sig.MCUFaultStatus_HandlebarFault = 0; R485_ID41h.Sig.MCUFaultStatus_HandlebarFault = 1;
R485_ID41h.Sig.BMS_0CommunicationStatus = 0; R485_ID41h.Sig.BMS_0CommunicationStatus = 0;
R485_ID41h.Sig.MCUCommunicationStatus = 0; R485_ID41h.Sig.MCUCommunicationStatus = 0;
R485_ID41h.Sig.ALMCommunicationStatus = 0; R485_ID41h.Sig.ALMCommunicationStatus = 0;
...@@ -639,7 +639,7 @@ uint32_t R485_Send_0x41(void) ...@@ -639,7 +639,7 @@ uint32_t R485_Send_0x41(void)
R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x1; // 自动大灯 R485_ID41h.Sig.EleHeadlightFunctionSettings = 0x1; // 自动大灯
R485_ID41h.Sig.ChargeState = 0x1; //充电状态 R485_ID41h.Sig.ChargeState = 0x1; //充电状态
R485_ID41h.Sig.SlopePattern = 0x0; //跛行 R485_ID41h.Sig.SlopePattern = 0x1; //跛行
R485_ID41h.Sig.CushionSensorStatus = 0x1; //坐垫压力 R485_ID41h.Sig.CushionSensorStatus = 0x1; //坐垫压力
R485_ID41h.Sig.SlopeDescentFunctionStatus = 0x1; //陡坡缓降 R485_ID41h.Sig.SlopeDescentFunctionStatus = 0x1; //陡坡缓降
R485_ID41h.Sig.TCSActivation = 0x1; //TCS激活 R485_ID41h.Sig.TCSActivation = 0x1; //TCS激活
...@@ -725,10 +725,10 @@ uint32_t R485_Send_0x42(void) ...@@ -725,10 +725,10 @@ uint32_t R485_Send_0x42(void)
case 0: case 0:
break; break;
case 1: case 1:
R485_ID42h.Sig.TotalBatteryCurrent = 0x34; //母线电流 R485_ID42h.Sig.TotalBatteryCurrent = 0x44; //母线电流
break; break;
case 2: case 2:
R485_ID42h.Sig.TotalBatteryCurrent = 0x96; //母线电流 R485_ID42h.Sig.TotalBatteryCurrent = 0x74; //母线电流
break; break;
case 3: case 3:
R485_ID42h.Sig.TotalBatteryCurrent = 0xFA; //母线电流 R485_ID42h.Sig.TotalBatteryCurrent = 0xFA; //母线电流
...@@ -739,13 +739,16 @@ uint32_t R485_Send_0x42(void) ...@@ -739,13 +739,16 @@ uint32_t R485_Send_0x42(void)
R485_ID42h.Sig.TPower = 0x1; //T动力状态 R485_ID42h.Sig.TPower = 0x1; //T动力状态
break; break;
case 5: case 5:
R485_ID42h.Sig.TotalBatteryCurrent = 0x31; // R485_ID42h.Sig.nenglainhuishou = 0x1;
R485_ID42h.Sig.TotalBatteryCurrent = 0x17;
break; break;
case 6: case 6:
R485_ID42h.Sig.TotalBatteryCurrent = 0x2F; // R485_ID42h.Sig.nenglainhuishou = 0x1;
R485_ID42h.Sig.TotalBatteryCurrent = 0x14;
break; break;
case 7: case 7:
R485_ID42h.Sig.TotalBatteryCurrent = 0x1; R485_ID42h.Sig.nenglainhuishou = 0x1;
R485_ID42h.Sig.TotalBatteryCurrent = 0x0;
break; break;
case 8: case 8:
break; break;
...@@ -874,6 +877,23 @@ uint32_t R485_Send_0x80(void) ...@@ -874,6 +877,23 @@ uint32_t R485_Send_0x80(void)
RS485_TX_finish = 1; RS485_TX_finish = 1;
return u32sendendflag; return u32sendendflag;
} }
uint32_t R485_Send_0x45(void)
{
uint8_t length;
uint32_t u32sendendflag = 0;
memset(R485_0x80_msg,0xFF,sizeof(R485_0x80_msg));
if(RS485_TX_finish == 0)
{
RS485_TX_finish = 1;
u32sendendflag = R485_Send(0x45, R485_0x80_msg, sizeof(R485_0x80_msg));
RS485_send_time = 0;
RS485_TX_finish = 1;
}
RS485_TX_finish = 1;
return u32sendendflag;
}
uint8_t Send_Lineget_Msg[64]; uint8_t Send_Lineget_Msg[64];
uint8_t firstsec = 0;; uint8_t firstsec = 0;;
uint32_t R485_Send_Line_0x47(uint8_t n) uint32_t R485_Send_Line_0x47(uint8_t n)
......
...@@ -881,7 +881,7 @@ typedef union ...@@ -881,7 +881,7 @@ typedef union
uint8_t : 8; /* 37预留 */ uint8_t : 8; /* 37预留 */
uint8_t : 4; /* 38预留 */ uint8_t nenglainhuishou :4; /* 38预留 */
uint8_t Shoppingmode : 2; /*导购模式*/ uint8_t Shoppingmode : 2; /*导购模式*/
uint8_t : 2; /* 38预留 */ uint8_t : 2; /* 38预留 */
...@@ -1074,14 +1074,14 @@ typedef union ...@@ -1074,14 +1074,14 @@ typedef union
uint8_t : 8; /* 48预留 */ uint8_t : 8; /* 48预留 */
uint8_t : 8; /* 49预留 */ uint8_t : 8; /* 49预留 */
/* Byte 50-51 */ /* Byte 50-51 */
uint8_t : 8; /* 50预留 */ uint8_t ESP321 :8; /* 50预留 */
uint8_t : 8; /* 51预留 */ uint8_t ESP322: 8; /* 51预留 */
/* Byte 52-53 */ /* Byte 52-53 */
uint8_t : 8; /* 52预留 */ uint8_t : 8; /* 52预留 */
uint8_t : 8; /* 53预留 */ uint8_t : 8; /* 53预留 */
/* Byte 54-55 */ /* Byte 54-55 */
uint8_t : 8; /* 54预留 */ uint8_t G0311 :8; /* 54预留 */
uint8_t : 8; /* 55预留 */ uint8_t G0312 :8; /* 55预留 */
/* Byte 56-57 */ /* Byte 56-57 */
uint8_t : 8; /* 56预留 */ uint8_t : 8; /* 56预留 */
uint8_t : 8; /* 57预留 */ uint8_t : 8; /* 57预留 */
...@@ -1139,6 +1139,7 @@ extern uint32_t R485_Send_clear(void); ...@@ -1139,6 +1139,7 @@ extern uint32_t R485_Send_clear(void);
extern uint32_t R485_Sendcheck_0x47(void); extern uint32_t R485_Sendcheck_0x47(void);
extern uint32_t R485_Send_0x80(void); extern uint32_t R485_Send_0x80(void);
extern uint32_t R485_Send_0x45(void);
extern uint32_t R485_Send_ble0x42(void); extern uint32_t R485_Send_ble0x42(void);
extern uint8_t barcode_Msg[64]; extern uint8_t barcode_Msg[64];
......
...@@ -101,10 +101,11 @@ void RTE_GPIO_Init(void) ...@@ -101,10 +101,11 @@ void RTE_GPIO_Init(void)
gpio_temp.enGPIODir = GPIO_DIR_IN; gpio_temp.enGPIODir = GPIO_DIR_IN;
gpio_temp.enGPIOAltFun = GPIO_ALTER_FUN_1; gpio_temp.enGPIOAltFun = GPIO_ALTER_FUN_1;
GPIO_Config(&gpio_temp); GPIO_Config(&gpio_temp);
// LINE_OUT_NEG_01 = 1; LINE_OUT_NEG_01 = 1;
// LINE_OUT_NEG_02 = 1; LINE_OUT_NEG_02 = 1;
// LINE_OUT_NEG_03 = 1; LINE_OUT_NEG_03 = 1;
// LINE_OUT_NEG_04 = 1; LINE_OUT_NEG_04 = 1;
queren = 0;
#if(0) #if(0)
gpio_temp.enGPIOPort = GPIO_PORT_GROUP_0; gpio_temp.enGPIOPort = GPIO_PORT_GROUP_0;
......
...@@ -148,6 +148,8 @@ void Sys_Run_Mode_10ms_Tasks_Group(void) ...@@ -148,6 +148,8 @@ void Sys_Run_Mode_10ms_Tasks_Group(void)
// { // {
// bleOFFtoONtime++; // bleOFFtoONtime++;
// } // }
if(RS485_TX_finish == 0)
{
if(startONfalg == 0) if(startONfalg == 0)
{ {
if(send0x42time<130) if(send0x42time<130)
...@@ -168,7 +170,7 @@ void Sys_Run_Mode_10ms_Tasks_Group(void) ...@@ -168,7 +170,7 @@ void Sys_Run_Mode_10ms_Tasks_Group(void)
} }
else else
{ {
if(startIGONtime >= 50) if(startIGONtime >= 50)
{ {
LINE_OUT_NEG_01 = 1; LINE_OUT_NEG_01 = 1;
LINE_OUT_NEG_02 = 1; LINE_OUT_NEG_02 = 1;
...@@ -176,15 +178,13 @@ void Sys_Run_Mode_10ms_Tasks_Group(void) ...@@ -176,15 +178,13 @@ void Sys_Run_Mode_10ms_Tasks_Group(void)
LINE_OUT_NEG_04 = 1; LINE_OUT_NEG_04 = 1;
R485_Send_0x80(); R485_Send_0x80();
blename[4] = 0xFF; blename[4] = 0xFF;
if(recvflag111 == 1)
{
General_Number_Disp(blename, 3, 165);
recvflag111 = 0;
}
} }
} }
RS485_send_time = 0; RS485_send_time = 0;
RS485_TX_finish = 1; RS485_TX_finish = 1;
}
} }
...@@ -197,8 +197,13 @@ void Sys_Run_Mode_10ms_Tasks_Group(void) ...@@ -197,8 +197,13 @@ void Sys_Run_Mode_10ms_Tasks_Group(void)
} }
else else
{ {
// backsend();
LINE_OUT_NEG_09 = 0; LINE_OUT_NEG_09 = 0;
Recv_Byte(); if(LINE_OUT_NEG_09 == 0)
{
Recv_Byte();
}
} }
...@@ -316,6 +321,7 @@ uint32_t AutoTime = 160; ...@@ -316,6 +321,7 @@ uint32_t AutoTime = 160;
uint32_t ONOFFtime; uint32_t ONOFFtime;
uint8_t compareresult; uint8_t compareresult;
uint8_t flashtime = 0; uint8_t flashtime = 0;
uint8_t showtime = 0;
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;
...@@ -402,7 +408,7 @@ void Sys_Run_Mode_100ms_Tasks_Group(void) ...@@ -402,7 +408,7 @@ void Sys_Run_Mode_100ms_Tasks_Group(void)
// comparestart = 2; // comparestart = 2;
} }
comparestart = 0; comparestart = 0;
Display_TFT_Clear(); // Display_TFT_Clear();
} }
else if(comparestart == 0) else if(comparestart == 0)
{ {
...@@ -430,7 +436,13 @@ void Sys_Run_Mode_100ms_Tasks_Group(void) ...@@ -430,7 +436,13 @@ void Sys_Run_Mode_100ms_Tasks_Group(void)
} }
flashtime = 0; flashtime = 0;
} }
if(recvflag111 == 1)
{
blename[4] = 0xff;
General_Number_Disp(blename, 3, 165);
recvflag111 = 0;
}
//u16LJSText = TFT_LCD_REQ_FIFO_MAX_DEPTH; //u16LJSText = TFT_LCD_REQ_FIFO_MAX_DEPTH;
} }
......
...@@ -492,18 +492,18 @@ void RS485_User_Tx_Data(void) ...@@ -492,18 +492,18 @@ void RS485_User_Tx_Data(void)
} }
} }
break; break;
// case 3: case 3:
// sendfinishflag = R485_Send_0x80(); sendfinishflag = R485_Send_0x45();
// if(sendfinishflag == 0) if(sendfinishflag == 0)
// { {
// RS485_send_time = 0; RS485_send_time = 0;
// RS485_TX_finish = 1; RS485_TX_finish = 1;
// if(RS485_TX_finish == 1) if(RS485_TX_finish == 1)
// { {
// RS485_send_num++; RS485_send_num = 0;
// } }
// } }
// break; break;
default: default:
flag = 1; flag = 1;
RS485_send_time = 0; RS485_send_time = 0;
......
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