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

Merge branch 'jinshuo' into 'dev'

Jinshuo

See merge request !60
parents 72efb25c a216be03
...@@ -979,9 +979,9 @@ ...@@ -979,9 +979,9 @@
<FilePath>..\..\..\..\Source\Component\AMT630H\PicBin.h</FilePath> <FilePath>..\..\..\..\Source\Component\AMT630H\PicBin.h</FilePath>
</File> </File>
<File> <File>
<FileName>kei_S1.0.4_20240818.lib</FileName> <FileName>kei_S1.0.5_20240822.lib</FileName>
<FileType>4</FileType> <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>
<File> <File>
<FileName>UartProtocol.h</FileName> <FileName>UartProtocol.h</FileName>
......
#include "Components.h" #include "Components.h"
uint8_t OTA_Update_Count_Open = 0;
uint8_t OTA_Update_Count = 0; uint8_t OTA_Update_Count_Close = 0;
const uint8_t HJBlueToothName[9]= {"HJ_750TFT"}; 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"};
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 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 TextService(void);
void BlueToothService() void BlueToothService()
{ {
// SetUUIDTimes++;
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;
}
if((BlueToothPhoneData.BlueToothPhoneSate == Phone_Outgoing) || (BlueToothPhoneData.BlueToothPhoneSate == Phone_Incoming) || (BlueToothPhoneData.BlueToothPhoneSate == Phone_Talking))
{
Menu_Change_Branch_To_Item(MENU_BRANCH_ANIMATION,MENU_ITEM_MAIN_ITEM);
}
TextService();
// 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 QRCode_Rect;
// QRCode_Rect.x = QRCode_X; // QRCode_Rect.x = QRCode_X;
// QRCode_Rect.y = QRCode_Y; // QRCode_Rect.y = QRCode_Y;
...@@ -17,38 +79,90 @@ void BlueToothService() ...@@ -17,38 +79,90 @@ void BlueToothService()
// SetScreenType(QRCode_TYPE, QRCode_Rect); // SetScreenType(QRCode_TYPE, QRCode_Rect);
} }
void UpdateGraphics(void) TEXT_STRUCT TextPara[TEXT_NUM_TOTAL] =
{ {
_PICID_Struct PicObj; {TEXT_NUM_BLUETOOTH_NAME, 0x4005, 0},
PicObj.qr_logo_id = 0; {TEXT_NUM_BLUETOOTH_PHONENAME, 0x4007, 0},
PicObj.main_pic_id = Pic_0382; {TEXT_NUM_PHONE_NUMBER, 0x4009, 0},
PicObj.qr_pic_id = Pic_0316; {TEXT_NUM_PHONE_NUMBER_TOTAL, 0x4011, 0},
PicObj.update_pic_id = Pic_0193; {TEXT_NUM_INFORMATION_MCUVER, 0x4012, 0},
PicObj.second_menu = 0; {TEXT_NUM_INFORMATION_SWVERSION, 0x4013, 0},
PicObj.navigation_task_id = 0; {TEXT_NUM_INFORMATION_HW, 0x4014, 0}, //23F 23E
if(OTA_Update_Flag == 1) {TEXT_NUM_INFORMATION_OS, 0x4015, 0},
{TEXT_NUM_INFORMATION_HMI, 0x4016, 0},
{TEXT_NUM_ROAD_NAME, 0x4022, 0},
};
uint8_t PhoneNumber[40];
uint8_t LastPhoneNumber[20];
uint8_t LastBlueToothPhoneName[100];
uint8_t CurBlueToothPhoneName[100];
void TextService(void)
{
if(TextInit == 0)
{
TextInit = 1;
memset(PhoneNumber, 0, sizeof(PhoneNumber));
memset(LastPhoneNumber, 0, sizeof(LastPhoneNumber));
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)) {
if ((memcmp(LastBlueToothPhoneName, BlueToothPhoneData.BlueToothPhoneName, sizeof(LastBlueToothPhoneName))) != 0)
{
for (uint8_t i = 0; i < (sizeof(BlueToothPhoneData.BlueToothPhoneName) / 2); i++)
{
CurBlueToothPhoneName[i * 2] = BlueToothPhoneData.BlueToothPhoneName[(i * 2) + 1];
CurBlueToothPhoneName[(i * 2) + 1] = BlueToothPhoneData.BlueToothPhoneName[i * 2];
}
memcpy(LastBlueToothPhoneName, BlueToothPhoneData.BlueToothPhoneName, (sizeof(BlueToothPhoneData.BlueToothPhoneName) / sizeof(BlueToothPhoneData.BlueToothPhoneName[0])));
TextPara[TEXT_NUM_BLUETOOTH_PHONENAME].Vaild = 0X01;
}
if ((memcmp(LastPhoneNumber, BlueToothPhoneData.PhoneNumber, sizeof(LastPhoneNumber))) != 0)
{
for (uint8_t i = 0; i < sizeof(BlueToothPhoneData.PhoneNumber); i++)
{ {
PackedTransfer_DisplayPhoneMirrorQRcode(0, PicObj); PhoneNumber[i * 2] = (uint8_t)(BlueToothPhoneData.PhoneNumber[i]);
PhoneNumber[(i * 2) + 1] = 0X00;
}
memcpy(LastPhoneNumber, BlueToothPhoneData.PhoneNumber, (sizeof(BlueToothPhoneData.PhoneNumber) / sizeof(BlueToothPhoneData.PhoneNumber[0])));
TextPara[TEXT_NUM_PHONE_NUMBER].Vaild = 0X01;
}
}
} }
} }
void OTAUpdateService(void) void OTAUpdateService(void)
{ {
_QRCODE_RECT QRCode_Rect; QRCode_Rect.x = 178;
QRCode_Rect.x = 457; QRCode_Rect.y = 130;
QRCode_Rect.y = 137;
QRCode_Rect.height = 240; QRCode_Rect.height = 240;
QRCode_Rect.width = 240; QRCode_Rect.width = 240;
SetScreenType(QRCode_TYPE, QRCode_Rect);
if(Menu_Get_Current_Cursor_Information() != MENU_ITEM_FAULT_INFORMATION)
{
OTA_Update_Flag = 0;
}
if(OTA_Update_Flag == 1) if(OTA_Update_Flag == 1)
{ {
OTA_Update_Count++; if(OTA_Update_Count_Open < 5)
if(OTA_Update_Count < 5)
{ {
SetUpdateCtrl(1,QRCode_Rect); SetUpdateCtrl(1,QRCode_Rect);
OTA_Update_Count_Open++;
} }
OTA_Update_Count_Close = 0;
} }
else else
{
if(OTA_Update_Count_Close < 5)
{ {
SetUpdateCtrl(0,QRCode_Rect); SetUpdateCtrl(0,QRCode_Rect);
OTA_Update_Count=0; OTA_Update_Count_Close++;
}
OTA_Update_Count_Open=0;
} }
} }
#ifndef _BLUETOOTH_H #ifndef _BLUETOOTH_H
#define _BLUETOOTH_H #define _BLUETOOTH_H
typedef enum {
TEXT_NUM_BLUETOOTH_NAME,
TEXT_NUM_BLUETOOTH_PHONENAME,
TEXT_NUM_PHONE_NUMBER,
TEXT_NUM_PHONE_NUMBER_TOTAL,
TEXT_NUM_INFORMATION_MCUVER,
TEXT_NUM_INFORMATION_SWVERSION,
TEXT_NUM_INFORMATION_HW,
TEXT_NUM_INFORMATION_OS,
TEXT_NUM_INFORMATION_HMI,
TEXT_NUM_ROAD_NAME,
TEXT_NUM_TOTAL,
} TEXT_NUM_ENUM;
typedef struct {
TEXT_NUM_ENUM TextNum;
uint16_t LableNum;
uint16_t Vaild;
}TEXT_STRUCT;
/*QRCode X Y height Width*/ /*QRCode X Y height Width*/
#define QRCode_X 457 #define QRCode_X 457
#define QRCode_Y 134 #define QRCode_Y 134
...@@ -11,6 +33,7 @@ ...@@ -11,6 +33,7 @@
extern void BlueToothService(void); extern void BlueToothService(void);
extern void OTAUpdateService(void); extern void OTAUpdateService(void);
void UpdateGraphics(void); extern void OTAUpdateInit(void);
extern _PICID_Struct PicObj;
#endif #endif
\ No newline at end of file
...@@ -4252,8 +4252,16 @@ void AMT630H_GUI_ReadPosittion_Display(void) ...@@ -4252,8 +4252,16 @@ void AMT630H_GUI_ReadPosittion_Display(void)
} }
else else
{ {
SetPagePic(GRAPHICS_PAGE_0, Pic_0653_54_499); PicObj.qr_logo_id = 0;
PicObj.main_pic_id = Pic_0382;
PicObj.qr_pic_id = Pic_0316;
PicObj.update_pic_id = Pic_0233;
PicObj.second_menu = 0;
PicObj.navigation_task_id = 0;
SetPagePic(GRAPHICS_PAGE_0, Pic_0233_605_289);
SetPagePic(GRAPHICS_PAGE_0, Pic_0193_0_0); SetPagePic(GRAPHICS_PAGE_0, Pic_0193_0_0);
SetPagePic(GRAPHICS_PAGE_0, Pic_0477_178_130);
PackedTransfer_DisplayPhoneMirrorQRcode(0, PicObj);
} }
break; break;
case MENU_ITEM_PHONE_CONNECT: /*28 手机互联*/ case MENU_ITEM_PHONE_CONNECT: /*28 手机互联*/
......
...@@ -18,7 +18,7 @@ uint8_t *GetUartRecvData(uint32_t *UartRecvBufLen, uint32_t *UartRecvPos) ...@@ -18,7 +18,7 @@ uint8_t *GetUartRecvData(uint32_t *UartRecvBufLen, uint32_t *UartRecvPos)
void UartSendData(uint8_t *data, uint32_t len) 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) void DisplayNum(uint8_t page, DISPLAY_NUM_ST *pNumData, int32_t NumVal)
......
...@@ -247,6 +247,10 @@ void Key_Event_Short_Press_Left(void)//选择 ...@@ -247,6 +247,10 @@ void Key_Event_Short_Press_Left(void)//选择
Menu_Service(MENU_KEY_DOWN_SHORT); Menu_Service(MENU_KEY_DOWN_SHORT);
} }
} }
if ((BlueToothPhoneData.BlueToothPhoneSate == Phone_Outgoing) || (BlueToothPhoneData.BlueToothPhoneSate == Phone_Incoming) || (BlueToothPhoneData.BlueToothPhoneSate == Phone_Talking))
{
PackedTransfer_BlueTooth_DataSet(Phone_Pick_Up);
}
} }
void Key_Event_Short_Press_Right(void)//确认 void Key_Event_Short_Press_Right(void)//确认
...@@ -291,6 +295,10 @@ void Key_Event_Short_Press_Right(void)//确认 ...@@ -291,6 +295,10 @@ void Key_Event_Short_Press_Right(void)//确认
{ {
Menu_Service(MENU_KEY_CONFIRM_SHORT); Menu_Service(MENU_KEY_CONFIRM_SHORT);
} }
if ((BlueToothPhoneData.BlueToothPhoneSate == Phone_Outgoing) || (BlueToothPhoneData.BlueToothPhoneSate == Phone_Incoming) || (BlueToothPhoneData.BlueToothPhoneSate == Phone_Talking))
{
PackedTransfer_BlueTooth_DataSet(Phone_Hangup_Out);
}
} }
uint8_t OTA_Update_Flag = 0; uint8_t OTA_Update_Flag = 0;
......
...@@ -280,6 +280,42 @@ uint8_t UART_Ch3_Get_TX_Busy_Flag(void) ...@@ -280,6 +280,42 @@ uint8_t UART_Ch3_Get_TX_Busy_Flag(void)
// } // }
return u8Status; 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:要发送数据的指针, Data:要发送数据的指针,
请确认是全局变量的指针,且指向的数据在发送完成之前不会被改变。 请确认是全局变量的指针,且指向的数据在发送完成之前不会被改变。
...@@ -463,6 +499,7 @@ void UART_CH2_TX_ISR(void) ...@@ -463,6 +499,7 @@ void UART_CH2_TX_ISR(void)
stUARTCh2Cfg.pfnUARTConfirmCallBack( ); stUARTCh2Cfg.pfnUARTConfirmCallBack( );
} }
} }
mwAmt630hUartSendIsr();
} }
void UART_CH3_TX_ISR(void) void UART_CH3_TX_ISR(void)
{ {
......
...@@ -57,5 +57,7 @@ void UART_Ch2_Send_Multiple_Byte(uint8_t *Data, uint8_t Len); ...@@ -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 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 RTE_UART_Sleep_Init(UART_Channel_en_t enUARTCh);
extern void mwAmt630hUartSendData(uint8_t *data, uint32_t length);
extern void mwAmt630hUartSendIsr(void);
#endif #endif
...@@ -20,7 +20,7 @@ void Sys_2ms_Tasks(void) ...@@ -20,7 +20,7 @@ void Sys_2ms_Tasks(void)
Sys_Status_Update_Service(); Sys_Status_Update_Service();
Analog_Signal_Conv_Service(); Analog_Signal_Conv_Service();
AMT630H_Main(); AMT630H_Main();
/* Check_MCU_Info_in_630H(); */ Check_MCU_Info_in_630H();
DoCAN_Timer_Update(2000u); DoCAN_Timer_Update(2000u);
//Can_Write_Fun(&CAN_CH0_CanMsgTxOp, 2000u);无外发 //Can_Write_Fun(&CAN_CH0_CanMsgTxOp, 2000u);无外发
CanMSg_XMS_Analysis(&CAN_CH0_CanMsgOp, 2u); CanMSg_XMS_Analysis(&CAN_CH0_CanMsgOp, 2u);
...@@ -52,9 +52,7 @@ void Sys_20ms_Tasks(void) ...@@ -52,9 +52,7 @@ void Sys_20ms_Tasks(void)
void Sys_50ms_Tasks(void) void Sys_50ms_Tasks(void)
{ {
// BlueToothService();
BackLight_Service(); BackLight_Service();
UpdateGraphics();
Telltales_Management(); Telltales_Management();
g_u8Cursor_Posittion = Menu_Get_Current_Cursor_Information(); g_u8Cursor_Posittion = Menu_Get_Current_Cursor_Information();
...@@ -78,6 +76,7 @@ uint32_t aaa = 0; ...@@ -78,6 +76,7 @@ uint32_t aaa = 0;
void Sys_100ms_Tasks(void) void Sys_100ms_Tasks(void)
{ {
BlueToothService();
S3_ServerCNTT(); S3_ServerCNTT();
Get_DisTime_Service(); Get_DisTime_Service();
Fuel_Cal_Sevice(100u); 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