Commit d7223c34 authored by 何锐's avatar 何锐

feat:蓝牙检测时仪表重上电

parent b1ba66f7
......@@ -396,10 +396,10 @@ uint8_t yibiaoshuju[34];
blename[4] = 0xFF;
GUI_Display_Version_Code_Service(3, 150, "BT Name is ", Letter_Num_11, PCodeText_Space_size);
blnamedisplay[0] = name1 / 16;
blnamedisplay[1] = name1 % 16;
blnamedisplay[2] = name2 / 16;
blnamedisplay[3] = name2 % 16;
blnamedisplay[0] = name2 / 16;
blnamedisplay[1] = name2 % 16;
blnamedisplay[2] = name1 / 16;
blnamedisplay[3] = name1 % 16;
for(int i = 0; i<4; i++)
{
......@@ -740,10 +740,10 @@ void Function_Check_Ctrl(uint32_t cmd)
if(Auto_ONOFF == 0)
{
LINE_OUT_NEG_01 = 1;
LINE_OUT_NEG_04 = 1;
LINE_OUT_NEG_04 = 1;
LINE_OUT_NEG_02 = 1;
LINE_OUT_NEG_03 = 1;
}
LINE_OUT_NEG_02 = 1;
LINE_OUT_NEG_03 = 1;
RightturnSignal = 0;
LeftturnSignal = 0;
......@@ -759,10 +759,10 @@ void Function_Check_Ctrl(uint32_t cmd)
if(Auto_ONOFF == 0)
{
LINE_OUT_NEG_01 = 0;
LINE_OUT_NEG_04 = 0;
LINE_OUT_NEG_04 = 0;
LINE_OUT_NEG_02 = 0;
LINE_OUT_NEG_03 = 1;
}
LINE_OUT_NEG_02 = 0;
LINE_OUT_NEG_03 = 1;
RightturnSignal = 0;
LeftturnSignal = 0;
......@@ -777,11 +777,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_04 = 1;
LINE_OUT_NEG_02 = 1;
LINE_OUT_NEG_03 = 1;
}
LINE_OUT_NEG_02 = 1;
LINE_OUT_NEG_03 = 1;
RightturnSignal = 1;
LeftturnSignal = 0;
Bluetoothlight = 1;
......@@ -816,10 +816,10 @@ void Function_Check_Ctrl(uint32_t cmd)
if(Auto_ONOFF == 0)
{
LINE_OUT_NEG_01 = 1;
LINE_OUT_NEG_04 = 1;
LINE_OUT_NEG_04 = 1;
LINE_OUT_NEG_02 = 1;
LINE_OUT_NEG_03 = 1;
}
LINE_OUT_NEG_02 = 1;
LINE_OUT_NEG_03 = 1;
RightturnSignal = 0;
LeftturnSignal = 0;
......@@ -837,10 +837,10 @@ void Function_Check_Ctrl(uint32_t cmd)
if(Auto_ONOFF == 0)
{
LINE_OUT_NEG_01 = 1;
LINE_OUT_NEG_04 = 1;
LINE_OUT_NEG_04 = 1;
LINE_OUT_NEG_02 = 1;
LINE_OUT_NEG_03 = 1;
}
LINE_OUT_NEG_02 = 1;
LINE_OUT_NEG_03 = 1;
}
else
{
......@@ -849,20 +849,20 @@ void Function_Check_Ctrl(uint32_t cmd)
if(Auto_ONOFF == 0)
{
LINE_OUT_NEG_01 = 0;
LINE_OUT_NEG_04 = 0;
LINE_OUT_NEG_04 = 0;
LINE_OUT_NEG_02 = 1;
LINE_OUT_NEG_03 = 1;
}
LINE_OUT_NEG_02 = 1;
LINE_OUT_NEG_03 = 1;
}
else
{
if(Auto_ONOFF == 0)
{
LINE_OUT_NEG_01 = 0;
LINE_OUT_NEG_04 = 1;
LINE_OUT_NEG_04 = 1;
LINE_OUT_NEG_02 = 1;
LINE_OUT_NEG_03 = 1;
}
LINE_OUT_NEG_02 = 1;
LINE_OUT_NEG_03 = 1;
}
}
......@@ -879,10 +879,10 @@ void Function_Check_Ctrl(uint32_t cmd)
if(Auto_ONOFF == 0)
{
LINE_OUT_NEG_01 = 0;
LINE_OUT_NEG_04 = 0;
LINE_OUT_NEG_04 = 0;
LINE_OUT_NEG_02 = 1;
LINE_OUT_NEG_03 = 1;
}
LINE_OUT_NEG_02 = 1;
LINE_OUT_NEG_03 = 1;
RightturnSignal = 0;
LeftturnSignal = 0;
......@@ -897,10 +897,10 @@ void Function_Check_Ctrl(uint32_t cmd)
if(Auto_ONOFF == 0)
{
LINE_OUT_NEG_01 = 1;
LINE_OUT_NEG_04 = 1;
LINE_OUT_NEG_04 = 1;
LINE_OUT_NEG_02 = 1;
LINE_OUT_NEG_03 = 1;
}
LINE_OUT_NEG_02 = 1;
LINE_OUT_NEG_03 = 1;
Lowbeam = 0;
LeftturnSignal = 0;
......@@ -979,10 +979,10 @@ void Function_Check_Ctrl(uint32_t cmd)
if(Auto_ONOFF == 0)
{
LINE_OUT_NEG_01 = 1;
LINE_OUT_NEG_04 = 1;
LINE_OUT_NEG_04 = 1;
LINE_OUT_NEG_02 = 1;
LINE_OUT_NEG_03 = 1;
}
LINE_OUT_NEG_02 = 1;
LINE_OUT_NEG_03 = 1;
RightturnSignal = 1;
LeftturnSignal = 1;
......
......@@ -4902,7 +4902,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 [7] = {2,5,1,1,2,1,0xff};
uint8_t mbuff [7] = {2,5,1,1,2,5,0xff};
General_Number_Disp(mbuff, 160, 290);
}
......
......@@ -112,58 +112,14 @@ uint8_t flashtime = 0;
uint8_t showtime = 0;
uint8_t bleuarttime = 0;
uint8_t querendelay = 0;
uint8_t clesrodoauto = 0;
uint8_t clesrodookauto = 0;
uint8_t BlueToothlock = 0;
void Sys_Run_Mode_100ms_Tasks_Group(void)
{
if(BlueTooth)
{
if(BlueToothlock == 0)
{
name1 = (devicename) & 0xFF;
name2 = (devicename >> 8) & 0xFF;
}
BlueToothlock = 1;
}
else
{
BlueToothlock = 0;
}
if(MENU_CHECK_STEP == 9)
{
if(clesrodoauto >= 50)
{
clearOdoFlag = 1;
}
else
{
clesrodoauto++;
}
}
else
{
clesrodoauto = 0;
}
if(clearOdoFlag == 1)
{
if(clesrodookauto >= 160)
{
queren = 1;
}
else
{
clesrodookauto++;
}
}
else
{
clesrodookauto = 0;
}
ProcessBluetoothDeviceNameWithLock();
AutoClearCounterAfterAllLit();
TimeDelay_3s();
PasswordUnlock();
BTEnableDelayPowerReset();
static uint32_t loc_timer = 0;
loc_timer++;
......
......@@ -363,6 +363,105 @@ void Bluetoothname(void)
devicename = 0;
}
}
uint8_t BlueToothlock = 0;
/* 蓝牙名字设置函数 */
void ProcessBluetoothDeviceNameWithLock(void)
{
if(BlueTooth)
{
if(BlueToothlock == 0)
{
name1 = (devicename) & 0xFF;
name2 = (devicename >> 8) & 0xFF;
}
BlueToothlock = 1;
}
else
{
BlueToothlock = 0;
}
}
uint8_t clesrodoauto = 0;
uint8_t clesrodookauto = 0;
/* 全亮后自动清大计函数 */
void AutoClearCounterAfterAllLit(void)
{
if(MENU_CHECK_STEP == 9)
{
if(clesrodoauto >= 50)
{
clearOdoFlag = 1;
}
else
{
clesrodoauto++;
}
}
else
{
clesrodoauto = 0;
}
if(clearOdoFlag == 1)
{
if(clesrodookauto >= 160)
{
queren = 1;
}
else
{
clesrodookauto++;
}
}
else
{
clesrodookauto = 0;
}
}
uint8_t bluetoothdelaytime;
/* 蓝牙检测后切电 */
uint8_t BlueToothSwitch;
void BTEnableDelayPowerReset(void)
{
if((BlueTooth == 1) && (BlueToothSwitch != 1))
{
if(bluetoothdelaytime <= 50)
{
bluetoothdelaytime++;
}
else if(bluetoothdelaytime <= 55)
{
bluetoothdelaytime++;
Auto_ONOFF = 3;
LINE_OUT_NEG_01 = 0;
LINE_OUT_NEG_04 = 0;
LINE_OUT_NEG_02 = 0;
LINE_OUT_NEG_03 = 0;
}
else
{
Auto_ONOFF = 0;
BlueToothSwitch = 1;
bluetoothdelaytime = 0;
LINE_OUT_NEG_01 = 1;
LINE_OUT_NEG_04 = 1;
LINE_OUT_NEG_02 = 1;
LINE_OUT_NEG_03 = 1;
}
}
else if((BlueTooth == 0) && (BlueToothSwitch == 1))
{
BlueToothSwitch = 0;
bluetoothdelaytime = 0;
}
else
{
bluetoothdelaytime = 0;
}
}
uint32_t R485_Send(const uint16_t cmdID, const uint8_t* pData, uint8_t len)
{
uint8_t dataBuf[256];
......@@ -506,7 +605,7 @@ uint8_t RS485_User_Tx_Data(void)
RS485_TxControl.Openble[5] = 0;
RS485_TxControl.Openble[6] = 0;
RS485_TxControl.Openble[7] = 0;
RS485_TxControl.Openble[8] = BlueTooth;
RS485_TxControl.Openble[8] = BlueToothSwitch;
RS485_TxControl.Openble[9] = name1;
RS485_TxControl.Openble[10] = name2;
......
......@@ -84,4 +84,7 @@ extern uint8_t RS485_User_Tx_Data(void);
void backsend(void);
extern void TX_RX_485_service(void);
extern void Bluetoothname(void);
extern void ProcessBluetoothDeviceNameWithLock(void);
extern void BTEnableDelayPowerReset(void);
extern void AutoClearCounterAfterAllLit(void);
#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