Commit 5b74da9c authored by 张金硕's avatar 张金硕

feat:优化OTA升级功能,增加蓝牙开关和获取电话本功能

parent d39519b3
......@@ -275,7 +275,7 @@
</OCR_RVCT3>
<OCR_RVCT4>
<Type>1</Type>
<StartAddress>0x0</StartAddress>
<StartAddress>0xc400</StartAddress>
<Size>0x73c00</Size>
</OCR_RVCT4>
<OCR_RVCT5>
......
......@@ -2,8 +2,8 @@
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************
LR_IROM1 0x00000000 0x00073C00 { ; load region size_region
ER_IROM1 0x00000000 0x00073C00 { ; load address = execution address
LR_IROM1 0x0000C400 0x00073C00 { ; load region size_region
ER_IROM1 0x0000C400 0x00073C00 { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
......
......@@ -20,7 +20,7 @@ User definitions
typedef unsigned short MD_STATUS;
#define HAS_BOOTLOADER (0u) // 仅仿真App时设置为0
#define HAS_BOOTLOADER (1u) // 仅仿真App时设置为0
#define APP_BASE (0x0000C400ul)
/* Status list definition */
......
#include "Components.h"
uint8_t OTA_Update_Count = 0;
const uint8_t HJBlueToothName[9]= {"HJ_750TFT"};
uint8_t OTA_Update_Count_Open = 0;
uint8_t OTA_Update_Count_Close = 0;
uint8_t Update_Graphic_Count = 0;
uint8_t GetBlueToothVaild = 0;
uint8_t GetPhoneBookVaild = 0;
const uint8_t HJBlueToothName[9]= {"HJ750"};
uint8_t UUIDConfigBuf[22] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00};
uint8_t sjhja[20] = {0};
uint8_t PhoneName[100] = {0};
uint8_t BlueConnectStatus;
ee_uint16_t juasfha;
void BlueToothService()
{
char i;
if(Get_Dis_Bluetooth_Open_Close() == 0)
{
if(GetBlueToothVaild == 0)
{
SetBluetoothTurnXX(1);
GetBlueToothVaild = 1;
}
}
else
{
if(GetBlueToothVaild == 1)
{
SetBluetoothTurnXX(0);
GetBlueToothVaild = 0;
}
}
if ((BlueToothPhoneData.BlueToothSignalSate == BlueTooth_Connection)&&(GetPhoneBookVaild == 0))
{
PackedTransfer_GetPhoneBookCmd();
GetPhoneBookVaild = 1;
}
else if (BlueToothPhoneData.BlueToothSignalSate == BlueTooth_DisConnect)
{
GetPhoneBookVaild = 0;
}
// SetBlueToothName((uint8_t *)HJBlueToothName, sizeof(HJBlueToothName));
// SetUUIDData((char *)UUIDConfigBuf, 22);
// BlueConnectStatus = GetBlueToothPowerSTATE();
// juasfha = BlueToothPhoneData.BlueToothPhoneSate;
// juasfha = BlueToothPhoneData.PhoneBookTotalCount;
// for(i=0;i<20;i++)
// {
// sjhja[i] = BlueToothPhoneData.PhoneNumber[i];
// }
// for(i=0;i<100;i++)
// {
// PhoneName[i] = BlueToothPhoneData.BlueToothPhoneName[i];
// }
SetBlueToothName((uint8_t *)HJBlueToothName, sizeof(HJBlueToothName));
SetUUIDData((char *)UUIDConfigBuf, 22);
// _QRCODE_RECT QRCode_Rect;
// QRCode_Rect.x = QRCode_X;
// QRCode_Rect.y = QRCode_Y;
......@@ -25,7 +77,9 @@ void UpdateGraphics(void)
PicObj.update_pic_id = Pic_0193;
PicObj.second_menu = 0;
PicObj.navigation_task_id = 0;
PackedTransfer_DisplayPhoneMirrorQRcode(0, PicObj);
}
void OTAUpdateService(void)
{
......@@ -36,15 +90,20 @@ void OTAUpdateService(void)
QRCode_Rect.width = 240;
if(OTA_Update_Flag == 1)
{
OTA_Update_Count++;
if(OTA_Update_Count < 5)
if(OTA_Update_Count_Open < 5)
{
SetUpdateCtrl(1,QRCode_Rect);
OTA_Update_Count_Open++;
}
OTA_Update_Count_Close = 0;
}
else
{
if(OTA_Update_Count_Close < 5)
{
SetUpdateCtrl(0,QRCode_Rect);
OTA_Update_Count=0;
OTA_Update_Count_Close++;
}
OTA_Update_Count_Open=0;
}
}
......@@ -52,7 +52,6 @@ void Sys_20ms_Tasks(void)
void Sys_50ms_Tasks(void)
{
// BlueToothService();
UpdateGraphics();
Telltales_Management();
g_u8Cursor_Posittion = Menu_Get_Current_Cursor_Information();
......@@ -77,6 +76,7 @@ uint32_t aaa = 0;
void Sys_100ms_Tasks(void)
{
BlueToothService();
S3_ServerCNTT();
Get_DisTime_Service();
Fuel_Cal_Sevice(100u);
......
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