Commit 189fa3ca authored by 何锐's avatar 何锐

feat:372提交初版功能

parent e8d8fc9e
...@@ -55,6 +55,7 @@ void Diag_Info_Init(void); ...@@ -55,6 +55,7 @@ void Diag_Info_Init(void);
void Total_Check(void); void Total_Check(void);
void HW_CHECK_Ctrl(unsigned int cmd); void HW_CHECK_Ctrl(unsigned int cmd);
void MENU_CHECK_STEP_ADD(void); void MENU_CHECK_STEP_ADD(void);
extern void MENU_CHECK_Confirm_STEP(void);
void MENU_CHECK_STEP_SUB(void); void MENU_CHECK_STEP_SUB(void);
void HW_ODO_Clear(void); void HW_ODO_Clear(void);
void MENU_CHECK_Init(void); void MENU_CHECK_Init(void);
......
...@@ -5,26 +5,16 @@ ...@@ -5,26 +5,16 @@
#include "Barcode_Scanner.h" #include "Barcode_Scanner.h"
#include "Task.h" #include "Task.h"
#include "string.h" #include "string.h"
void Key_Operation_SW5(Key_Event_en_t enKeyEvent)
uint8_t Confirmkeycount;
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))
// {
// ;
// }
// else
// {
// Display_Add( );
// Display_TFT_Clear( );
// }
if(firstpowerflag == 2) if(firstpowerflag == 2)
{ {
MENU_CHECK_STEP_ADD( ); MENU_CHECK_STEP_ADD( );
} }
} }
else if ( enKeyEvent == KEY_EVENT_LONG_PRESS ) else if ( enKeyEvent == KEY_EVENT_LONG_PRESS )
{ {
...@@ -41,37 +31,14 @@ void Key_Operation_SW5(Key_Event_en_t enKeyEvent) ...@@ -41,37 +31,14 @@ 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))
// {
// ;
// }
// else
// {
// Display_Sub( );
// Display_TFT_Clear( );
// }
if(firstpowerflag == 2) if(firstpowerflag == 2)
{ {
MENU_CHECK_STEP_SUB(); MENU_CHECK_STEP_SUB();
...@@ -104,18 +71,18 @@ void Key_Operation_SW7(Key_Event_en_t enKeyEvent) ...@@ -104,18 +71,18 @@ void Key_Operation_SW7(Key_Event_en_t enKeyEvent)
if ( enKeyEvent == KEY_EVENT_SHORT_PRESS ) if ( enKeyEvent == KEY_EVENT_SHORT_PRESS )
{ {
if(firstpowerflag == 2) // if(firstpowerflag == 2)
{ // {
if(zhenduanflag != 2 && zhenduanflag != 3) // if(zhenduanflag != 2 && zhenduanflag != 3)
{ // {
zhenduanflag = 2; // zhenduanflag = 2;
} // }
else // else
{ // {
zhenduanflag = 0; // zhenduanflag = 0;
} // }
} // }
upkeyflag = 1; //按键加
} }
else if ( enKeyEvent == KEY_EVENT_LONG_PRESS ) else if ( enKeyEvent == KEY_EVENT_LONG_PRESS )
{ {
...@@ -131,26 +98,35 @@ void Key_Operation_SW8(Key_Event_en_t enKeyEvent) ...@@ -131,26 +98,35 @@ void Key_Operation_SW8(Key_Event_en_t enKeyEvent)
{ {
if ( enKeyEvent == KEY_EVENT_SHORT_PRESS ) if ( enKeyEvent == KEY_EVENT_SHORT_PRESS )
{ {
if(firstpowerflag == 2) // if(firstpowerflag == 2)
{ // {
if(zhenduanflag != 1) // if(zhenduanflag != 1)
{ // {
zhenduanflag = 1; // zhenduanflag = 1;
} // }
else // else
{ // {
zhenduanflag = 0; // zhenduanflag = 0;
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;
zhenduansendStep = 0; // zhenduansendStep = 0;
// memset(barcode_Msg,0,sizeof(barcode_Msg)); // // memset(barcode_Msg,0,sizeof(barcode_Msg));
} // }
RS485_TX_finish = 0; // RS485_TX_finish = 0;
// }
if(LINE_OUT_NEG_01 == 1U) //上下ACC电
{
LINE_OUT_NEG_01 = 0U;
Auto_ONOFF = 3;
}
else
{
LINE_OUT_NEG_01 = 1U;
Auto_ONOFF = 0;
} }
} }
else if ( enKeyEvent == KEY_EVENT_LONG_PRESS ) else if ( enKeyEvent == KEY_EVENT_LONG_PRESS )
{ {
...@@ -167,19 +143,20 @@ void Key_Operation_SW2(Key_Event_en_t enKeyEvent) ...@@ -167,19 +143,20 @@ void Key_Operation_SW2(Key_Event_en_t enKeyEvent)
if ( enKeyEvent == KEY_EVENT_SHORT_PRESS ) if ( enKeyEvent == KEY_EVENT_SHORT_PRESS )
{ {
if(firstpowerflag == 2) // if(firstpowerflag == 2)
{ // {
if(LINE_OUT_NEG_01 == 1U) // if(LINE_OUT_NEG_01 == 1U)
{ // {
LINE_OUT_NEG_01 = 0U; // LINE_OUT_NEG_01 = 0U;
Auto_ONOFF = 3; // Auto_ONOFF = 3;
} // }
else // else
{ // {
LINE_OUT_NEG_01 = 1U; // LINE_OUT_NEG_01 = 1U;
Auto_ONOFF == 0; // Auto_ONOFF == 0;
} // }
} // }
downkeyflag = 1; //按键减
} }
else if ( enKeyEvent == KEY_EVENT_LONG_PRESS ) else if ( enKeyEvent == KEY_EVENT_LONG_PRESS )
{ {
...@@ -199,19 +176,35 @@ void Key_Operation_SW3(Key_Event_en_t enKeyEvent) ...@@ -199,19 +176,35 @@ void Key_Operation_SW3(Key_Event_en_t enKeyEvent)
// { // {
// MENU_CHECK_STEP_SUB( ); // MENU_CHECK_STEP_SUB( );
// } // }
if(firstpowerflag == 2) // if(firstpowerflag == 2)
// {
// if(clearOdoFlag == 0)
// {
// clearOdoFlag = 1;
// }
// RS485_TX_finish = 0;
// // else
// // {
// // clearOdoFlag = 0;
// // }
// // queren = 0;
// }
if(MENU_CHECK_STEP == 14)
{ {
if(clearOdoFlag == 0) Confirmkeyflag = 1; //确认
Confirmkeycount++;
if(Confirmkeycount >= 5)
{ {
clearOdoFlag = 1; fsijnifvs = 1;
Confirmkeycount = 0;
MENU_CHECK_STEP_ADD();
} }
RS485_TX_finish = 0; }
// else else
// { {
// clearOdoFlag = 0; Confirmkeycount == 0;
// } fsijnifvs = 0;
// queren = 0;
} }
} }
else if ( enKeyEvent == KEY_EVENT_LONG_PRESS ) else if ( enKeyEvent == KEY_EVENT_LONG_PRESS )
...@@ -228,7 +221,7 @@ void Key_Operation_SW3(Key_Event_en_t enKeyEvent) ...@@ -228,7 +221,7 @@ void Key_Operation_SW3(Key_Event_en_t enKeyEvent)
{ {
} }
} }
void Key_Operation_SW1(Key_Event_en_t enKeyEvent) void Key_Operation_SW1(Key_Event_en_t enKeyEvent) //自动下电模式切换
{ {
/*清零ODO*/ /*清零ODO*/
if ( enKeyEvent == KEY_EVENT_SHORT_PRESS ) if ( enKeyEvent == KEY_EVENT_SHORT_PRESS )
...@@ -368,24 +361,26 @@ void Key_Operation_SW10(Key_Event_en_t enKeyEvent) ...@@ -368,24 +361,26 @@ void Key_Operation_SW10(Key_Event_en_t enKeyEvent)
if(firstpowerflag == 2) if(firstpowerflag == 2)
{ {
Display_TFT_Clear(); // Display_TFT_Clear();
if(connectbleFlag == 0) // if(connectbleFlag == 0)
{ // {
connectbleFlag = 1; // connectbleFlag = 1;
name1= (devicename) & 0xFF; // name1= (devicename) & 0xFF;
name2 = (devicename >> 8) & 0xFF; // name2 = (devicename >> 8) & 0xFF;
} // }
else // else
{ // {
name1= (devicename) & 0xFF; // name1= (devicename) & 0xFF;
name2 = (devicename >> 8) & 0xFF; // name2 = (devicename >> 8) & 0xFF;
startONfalg = 0; // startONfalg = 0;
send0x42time = 0; // send0x42time = 0;
bleOFFtoONtime = 0; // bleOFFtoONtime = 0;
startONfalg = 0; // startONfalg = 0;
startIGONtime = 0; // startIGONtime = 0;
recvflag111 = 0; // recvflag111 = 0;
} // }
clearOdoFlag = 1;
// queren = 1;
} }
} }
else if ( enKeyEvent == KEY_EVENT_LONG_PRESS ) else if ( enKeyEvent == KEY_EVENT_LONG_PRESS )
......
...@@ -119,9 +119,30 @@ void RTE_GPIO_Init(void) ...@@ -119,9 +119,30 @@ void RTE_GPIO_Init(void)
gpio_temp.enGPIODir = GPIO_DIR_OUT; gpio_temp.enGPIODir = GPIO_DIR_OUT;
gpio_temp.enGPIOAltFun = GPIO_ALTER_FUN_1; gpio_temp.enGPIOAltFun = GPIO_ALTER_FUN_1;
GPIO_Config(&gpio_temp); GPIO_Config(&gpio_temp);
gpio_temp.enGPIOPort = GPIO_PORT_GROUP_8;
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);
gpio_temp.enGPIOPort = GPIO_PORT_GROUP_0;
gpio_temp.enGPIOPIN = GPIO_PIN_0;
gpio_temp.enGPIOMode = GPIO_MODE_PORT;
gpio_temp.enGPIODir = GPIO_DIR_OUT;
gpio_temp.enGPIOAltFun = GPIO_ALTER_FUN_1;
GPIO_Config(&gpio_temp);
gpio_temp.enGPIOPort = GPIO_PORT_GROUP_0;
gpio_temp.enGPIOPIN = GPIO_PIN_1;
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; // queren = 0;
LINE_OUT_POS_06 = 0; // LINE_OUT_POS_06 = 0;
LINE_OUT_POS_07 = 0; // LINE_OUT_POS_07 = 0;
LINE_OUT_NEG_01 = 1; LINE_OUT_NEG_01 = 1;
......
...@@ -84,8 +84,6 @@ ...@@ -84,8 +84,6 @@
#define LINE_OUT_POS_03 GPIO_OUT_APORT00_PIN04 #define LINE_OUT_POS_03 GPIO_OUT_APORT00_PIN04
#define LINE_OUT_POS_04 GPIO_OUT_APORT00_PIN05 #define LINE_OUT_POS_04 GPIO_OUT_APORT00_PIN05
#define LINE_OUT_POS_05 GPIO_OUT_APORT00_PIN06 #define LINE_OUT_POS_05 GPIO_OUT_APORT00_PIN06
#define LINE_OUT_POS_06 GPIO_OUT_APORT00_PIN13
#define LINE_OUT_POS_07 GPIO_OUT_APORT00_PIN14
// #define LINE_OUT_POS_08 GPIO_OUT_PORT08_PIN09 // #define LINE_OUT_POS_08 GPIO_OUT_PORT08_PIN09
// #define LINE_OUT_POS_09 GPIO_OUT_PORT08_PIN08 // #define LINE_OUT_POS_09 GPIO_OUT_PORT08_PIN08
// #define LINE_OUT_POS_10 GPIO_OUT_PORT00_PIN07 // #define LINE_OUT_POS_10 GPIO_OUT_PORT00_PIN07
...@@ -102,19 +100,27 @@ ...@@ -102,19 +100,27 @@
// #define LINE_FUEL_RES01 GPIO_OUT_PORT00_PIN13 // #define LINE_FUEL_RES01 GPIO_OUT_PORT00_PIN13
#define LINE_FUEL_RES03 GPIO_OUT_PORT08_PIN10 #define LINE_FUEL_RES03 GPIO_OUT_PORT08_PIN10 //蜂鸣器
#define LINE_FUEL_RES04 GPIO_OUT_PORT08_PIN11 //左转 输入 #define LINE_FUEL_RES04 GPIO_OUT_PORT08_PIN11 //左转 输入
#define LINE_FUEL_RES02 GPIO_OUT_PORT08_PIN12 //右转 输入 #define LINE_FUEL_RES02 GPIO_OUT_PORT08_PIN12 //右转 输入
#define GPIO_VSpeed_PWM_IN GPIO_IN_PORT10_PIN15 #define GPIO_VSpeed_PWM_IN GPIO_IN_PORT10_PIN15
#define LED3 GPIO_OUT_APORT00_PIN10 //右转 // #define LED3 GPIO_OUT_APORT00_PIN10 //右转
#define LED4 GPIO_OUT_APORT00_PIN11 //左转 // #define LED4 GPIO_OUT_APORT00_PIN11 //左转
#define LINE_OUT_NEG_05 GPIO_OUT_PORT09_PIN02 //ABS #define LINE_OUT_NEG_05 GPIO_OUT_PORT09_PIN02 //ABS
#define LINE_OUT_NEG_06 GPIO_OUT_PORT09_PIN01 //位置灯 #define LINE_OUT_NEG_06 GPIO_OUT_PORT09_PIN01 //位置灯
#define LINE_jinguang GPIO_OUT_PORT10_PIN10 //近光 // #define POWER_CTRL_KL30_Current GPIO_OUT_PORT10_PIN14 //蓝牙
#define POWER_CTRL_KL30_Current GPIO_OUT_PORT10_PIN14 //蓝牙
#define LeftturnSignal GPIO_OUT_APORT00_PIN11 //左转灯
#define RightturnSignal GPIO_OUT_APORT00_PIN10 //右转灯
#define highbeam GPIO_OUT_PORT10_PIN13 //远光灯
#define Lowbeam GPIO_OUT_PORT10_PIN10 //近光
#define Bluetoothlight GPIO_OUT_PORT10_PIN14 //蓝牙灯
#define Press_to_up GPIO_OUT_PORT00_PIN00
#define Press_to_down GPIO_OUT_PORT00_PIN01
//zh: //zh:
/****************************************************************************** /******************************************************************************
......
...@@ -9,7 +9,10 @@ extern uint32_t send0x42time; ...@@ -9,7 +9,10 @@ extern uint32_t send0x42time;
extern uint32_t bleOFFtoONtime; 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 upkeyflag;
extern uint8_t downkeyflag;
extern uint8_t Confirmkeyflag;
// extern uint8_t Openble[20];
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);
......
...@@ -15,14 +15,14 @@ ...@@ -15,14 +15,14 @@
typedef enum typedef enum
{ {
RS485_Tx_ID48_Idx = 0, // RS485_Tx_ID04_Idx = 0,
RS485_Tx_ID49_Idx, RS485_Tx_ID80_Idx = 0,
RS485_Tx_ID4A_Idx, RS485_Tx_IDA4_Idx,
RS485_Tx_ID70_Idx, RS485_Tx_IDD0_Idx,
RS485_Tx_ID71_Idx, RS485_Tx_IDD1_Idx,
RS485_Tx_ID72_Idx, RS485_Tx_IDD2_Idx,
RS485_Tx_ID73_Idx, RS485_Tx_IDD3_Idx,
RS485_Tx_ID74_Idx, // RS485_Tx_ID74_Idx,
RS485_Tx_ID_Idx_Max, RS485_Tx_ID_Idx_Max,
}RS485_Receive_ID_Idx_en_t; }RS485_Receive_ID_Idx_en_t;
...@@ -48,8 +48,15 @@ typedef enum ...@@ -48,8 +48,15 @@ typedef enum
R485_Lost = 0x55, R485_Lost = 0x55,
}_en_485_Rx_Status_t; }_en_485_Rx_Status_t;
// RS485发送控制结构体(包含发送延迟计数等参数)
typedef struct
{
uint8_t delayCounter;
uint8_t sendIndex;
uint8_t Openble[20];
} RS485_TxControl_en_t;
extern RS485_TxControl_en_t RS485_TxControl;
typedef struct typedef struct
{ {
uint8_t u8RecVal[RS485_RX_DATA_LEN]; uint8_t u8RecVal[RS485_RX_DATA_LEN];
...@@ -60,11 +67,11 @@ typedef struct ...@@ -60,11 +67,11 @@ typedef struct
} RS485ValidDataPacket_st_t; } RS485ValidDataPacket_st_t;
extern uint32_t RS485_send_time; extern uint32_t RS485_send_time;
extern uint8_t RS485_TX_finish; extern uint8_t RS485_TX_finish;
extern uint32_t RS485_send_num; // extern uint32_t RS485_send_num;
extern uint32_t sendnum; extern uint32_t sendnum;
extern uint8_t sendmsgAll[8]; extern uint8_t sendmsgAll[8];
extern uint32_t R485_Send(const uint16_t cmdID, const uint8_t* pData, uint8_t len); extern uint32_t R485_Send(const uint16_t cmdID, const uint8_t* pData, uint8_t len);
extern uint8_t Yadi_CAL_Data_Sum(uint8_t* pu8LinData, uint16_t u8LinLen); extern uint16_t Yadi_CAL_Data_Sum(uint8_t* pu8LinData, uint8_t u8LinLen);
extern void RS485_User_Tx_Data(void); extern uint8_t RS485_User_Tx_Data(void);
void backsend(void); void backsend(void);
#endif /* API_ADC_H_ */ #endif /* API_ADC_H_ */
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