Commit 3cbed2be authored by 张金硕's avatar 张金硕

feat:新增刷OTA升级的二维码功能

parent a01e62b2
......@@ -979,9 +979,9 @@
<FilePath>..\..\..\..\Source\Component\AMT630H\PicBin.h</FilePath>
</File>
<File>
<FileName>kei_S1.0.4_20240818.lib</FileName>
<FileName>kei_S1.0.5_20240822.lib</FileName>
<FileType>4</FileType>
<FilePath>..\..\..\..\Source\Component\AMT630H\kei_S1.0.4_20240818.lib</FilePath>
<FilePath>..\..\..\..\Source\Component\AMT630H\kei_S1.0.5_20240822.lib</FilePath>
</File>
<File>
<FileName>UartProtocol.h</FileName>
......
......@@ -6,6 +6,7 @@ uint8_t Update_Graphic_Count = 0;
uint8_t GetBlueToothVaild = 0;
uint8_t GetPhoneBookVaild = 0;
uint8_t TextInit = 0;
uint8_t SetUUIDTimes = 0;
_PICID_Struct PicObj;
_QRCODE_RECT QRCode_Rect;
const uint8_t HJBlueToothName[9]= {"HJ750"};
......@@ -20,6 +21,7 @@ void TextService(void);
void BlueToothService()
{
// SetUUIDTimes++;
if(Get_Dis_Bluetooth_Open_Close() == 0)
{
if(GetBlueToothVaild == 0)
......@@ -107,8 +109,6 @@ void TextService(void)
memset(LastBlueToothPhoneName, 0, sizeof(LastBlueToothPhoneName));
memset(CurBlueToothPhoneName, 0, sizeof(CurBlueToothPhoneName));
}
if (BlueToothPhoneData.BlueToothSignalSate == BlueTooth_Connection)
{
if ((BlueToothPhoneData.BlueToothPhoneSate == Phone_Outgoing) || (BlueToothPhoneData.BlueToothPhoneSate == Phone_Incoming) || (BlueToothPhoneData.BlueToothPhoneSate == Phone_Talking)) {
......@@ -136,25 +136,13 @@ void TextService(void)
}
}
void UpdateGraphics(void)
{
PicObj.qr_logo_id = 0;
PicObj.main_pic_id = Pic_0382;
PicObj.qr_pic_id = Pic_0316;
PicObj.update_pic_id = Pic_0193;
PicObj.second_menu = 0;
PicObj.navigation_task_id = 0;
if(OTA_Update_Flag == 1)
{
PackedTransfer_DisplayPhoneMirrorQRcode(0, PicObj);
}
}
void OTAUpdateService(void)
{
QRCode_Rect.x = 457;
QRCode_Rect.y = 137;
QRCode_Rect.x = 178;
QRCode_Rect.y = 130;
QRCode_Rect.height = 240;
QRCode_Rect.width = 240;
SetScreenType(QRCode_TYPE, QRCode_Rect);
if(Menu_Get_Current_Cursor_Information() != MENU_ITEM_FAULT_INFORMATION)
{
OTA_Update_Flag = 0;
......
......@@ -33,6 +33,7 @@ typedef struct {
extern void BlueToothService(void);
extern void OTAUpdateService(void);
void UpdateGraphics(void);
extern void OTAUpdateInit(void);
extern _PICID_Struct PicObj;
#endif
\ No newline at end of file
......@@ -4252,8 +4252,10 @@ void AMT630H_GUI_ReadPosittion_Display(void)
}
else
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0653_54_499);
SetPagePic(GRAPHICS_PAGE_0, Pic_0193_0_0);
SetPagePic(GRAPHICS_PAGE_0, Pic_0002_0_0);
SetPagePic(GRAPHICS_PAGE_0, Pic_0477_178_130);
SetPagePic(GRAPHICS_PAGE_0, Pic_0233_605_289);
PackedTransfer_DisplayPhoneMirrorQRcode(0, PicObj);
}
break;
case MENU_ITEM_PHONE_CONNECT: /*28 手机互联*/
......
......@@ -18,7 +18,7 @@ uint8_t *GetUartRecvData(uint32_t *UartRecvBufLen, uint32_t *UartRecvPos)
void UartSendData(uint8_t *data, uint32_t len)
{
UART_Ch2_Send_Multiple_Byte(data, len);
mwAmt630hUartSendData(data, len);
}
void DisplayNum(uint8_t page, DISPLAY_NUM_ST *pNumData, int32_t NumVal)
......
......@@ -280,6 +280,42 @@ uint8_t UART_Ch3_Get_TX_Busy_Flag(void)
// }
return u8Status;
}
/* 一部代买码,暂时未使用,纯借鉴 */
#define MAX_SERIAL_BUFF_SIZE 4096
uint8_t mwAmt630hSerialSendBuffer[MAX_SERIAL_BUFF_SIZE] = {0};
uint16_t mwAmt630hSerialDataIndex = 0;
uint16_t mwAmt630hSerialSendCnts = 0;
uint16_t mwAmt630hSerialSendFillCnts = 0;
uint8_t mwAmt630hSerialSendValid = 0;
void mwAmt630hUartSendData(uint8_t *data, uint32_t length)
{
uint16_t StartIndex = mwAmt630hSerialDataIndex;
for (uint16_t i = 0; i < length; i++) {
mwAmt630hSerialSendBuffer[mwAmt630hSerialDataIndex++] = data[i];
if (mwAmt630hSerialDataIndex >= MAX_SERIAL_BUFF_SIZE) {
mwAmt630hSerialDataIndex = 0;
}
}
mwAmt630hSerialSendFillCnts += length;
if (mwAmt630hSerialSendValid == 0) {
UART_Ch2_Send_Multiple_Byte(&mwAmt630hSerialSendBuffer[StartIndex] ,sizeof(mwAmt630hSerialSendBuffer[StartIndex]));
mwAmt630hSerialSendCnts = StartIndex + 1;
mwAmt630hSerialSendValid = 1;
}
}
void mwAmt630hUartSendIsr(void)
{
if (mwAmt630hSerialSendFillCnts > 0) {
mwAmt630hSerialSendFillCnts --;
UART_Ch2_Send_Multiple_Byte(&mwAmt630hSerialSendBuffer[mwAmt630hSerialSendCnts ++],sizeof(mwAmt630hSerialSendBuffer[mwAmt630hSerialSendCnts]));
if (mwAmt630hSerialSendCnts == MAX_SERIAL_BUFF_SIZE) {
mwAmt630hSerialSendCnts = 0;
}
} else {
mwAmt630hSerialSendValid = 0;
}
}
/*
Data:要发送数据的指针,
请确认是全局变量的指针,且指向的数据在发送完成之前不会被改变。
......@@ -463,6 +499,7 @@ void UART_CH2_TX_ISR(void)
stUARTCh2Cfg.pfnUARTConfirmCallBack( );
}
}
mwAmt630hUartSendIsr();
}
void UART_CH3_TX_ISR(void)
{
......
......@@ -57,5 +57,7 @@ void UART_Ch2_Send_Multiple_Byte(uint8_t *Data, uint8_t Len);
extern uint32_t RTE_UART_Init(UART_Channel_en_t enUARTCh, UART_Channel_Config_st_t *penUARTCfg);
/*休眠时调用*/
extern void RTE_UART_Sleep_Init(UART_Channel_en_t enUARTCh);
extern void mwAmt630hUartSendData(uint8_t *data, uint32_t length);
extern void mwAmt630hUartSendIsr(void);
#endif
......@@ -52,9 +52,7 @@ void Sys_20ms_Tasks(void)
void Sys_50ms_Tasks(void)
{
// BlueToothService();
BackLight_Service();
UpdateGraphics();
Telltales_Management();
g_u8Cursor_Posittion = Menu_Get_Current_Cursor_Information();
......
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