Commit 3d7cd5af authored by 王金亮's avatar 王金亮

Merge branch 'dev' of http://tyw-server.synology.me:12345/shihao/haojin750tft into wjl_devlop

parents 56a29bb0 04acf3aa
......@@ -13,6 +13,7 @@ _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};
//"600032023120100000995"
uint8_t SetBluetoothCloseCount = 0;
uint8_t OSVersionASCLLList[20] =
{
0x56,0x00,
......@@ -47,98 +48,105 @@ void TextService(void);
void BlueToothService(void)
{
// SetUUIDTimes++;
if(Get_Dis_Bluetooth_Open_Close() == 0)
if(SYS_OPR_STAT_IGN_ON)
{
if(GetBlueToothVaild == 0)
if(Get_Dis_Bluetooth_Open_Close() == 0)
{
SetBluetoothTurnXX(1);
GetBlueToothVaild = 1;
if(GetBlueToothVaild == 0)
{
SetBluetoothTurnXX(1);
GetBlueToothVaild = 1;
}
}
}
else
{
if(GetBlueToothVaild == 1)
else
{
SetBluetoothTurnXX(0);
GetBlueToothVaild = 0;
if(GetBlueToothVaild == 1)
{
if(SetBluetoothCloseCount < 30)
{
SetBluetoothTurnXX(0);
}
else
{
GetBlueToothVaild = 0;
SetBluetoothCloseCount = 0;
}
SetBluetoothCloseCount++;
}
}
}
if ((BlueToothPhoneData.BlueToothSignalSate == BlueTooth_Connection)&&(GetPhoneBookVaild == 0))
{
PackedTransfer_GetPhoneBookCmd();
GetPhoneBookVaild = 1;
}
else if (BlueToothPhoneData.BlueToothSignalSate == BlueTooth_DisConnect)
{
GetPhoneBookVaild = 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);
}
SetUUIDData((char *)UUIDConfigBuf, 22);
if (OTA_Update_Flag == 1)
{
QRCode_Rect.x = 650;
QRCode_Rect.y = 210;
}
else
{
QRCode_Rect.x = QRCode_X;
QRCode_Rect.y = QRCode_Y;
}
// QRCode_Rect.x = 650;
// QRCode_Rect.y = 210;
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;
}
if(OTA_Update_Flag == 1)
{
if(OTA_Update_Count_Open < 5)
if((BlueToothPhoneData.BlueToothPhoneSate == Phone_Outgoing) || (BlueToothPhoneData.BlueToothPhoneSate == Phone_Incoming) || (BlueToothPhoneData.BlueToothPhoneSate == Phone_Talking))
{
SetUpdateCtrl(1,QRCode_Rect);
OTA_Update_Count_Open++;
}
OTA_Update_Count_Close = 0;
}
if(g_u8Cursor_Posittion == MENU_ITEM_PHONE_CONNECT_APP)/*导航界面*/
{
;
}
else/*非导航界面*/
{
Menu_Change_Branch_To_Item(MENU_BRANCH_ANIMATION,MENU_ITEM_MAIN_ITEM);
}
}
SetUUIDData((char *)UUIDConfigBuf, 22);
if (OTA_Update_Flag == 1)
{
QRCode_Rect.x = 650;
QRCode_Rect.y = 210;
}
else
{
QRCode_Rect.x = QRCode_X;
QRCode_Rect.y = QRCode_Y;
}
// QRCode_Rect.x = 650;
// QRCode_Rect.y = 210;
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;
// }
if(OTA_Update_Flag == 1)
{
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_Close++;
}
OTA_Update_Count_Open=0;
}
SetTaskbarHeight(150);
SetBlueToothName((uint8_t *)HJBlueToothName, sizeof(HJBlueToothName));
TextService();
}
else
{
if(OTA_Update_Count_Close < 5)
{
SetUpdateCtrl(0,QRCode_Rect);
OTA_Update_Count_Close++;
}
OTA_Update_Count_Open=0;
GetBlueToothVaild =0;
OTA_Update_Flag = 0;
SetBluetoothTurnXX(0);
SetUpdateCtrl(0,QRCode_Rect);
}
SetTaskbarHeight(150);
SetBlueToothName((uint8_t *)HJBlueToothName, sizeof(HJBlueToothName));
TextService();
// 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];
// }
// _QRCODE_RECT QRCode_Rect;
// QRCode_Rect.x = QRCode_X;
// QRCode_Rect.y = QRCode_Y;
// QRCode_Rect.height = QRCode_HEIGHT;
// QRCode_Rect.width = QRCode_WIDTH;
// SetScreenType(QRCode_TYPE, QRCode_Rect);
}
TEXT_STRUCT TextPara[TEXT_NUM_TOTAL] =
......
......@@ -45,7 +45,7 @@ const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] =
{0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
{0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
{0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
5000ul,
1000ul,
0x402ul,
(( void * )0),
(( void * )0),
......
......@@ -35,13 +35,13 @@ void AMT630H_GUI_Language_Information(void);
void AMT630H_GUI_Unit_Information(void);
void AMT630H_GUI_Display_Mode_Information(void);
void AMT630H_GUI_Backlight_Information(void);
void AMT630H_GUI_Bluetooth_Information(uint8_t sync_contacts, uint8_t Connect_ON);
void AMT630H_GUI_Bluetooth_Information(uint8_t Connect_ON);
void AMT630H_GUI_Clock_Information(uint8_t Clock_Hour, uint8_t Clock_Min);
// 二级菜单
static void AMT630H_GUI_Clock_Setting(uint8_t Clock_Hour, uint8_t Clock_Min, uint8_t Clock_BIT); /*时钟设置*/
void AMT630H_GUI_Backlight_Setting(Menu_Item_en_t back_mode); /*背光设置*/
void AMT630H_GUI_Display_Mode_Setting(Menu_Item_en_t display_mode); /*显示模式*/
void AMT630H_GUI_Bluetooth_Connect_Setting(uint8_t select, uint8_t sync_contacts, uint8_t Connect_ON); /*蓝牙连接*/
void AMT630H_GUI_Bluetooth_Connect_Setting(uint8_t select, uint8_t Connect_ON); /*蓝牙连接*/
void AMT630H_GUI_Unit_Setting(Menu_Interface_en_t select); /*单位设置*/
void AMT630H_GUI_Language_Setting(Menu_Interface_en_t select); /*语言设置*/
void AMT630H_GUI_Phone_Connect_Win(void); /*手机互联*/
......@@ -50,6 +50,10 @@ void AMT630H_GUI_ReadPosittion_Display(void);
static void AMT630H_GUI_PhoneConnect_Light();
static void AMT630H_GUI_PhoneConnect_TIME(uint16_t Hour ,uint16_t Minute);
static void AMT630H_GUI_PhoneConnect_VSpeed(uint16_t VechileSpeed);
static void AMT630H_GUI_PhoneConnect_ESpeed(uint16_t ESpeed);
static void AMT630H_GUI_PhoneConnect_Fuel(uint8_t Fuel);
static void AMT630H_GUI_PhoneConnect_Telephone();
static void AMT630H_GUI_PhoneConnect_Voltage(uint16_t Voltage);
void AMT630H_GUI_Background()
......@@ -89,9 +93,9 @@ void AMT630H_GUI_Fault_Information(void)
SetPagePic(GRAPHICS_PAGE_0, Pic_0155_737_485);
SetPagePic(GRAPHICS_PAGE_0, Pic_0166_445_517);
SetPagePic(GRAPHICS_PAGE_0, Pic_0091_567_356);
//SetPagePic(GRAPHICS_PAGE_0, Pic_0091_567_356);20231201.1.G
SetPagePic(GRAPHICS_PAGE_0, Pic_0167_341_354);
SetPagePic(GRAPHICS_PAGE_0, Pic_0093_574_292);
//SetPagePic(GRAPHICS_PAGE_0, Pic_0093_574_292);20231201HJ
SetPagePic(GRAPHICS_PAGE_0, Pic_0168_350_290);
SetPagePic(GRAPHICS_PAGE_0, Pic_0169_353_227);/*历史故障*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0170_354_162);/*当前故障*/
......@@ -105,15 +109,22 @@ void AMT630H_GUI_Fault_Information(void)
SetPagePic(GRAPHICS_PAGE_0, Pic_0086_762_487);
SetPagePic(GRAPHICS_PAGE_0, Pic_0090_435_519);
SetPagePic(GRAPHICS_PAGE_0, Pic_0091_567_356);
//SetPagePic(GRAPHICS_PAGE_0, Pic_0091_567_356);20231201.1.G
SetPagePic(GRAPHICS_PAGE_0, Pic_0092_368_356);
SetPagePic(GRAPHICS_PAGE_0, Pic_0093_574_292);
//SetPagePic(GRAPHICS_PAGE_0, Pic_0093_574_292);20231201HJ
SetPagePic(GRAPHICS_PAGE_0, Pic_0094_375_292);
SetPagePic(GRAPHICS_PAGE_0, Pic_0096_338_228);/*Fault history*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0097_334_163);/*current fault*/
AMT630H_GUI_FaultCode(Get_FaultCode_Lost(),Get_FaultCode_Valid(),Get_Current_Hight_FaultCode(),Get_Current_Mid_FaultCode());
}
/*蓝牙名称改为字库显示*/
/* RGB 0 0 0 --- 黑*/
/* RGB 0XFF 0XFF 0XFF --- 白*/
PackedTransfer_LabelsList( 0x8022,(uint8_t *)InformationOSVersion, 20);
SetPageText(GRAPHICS_PAGE_0, 0x8022, 574 , 292 , 400, ALIGN_LEFT, 0, TEXT_COLOR(0,0,0,0XFF),TEXT_LINE_OFFSET(1,1));
PackedTransfer_LabelsList( 0x9022,(uint8_t *)InformationMCUVersion, 26);
SetPageText(GRAPHICS_PAGE_0, 0x9022, 567 , 356 , 200, ALIGN_LEFT, 0, TEXT_COLOR(0,0,0,0XFF),TEXT_LINE_OFFSET(1,1));
}
else if(g_u8Display_Mode == ModeNIGHT)
{
......@@ -125,9 +136,9 @@ void AMT630H_GUI_Fault_Information(void)
SetPagePic(GRAPHICS_PAGE_0, Pic_0342_737_485);
SetPagePic(GRAPHICS_PAGE_0, Pic_0353_445_517);
SetPagePic(GRAPHICS_PAGE_0, Pic_0279_567_356);
//SetPagePic(GRAPHICS_PAGE_0, Pic_0279_567_356);20231201.1.G
SetPagePic(GRAPHICS_PAGE_0, Pic_0354_341_354);
SetPagePic(GRAPHICS_PAGE_0, Pic_0281_574_292);
//SetPagePic(GRAPHICS_PAGE_0, Pic_0281_574_292);20231201HJ
SetPagePic(GRAPHICS_PAGE_0, Pic_0355_350_290);
SetPagePic(GRAPHICS_PAGE_0, Pic_0356_353_227);/*历史故障*/
......@@ -142,16 +153,24 @@ void AMT630H_GUI_Fault_Information(void)
SetPagePic(GRAPHICS_PAGE_0, Pic_0277_728_486);
SetPagePic(GRAPHICS_PAGE_0, Pic_0278_435_519);
SetPagePic(GRAPHICS_PAGE_0, Pic_0279_567_356);
//SetPagePic(GRAPHICS_PAGE_0, Pic_0279_567_356);20231201.1.G
SetPagePic(GRAPHICS_PAGE_0, Pic_0280_368_356);
SetPagePic(GRAPHICS_PAGE_0, Pic_0281_574_292);
//SetPagePic(GRAPHICS_PAGE_0, Pic_0281_574_292);20231201HJ
SetPagePic(GRAPHICS_PAGE_0, Pic_0282_375_292);
SetPagePic(GRAPHICS_PAGE_0, Pic_0284_338_228);
SetPagePic(GRAPHICS_PAGE_0, Pic_0285_334_163);/*current fault*/
AMT630H_GUI_FaultCode(Get_FaultCode_Lost(),Get_FaultCode_Valid(),Get_Current_Hight_FaultCode(),Get_Current_Mid_FaultCode());
}
/*蓝牙名称改为字库显示*/
/* RGB 0 0 0 --- 黑*/
/* RGB 0XFF 0XFF 0XFF --- 白*/
PackedTransfer_LabelsList( 0x8022,(uint8_t *)InformationOSVersion, 20);
SetPageText(GRAPHICS_PAGE_0, 0x8022, 574 , 292 , 400, ALIGN_LEFT, 0, TEXT_COLOR(0XFF,0XFF,0XFF,0XFF),TEXT_LINE_OFFSET(1,1));
PackedTransfer_LabelsList( 0x9022,(uint8_t *)InformationMCUVersion, 26);
SetPageText(GRAPHICS_PAGE_0, 0x9022, 567 , 356 , 200, ALIGN_LEFT, 0, TEXT_COLOR(0XFF,0XFF,0XFF,0XFF),TEXT_LINE_OFFSET(1,1));
}
}
......@@ -232,7 +251,7 @@ static void AMT630H_GUI_FaultCode(uint8_t FaultCodeLost,uint8_t FaultCodevalid,u
DisplayNumPara.y = 229;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 2;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, frontnumber);
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, midnumber);
}
else if(g_u8Display_Mode == ModeNIGHT)
{
......@@ -649,8 +668,10 @@ static uint16_t Bluetooth_num_night[] = {
* @param[in] sync_contacts 同步联系人
* @param[in] Connect_ON 0 关 1 开
*/
void AMT630H_GUI_Bluetooth_Information(uint8_t sync_contacts, uint8_t Connect_ON)
void AMT630H_GUI_Bluetooth_Information( uint8_t Connect_ON)
{
uint8_t Contect_totalnumber;
Contect_totalnumber = 0;
if(g_u8Display_Mode == ModeDAY)
{
if(g_u8Language == CH)
......@@ -660,7 +681,7 @@ void AMT630H_GUI_Bluetooth_Information(uint8_t sync_contacts, uint8_t Connect_ON
SetPagePic(GRAPHICS_PAGE_0, Pic_0136_489_345);
SetPagePic(GRAPHICS_PAGE_0, Pic_0139_369_287);
SetPagePic(GRAPHICS_PAGE_0, Pic_0142_367_226);
SetPagePic(GRAPHICS_PAGE_0, Pic_0055_570_165);
//SetPagePic(GRAPHICS_PAGE_0, Pic_0055_570_165);//HJ3EA0
SetPagePic(GRAPHICS_PAGE_0, Pic_0143_367_163);
if (Connect_ON == 0)
......@@ -671,31 +692,6 @@ void AMT630H_GUI_Bluetooth_Information(uint8_t sync_contacts, uint8_t Connect_ON
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0141_584_226);
}
DISPLAY_NUM_ST DisplayNumPara;
uint8_t sync_contactsNumber;
sync_contactsNumber = sync_contacts;
if (sync_contacts < 10)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0038_590_287);
DisplayNumPara.NumList = Bluetooth_num_day;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 14;
DisplayNumPara.x = 604;
DisplayNumPara.y = GROUP_PIC_USE_PSD_Y_POS;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 1;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, sync_contactsNumber);
}
else
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0039_583_287);
DisplayNumPara.NumList = Bluetooth_num_day;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 14;
DisplayNumPara.x = 612;
DisplayNumPara.y = GROUP_PIC_USE_PSD_Y_POS;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 2;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, sync_contactsNumber);
}
}
else if(g_u8Language == EN)
{
......@@ -704,7 +700,7 @@ void AMT630H_GUI_Bluetooth_Information(uint8_t sync_contacts, uint8_t Connect_ON
SetPagePic(GRAPHICS_PAGE_0, Pic_0019_478_348);
SetPagePic(GRAPHICS_PAGE_0, Pic_0037_376_289);
SetPagePic(GRAPHICS_PAGE_0, Pic_0054_377_227);
SetPagePic(GRAPHICS_PAGE_0, Pic_0055_570_165);
//SetPagePic(GRAPHICS_PAGE_0, Pic_0055_570_165);//HJ3EA0
SetPagePic(GRAPHICS_PAGE_0, Pic_0056_377_166);
if (Connect_ON == 0)
{
......@@ -714,32 +710,12 @@ void AMT630H_GUI_Bluetooth_Information(uint8_t sync_contacts, uint8_t Connect_ON
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0052_574_226);
}
DISPLAY_NUM_ST DisplayNumPara;
uint8_t sync_contactsNumber;
sync_contactsNumber = sync_contacts;
if (sync_contacts < 10)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0038_590_287);
DisplayNumPara.NumList = Bluetooth_num_day;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 14;
DisplayNumPara.x = 604;
DisplayNumPara.y = GROUP_PIC_USE_PSD_Y_POS;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 1;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, sync_contactsNumber);
}
else
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0039_583_287);
DisplayNumPara.NumList = Bluetooth_num_day;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 14;
DisplayNumPara.x = 612;
DisplayNumPara.y = GROUP_PIC_USE_PSD_Y_POS;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 2;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, sync_contactsNumber);
}
}
/*蓝牙名称改为字库显示*/
/* RGB 0 0 0 --- 黑*/
/* RGB 0XFF 0XFF 0XFF --- 白*/
PackedTransfer_LabelsList( 0x5022,(uint8_t *)BlueToothName, 40);
SetPageText(GRAPHICS_PAGE_0, 0x5022, 570 , 165 , 200, ALIGN_LEFT, 0, TEXT_COLOR(0,0,0,0XFF),TEXT_LINE_OFFSET(1,1));
}
else if(g_u8Display_Mode == ModeNIGHT)
{
......@@ -750,7 +726,7 @@ void AMT630H_GUI_Bluetooth_Information(uint8_t sync_contacts, uint8_t Connect_ON
SetPagePic(GRAPHICS_PAGE_0, Pic_0324_489_345);
SetPagePic(GRAPHICS_PAGE_0, Pic_0326_369_287);
SetPagePic(GRAPHICS_PAGE_0, Pic_0329_367_226);
SetPagePic(GRAPHICS_PAGE_0, Pic_0241_570_165);
//SetPagePic(GRAPHICS_PAGE_0, Pic_0241_570_165);//HJ3EA0
SetPagePic(GRAPHICS_PAGE_0, Pic_0330_367_163);
if (Connect_ON == 0)
{
......@@ -760,31 +736,6 @@ void AMT630H_GUI_Bluetooth_Information(uint8_t sync_contacts, uint8_t Connect_ON
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0328_584_226);
}
DISPLAY_NUM_ST DisplayNumPara;
uint8_t sync_contactsNumber;
sync_contactsNumber = sync_contacts;
if (sync_contacts < 10)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0038_590_287);
DisplayNumPara.NumList = Bluetooth_num_night;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 14;
DisplayNumPara.x = 604;
DisplayNumPara.y = GROUP_PIC_USE_PSD_Y_POS;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 1;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, sync_contactsNumber);
}
else
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0039_583_287);
DisplayNumPara.NumList = Bluetooth_num_night;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 14;
DisplayNumPara.x = 612;
DisplayNumPara.y = GROUP_PIC_USE_PSD_Y_POS;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 2;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, sync_contactsNumber);
}
}
else if(g_u8Language == EN)
{
......@@ -793,7 +744,7 @@ void AMT630H_GUI_Bluetooth_Information(uint8_t sync_contacts, uint8_t Connect_ON
SetPagePic(GRAPHICS_PAGE_0, Pic_0208_478_348);
SetPagePic(GRAPHICS_PAGE_0, Pic_0237_376_289);
SetPagePic(GRAPHICS_PAGE_0, Pic_0240_377_227);
SetPagePic(GRAPHICS_PAGE_0, Pic_0241_570_165);
//SetPagePic(GRAPHICS_PAGE_0, Pic_0241_570_165);//HJ3EA0
SetPagePic(GRAPHICS_PAGE_0, Pic_0242_377_166);
if (Connect_ON == 0)
......@@ -804,33 +755,75 @@ void AMT630H_GUI_Bluetooth_Information(uint8_t sync_contacts, uint8_t Connect_ON
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0238_574_226);
}
DISPLAY_NUM_ST DisplayNumPara;
uint8_t sync_contactsNumber;
sync_contactsNumber = sync_contacts;
if (sync_contacts < 10)
}
/*蓝牙名称改为字库显示*/
/* RGB 0 0 0 --- 白*/
/* RGB 0XFF 0XFF 0XFF --- 黑*/
PackedTransfer_LabelsList( 0x5022,(uint8_t *)BlueToothName, 40);
SetPageText(GRAPHICS_PAGE_0, 0x5022, 570 , 165 , 200, ALIGN_LEFT, 0, TEXT_COLOR(0XFF,0XFF,0XFF,0XFF),TEXT_LINE_OFFSET(1,1));
}
/*遍历同步联系人数组*/
if(PhoneNumberTotal[0] == 0)
{
Contect_totalnumber = 1;
}
else
{
for(int i=0 ; i<20 ; i++ )
{
if(PhoneNumberTotal[i] != 0)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0038_590_287);
DisplayNumPara.NumList = Bluetooth_num_night;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 14;
DisplayNumPara.x = 604;
DisplayNumPara.y = GROUP_PIC_USE_PSD_Y_POS;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 1;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, sync_contactsNumber);
Contect_totalnumber++;
}
else
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0039_583_287);
DisplayNumPara.NumList = Bluetooth_num_night;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 14;
DisplayNumPara.x = 612;
DisplayNumPara.y = GROUP_PIC_USE_PSD_Y_POS;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 2;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, sync_contactsNumber);
break;
}
}
}
/*同步联系人数字显示(字库版)*/
if(g_u8Display_Mode == ModeDAY)
{
if(Contect_totalnumber == 1)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0038_590_287); /*【括号】 一位数 */
PackedTransfer_LabelsList( 0x7000,(uint8_t *)PhoneNumberTotal, 20);
SetPageText(GRAPHICS_PAGE_0, 0x7000, 605 , 289 , 200, ALIGN_LEFT, 0, TEXT_COLOR(0,0,0,0XFF),TEXT_LINE_OFFSET(1,1));
}
else if(Contect_totalnumber == 2)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0039_583_287); /*【括号】 两位数 */
PackedTransfer_LabelsList( 0x7000,(uint8_t *)PhoneNumberTotal, 20);
SetPageText(GRAPHICS_PAGE_0, 0x7000, 590 , 285 , 200, ALIGN_LEFT, 0, TEXT_COLOR(0,0,0,0XFF),TEXT_LINE_OFFSET(1,1));
}
// else if(Contect_totalnumber == 3)
// {
// SetPagePic(GRAPHICS_PAGE_0, ); /*【括号】 三位数 */
// PackedTransfer_LabelsList( 0x4022,(uint8_t *)PhoneNumberTotal, 40);
// SetPageText(GRAPHICS_PAGE_0, 0x4022, 570 , 165 , 200, ALIGN_LEFT, 0, TEXT_COLOR(0XFF,0XFF,0XFF,0XFF),TEXT_LINE_OFFSET(1,1));
// }
}
else if(g_u8Display_Mode == ModeNIGHT)
{
if(Contect_totalnumber == 1)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0223_590_287); /*【括号】 一位数 */
PackedTransfer_LabelsList( 0x7000,(uint8_t *)PhoneNumberTotal, 20);
SetPageText(GRAPHICS_PAGE_0, 0x7000, 605 , 289 , 200, ALIGN_LEFT, 0, TEXT_COLOR(0XFF,0XFF,0XFF,0XFF),TEXT_LINE_OFFSET(1,1));
}
else if(Contect_totalnumber == 2)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0224_583_287); /*【括号】 两位数 */
PackedTransfer_LabelsList( 0x7000,(uint8_t *)PhoneNumberTotal, 20);
SetPageText(GRAPHICS_PAGE_0, 0x7000, 590 , 285 , 200, ALIGN_LEFT, 0, TEXT_COLOR(0XFF,0XFF,0XFF,0XFF),TEXT_LINE_OFFSET(1,1));
}
// else if(Contect_totalnumber == 3)
// {
// SetPagePic(GRAPHICS_PAGE_0, ); /*【括号】 三位数 */
// PackedTransfer_LabelsList( 0x4022,(uint8_t *)PhoneNumberTotal, 40);
// SetPageText(GRAPHICS_PAGE_0, 0x4022, 570 , 165 , 200, ALIGN_LEFT, 0, TEXT_COLOR(0,0,0,0XFF),TEXT_LINE_OFFSET(1,1));
// }
}
}
static uint16_t Time_num_day[] = {
......@@ -2118,8 +2111,10 @@ static uint16_t Bluetooth_Connect_num_night[] = {
* @param[in] sync_contacts 同步联系人
* @param[in] Connect_ON 0 关 1 开
*/
void AMT630H_GUI_Bluetooth_Connect_Setting(Menu_Item_en_t select, uint8_t sync_contacts, uint8_t Connect_ON)
void AMT630H_GUI_Bluetooth_Connect_Setting(Menu_Item_en_t select, uint8_t Connect_ON)
{
uint8_t Contect_totalnumber;
Contect_totalnumber = 0;
if(g_u8Display_Mode == ModeDAY)
{
if(g_u8Language == CH)
......@@ -2128,7 +2123,7 @@ void AMT630H_GUI_Bluetooth_Connect_Setting(Menu_Item_en_t select, uint8_t sync_c
SetPagePic(GRAPHICS_PAGE_0, Pic_0136_489_345); /*返回*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0139_369_287); /*同步联系人*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0142_367_226); /*蓝牙连接*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0055_570_165); /*HI3EA0*/
//SetPagePic(GRAPHICS_PAGE_0, Pic_0055_570_165); /*HI3EA0*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0143_367_163); /*蓝牙名称*/
switch (select)
......@@ -2153,34 +2148,7 @@ void AMT630H_GUI_Bluetooth_Connect_Setting(Menu_Item_en_t select, uint8_t sync_c
else
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0141_584_226);
}
/*同步联系人*/
DISPLAY_NUM_ST DisplayNumPara;
uint8_t sync_contactsNumber;
sync_contactsNumber = sync_contacts;
if (sync_contacts < 10)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0038_590_287);
DisplayNumPara.NumList = Bluetooth_Connect_num_day;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 14;
DisplayNumPara.x = 604;
DisplayNumPara.y = GROUP_PIC_USE_PSD_Y_POS;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 1;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, sync_contactsNumber);
}
else
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0039_583_287);
DisplayNumPara.NumList = Bluetooth_Connect_num_day;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 14;
DisplayNumPara.x = 612;
DisplayNumPara.y = GROUP_PIC_USE_PSD_Y_POS;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 2;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, sync_contactsNumber);
}
}
}
else if(g_u8Language == EN)
{
......@@ -2188,7 +2156,7 @@ void AMT630H_GUI_Bluetooth_Connect_Setting(Menu_Item_en_t select, uint8_t sync_c
SetPagePic(GRAPHICS_PAGE_0, Pic_0019_478_348);
SetPagePic(GRAPHICS_PAGE_0, Pic_0037_376_289);
SetPagePic(GRAPHICS_PAGE_0, Pic_0054_377_227);
SetPagePic(GRAPHICS_PAGE_0, Pic_0055_570_165);
//SetPagePic(GRAPHICS_PAGE_0, Pic_0055_570_165);
SetPagePic(GRAPHICS_PAGE_0, Pic_0056_377_166);
switch (select)
{
......@@ -2215,34 +2183,12 @@ void AMT630H_GUI_Bluetooth_Connect_Setting(Menu_Item_en_t select, uint8_t sync_c
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0052_574_226);
}
/*蓝牙联系人*/
DISPLAY_NUM_ST DisplayNumPara;
uint8_t sync_contactsNumber;
sync_contactsNumber = sync_contacts;
if (sync_contacts < 10)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0038_590_287);
DisplayNumPara.NumList = Bluetooth_Connect_num_day;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 14;
DisplayNumPara.x = 604;
DisplayNumPara.y = GROUP_PIC_USE_PSD_Y_POS;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 1;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, sync_contactsNumber);
}
else
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0039_583_287);
DisplayNumPara.NumList = Bluetooth_Connect_num_day;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 14;
DisplayNumPara.x = 612;
DisplayNumPara.y = GROUP_PIC_USE_PSD_Y_POS;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 2;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, sync_contactsNumber);
}
}
/*蓝牙名称改为字库显示*/
/* RGB 0 0 0 --- 黑*/
/* RGB 0XFF 0XFF 0XFF --- 白*/
PackedTransfer_LabelsList( 0x5022,(uint8_t *)BlueToothName, 40);
SetPageText(GRAPHICS_PAGE_0, 0x5022, 570 , 165 , 200, ALIGN_LEFT, 0, TEXT_COLOR(0,0,0,0XFF),TEXT_LINE_OFFSET(1,1));
}
else if(g_u8Display_Mode == ModeNIGHT)
{
......@@ -2252,7 +2198,7 @@ void AMT630H_GUI_Bluetooth_Connect_Setting(Menu_Item_en_t select, uint8_t sync_c
SetPagePic(GRAPHICS_PAGE_0, Pic_0324_489_345);
SetPagePic(GRAPHICS_PAGE_0, Pic_0326_369_287);
SetPagePic(GRAPHICS_PAGE_0, Pic_0329_367_226);
SetPagePic(GRAPHICS_PAGE_0, Pic_0241_570_165);
//SetPagePic(GRAPHICS_PAGE_0, Pic_0241_570_165);
SetPagePic(GRAPHICS_PAGE_0, Pic_0330_367_163);
switch (select)
{
......@@ -2268,7 +2214,6 @@ void AMT630H_GUI_Bluetooth_Connect_Setting(Menu_Item_en_t select, uint8_t sync_c
default:
break;
}
/*蓝牙连接*/
if (Connect_ON == 0)
{
......@@ -2277,34 +2222,7 @@ void AMT630H_GUI_Bluetooth_Connect_Setting(Menu_Item_en_t select, uint8_t sync_c
else
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0328_584_226);
}
/*蓝牙联系人选择*/
DISPLAY_NUM_ST DisplayNumPara;
uint8_t sync_contactsNumber;
sync_contactsNumber = sync_contacts;
if (sync_contacts < 10)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0223_590_287);
DisplayNumPara.NumList = Bluetooth_Connect_num_night;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 14;
DisplayNumPara.x = 604;
DisplayNumPara.y = GROUP_PIC_USE_PSD_Y_POS;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 1;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, sync_contactsNumber);
}
else
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0224_583_287);
DisplayNumPara.NumList = Bluetooth_Connect_num_night;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 14;
DisplayNumPara.x = 612;
DisplayNumPara.y = GROUP_PIC_USE_PSD_Y_POS;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 2;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, sync_contactsNumber);
}
}
}
else if(g_u8Language == EN)
{
......@@ -2312,7 +2230,7 @@ void AMT630H_GUI_Bluetooth_Connect_Setting(Menu_Item_en_t select, uint8_t sync_c
SetPagePic(GRAPHICS_PAGE_0, Pic_0208_478_348);
SetPagePic(GRAPHICS_PAGE_0, Pic_0237_376_289);
SetPagePic(GRAPHICS_PAGE_0, Pic_0240_377_227);
SetPagePic(GRAPHICS_PAGE_0, Pic_0241_570_165);
//SetPagePic(GRAPHICS_PAGE_0, Pic_0241_570_165);
SetPagePic(GRAPHICS_PAGE_0, Pic_0242_377_166);
switch (select)
{
......@@ -2329,7 +2247,6 @@ void AMT630H_GUI_Bluetooth_Connect_Setting(Menu_Item_en_t select, uint8_t sync_c
default:
break;
}
/*蓝牙连接*/
if (Connect_ON == 0)
{
......@@ -2339,38 +2256,75 @@ void AMT630H_GUI_Bluetooth_Connect_Setting(Menu_Item_en_t select, uint8_t sync_c
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0238_574_226);
}
/*蓝牙联系人选择*/
DISPLAY_NUM_ST DisplayNumPara;
uint8_t sync_contactsNumber;
sync_contactsNumber = sync_contacts;
if (sync_contacts < 10)
}
/*蓝牙名称改为字库显示*/
/* RGB 0 0 0 --- 黑*/
/* RGB 0XFF 0XFF 0XFF --- 白*/
PackedTransfer_LabelsList( 0x5022,(uint8_t *)BlueToothName, 40);
SetPageText(GRAPHICS_PAGE_0, 0x5022, 570 , 165 , 200, ALIGN_LEFT, 0, TEXT_COLOR(0XFF,0XFF,0XFF,0XFF),TEXT_LINE_OFFSET(1,1));
}
/*遍历同步联系人数组*/
if(PhoneNumberTotal[0] == 0)
{
Contect_totalnumber = 1;
}
else
{
for(int i=0 ; i<20 ; i++ )
{
if(PhoneNumberTotal[i] != 0)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0223_590_287);
DisplayNumPara.NumList = Bluetooth_Connect_num_night;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 14;
DisplayNumPara.x = 604;
DisplayNumPara.y = GROUP_PIC_USE_PSD_Y_POS;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 1;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, sync_contactsNumber);
Contect_totalnumber++;
}
else
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0224_583_287);
DISPLAY_NUM_ST DisplayNumPara;
uint8_t ArrivalNumber;
ArrivalNumber = sync_contacts;
DisplayNumPara.NumList = Bluetooth_Connect_num_night;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 14;
DisplayNumPara.x = 612;
DisplayNumPara.y = GROUP_PIC_USE_PSD_Y_POS;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 2;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, sync_contactsNumber);
break;
}
}
}
/*同步联系人数字显示(字库版)*/
if(g_u8Display_Mode == ModeDAY)
{
if(Contect_totalnumber == 1)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0038_590_287); /*【括号】 一位数 */
PackedTransfer_LabelsList( 0x7000,(uint8_t *)PhoneNumberTotal, 20);
SetPageText(GRAPHICS_PAGE_0, 0x7000, 605 , 289 , 200, ALIGN_LEFT, 0, TEXT_COLOR(0,0,0,0XFF),TEXT_LINE_OFFSET(1,1));
}
else if(Contect_totalnumber == 2)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0039_583_287); /*【括号】 两位数 */
PackedTransfer_LabelsList( 0x7000,(uint8_t *)PhoneNumberTotal, 20);
SetPageText(GRAPHICS_PAGE_0, 0x7000, 590 , 285 , 200, ALIGN_LEFT, 0, TEXT_COLOR(0,0,0,0XFF),TEXT_LINE_OFFSET(1,1));
}
// else if(Contect_totalnumber == 3)
// {
// SetPagePic(GRAPHICS_PAGE_0, ); /*【括号】 三位数 */
// PackedTransfer_LabelsList( 0x4022,(uint8_t *)PhoneNumberTotal, 40);
// SetPageText(GRAPHICS_PAGE_0, 0x4022, 570 , 165 , 200, ALIGN_LEFT, 0, TEXT_COLOR(0XFF,0XFF,0XFF,0XFF),TEXT_LINE_OFFSET(1,1));
// }
}
else if(g_u8Display_Mode == ModeNIGHT)
{
if(Contect_totalnumber == 1)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0223_590_287); /*【括号】 一位数 */
PackedTransfer_LabelsList( 0x7000,(uint8_t *)PhoneNumberTotal, 20);
SetPageText(GRAPHICS_PAGE_0, 0x7000, 605 , 289 , 200, ALIGN_LEFT, 0, TEXT_COLOR(0XFF,0XFF,0XFF,0XFF),TEXT_LINE_OFFSET(1,1));
}
else if(Contect_totalnumber == 2)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0224_583_287); /*【括号】 两位数 */
PackedTransfer_LabelsList( 0x7000,(uint8_t *)PhoneNumberTotal, 20);
SetPageText(GRAPHICS_PAGE_0, 0x7000, 590 , 285 , 200, ALIGN_LEFT, 0, TEXT_COLOR(0XFF,0XFF,0XFF,0XFF),TEXT_LINE_OFFSET(1,1));
}
// else if(Contect_totalnumber == 3)
// {
// SetPagePic(GRAPHICS_PAGE_0, ); /*【括号】 三位数 */
// PackedTransfer_LabelsList( 0x4022,(uint8_t *)PhoneNumberTotal, 40);
// SetPageText(GRAPHICS_PAGE_0, 0x4022, 570 , 165 , 200, ALIGN_LEFT, 0, TEXT_COLOR(0,0,0,0XFF),TEXT_LINE_OFFSET(1,1));
// }
}
}
......@@ -2763,6 +2717,18 @@ static const uint16_t NumbeList_Voltage_DAY[] = {
Pic_0566_949_465,
Pic_0576_945_458,
};
static const uint16_t NumbeList_PhoneConnect_Voltage[] ={
Pic_0453_688_516,
Pic_0455_692_516,
Pic_0456_689_516,
Pic_0457_689_516,
Pic_0458_688_516,
Pic_0459_689_516,
Pic_0460_689_516,
Pic_0461_688_516,
Pic_0462_688_516,
Pic_0463_689_516,
};
static const uint16_t NumbeList_Voltage_NIGHT[] = {
Pic_0673_943_451,
Pic_0675_948_451,
......@@ -2873,6 +2839,18 @@ static const uint16_t PICList_ESpeed_NIGHT[] = {
Pic_0717_731_111,
Pic_0716_782_125,
};
static const uint16_t NumbeList_PhoneConnect_ESpeed[] ={
Pic_0385_63_554,
Pic_0386_73_554,
Pic_0387_64_554,
Pic_0388_65_554,
Pic_0389_62_554,
Pic_0390_64_554,
Pic_0391_64_554,
Pic_0392_63_554,
Pic_0393_63_554,
Pic_0394_64_554,
};
static const uint16_t PICList_Fuel[] = {
Pic_0562_315_473,
Pic_0555_366_473,
......@@ -2883,6 +2861,16 @@ static const uint16_t PICList_Fuel[] = {
Pic_0560_586_473,
Pic_0561_623_473,
};
static const uint16_t PICList_PhoneConnect_Fuel[] = {
Pic_0414_76_536,
Pic_0416_105_536,
Pic_0417_134_536,
Pic_0418_163_536,
Pic_0419_192_536,
Pic_0420_221_536,
Pic_0421_250_536,
Pic_0422_279_536,
};
// static const uint16_t PICList_Fuel_RED[] = {
// Pic_0562_315_473,
// Pic_0555_366_473,
......@@ -2968,11 +2956,11 @@ static void AMT630H_GUI_Light()
;
}
}
if(Get_TelltalesLedSts(em_LED_WIFI))
if(GetPhoneMirrorst() == 1) /*WIFI指示灯*/
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0737_875_23);
}
if(BlueToothPhoneData.BlueToothSignalSate == BlueTooth_Connection)
if(BlueToothPhoneData.BlueToothSignalSate == BlueTooth_Connection) /*蓝牙指示灯*/
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0740_682_21);
}
......@@ -3023,11 +3011,11 @@ static void AMT630H_GUI_PhoneConnect_Light()
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0473_172_490);
}
if(Get_TelltalesLedSts(em_LED_WIFI))
if(GetPhoneMirrorst() == 1) /*WIFI指示灯*/
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0465_881_487);
}
if(Get_TelltalesLedSts(em_LED_Bluetooth))
if(BlueToothPhoneData.BlueToothSignalSate == BlueTooth_Connection) /*蓝牙指示灯*/
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0468_819_486);
}
......@@ -3247,6 +3235,48 @@ static void AMT630H_GUI_Telephone()
}
}
/*
*NAME : AMT630H_GUI_PhoneConnect_Telephone
*FUNCTION : 导航界面来电显示函数
*PARAMETER : NULL
*RETURN : NULL
*/
static void AMT630H_GUI_PhoneConnect_Telephone()
{
if(BlueToothPhoneData.BlueToothSignalSate == BlueTooth_Connection)
{ if(BlueToothPhoneData.BlueToothPhoneSate == Phone_Outgoing)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0451_751_555);
if(TextPara[TEXT_NUM_PHONE_NUMBER].Vaild == 0X01)
{
PackedTransfer_LabelsList( 0x4009,(uint8_t *)PhoneNumber, 40);
SetPageText(GRAPHICS_PAGE_0, 0x4009, 786, 561, 200, ALIGN_LEFT, 0, TEXT_COLOR(0,0,0,0XFF),TEXT_LINE_OFFSET(1,1));
}
}
else if(BlueToothPhoneData.BlueToothPhoneSate == Phone_Talking)
{
//SetPagePic(GRAPHICS_PAGE_0, Pic_0943_751_555);
if(TextPara[TEXT_NUM_PHONE_NUMBER].Vaild == 0X01)
{
PackedTransfer_LabelsList( 0x4009,(uint8_t *)PhoneNumber, 40);
SetPageText(GRAPHICS_PAGE_0, 0x4009, 786, 561, 200, ALIGN_LEFT, 0, TEXT_COLOR(0,0,0,0XFF),TEXT_LINE_OFFSET(1,1));
}
}
else if(BlueToothPhoneData.BlueToothPhoneSate == Phone_Incoming)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0450_751_555);
if(TextPara[TEXT_NUM_PHONE_NUMBER].Vaild == 0X01)
{
PackedTransfer_LabelsList( 0x4009,(uint8_t *)PhoneNumber, 40);
SetPageText(GRAPHICS_PAGE_0, 0x4009, 786, 561, 200, ALIGN_LEFT, 0, TEXT_COLOR(0,0,0,0XFF),TEXT_LINE_OFFSET(1,1));
}
}
}
else
{
;
}
}
/*
*NAME : AMT630H_GUI_Fuel
......@@ -3442,6 +3472,92 @@ static void AMT630H_GUI_Fuel_SelfCheck(uint8_t Fuel)
}
}
/*
*NAME : AMT630H_GUI_PhoneConnect_Fuel
*FUNCTION : 投屏界面车速显示
*PARAMETER : uint8_t Fuel-燃油等级 0 - 红区一格 1 - 正常一格
*RETURN : NULL
*/
static void AMT630H_GUI_PhoneConnect_Fuel(uint8_t Fuel)
{
static uint8_t s_FuelLowTime = 0U;
uint8_t FuelLevel;
FuelLevel = Fuel;
if(Fuel == 0)
{
FuelLevel = 1;
}
else
{
;
}
SetPagePic(GRAPHICS_PAGE_0, Pic_0411_56_533); /*E*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0412_314_533); /*F*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0413_74_533); /*燃油格 组*/
/*Fuel=0时 黄色燃油灯1HZ闪烁*/
if (Fuel == 0)
{
if (FLASH_SYNC_1Hz)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0423_26_529); /*黄色燃油灯*/
}
s_FuelLowTime = 0;
}
else if (Fuel == 1)
{
s_FuelLowTime++;
if (s_FuelLowTime <= 15)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0552_503_529); /*黄色燃油灯*/
}
if (s_FuelLowTime > 20)
{
s_FuelLowTime = 0;
}
}
else
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0551_503_529); /*黑色燃油灯*/
s_FuelLowTime = 0;
}
/*燃油格数走格*/
if (FuelLevel > 0)
{
if (FuelLevel != g_u16_GUI_PerFuelLevel)
{
for (uint8_t i = 0; i < g_u16_GUI_PerFuelLevel; i++)
{
SetPagePic(GRAPHICS_PAGE_0, PICList_PhoneConnect_Fuel[i]);
}
if (FuelLevel > g_u16_GUI_PerFuelLevel)
{
g_u16_GUI_PerFuelLevel++;
}
else if ((FuelLevel < g_u16_GUI_PerFuelLevel) && (g_u16_GUI_PerFuelLevel != 0))
{
g_u16_GUI_PerFuelLevel--;
}
else
{
;
}
}
if (FuelLevel == g_u16_GUI_PerFuelLevel)
{
g_u16_GUI_PerFuelLevel = FuelLevel;
for (uint8_t i = 0; i < g_u16_GUI_PerFuelLevel; i++)
{
SetPagePic(GRAPHICS_PAGE_0, PICList_PhoneConnect_Fuel[i]);
}
}
}
else
{
//SetPagePic(GRAPHICS_PAGE_0, Pic_0414_76_536); /*燃油红区*/
}
}
/*电压显示函数*/
static void AMT630H_GUI_Voltage(uint16_t Voltage)
......@@ -3587,6 +3703,69 @@ static void AMT630H_GUI_Voltage(uint16_t Voltage)
}
}
/*
*NAME : AMT630H_GUI_PhoneConnect_Voltage
*FUNCTION : 导航界面电压显示函数
*PARAMETER : uint16_t Voltage - 电压值
*RETURN : NULL
*/
static void AMT630H_GUI_PhoneConnect_Voltage(uint16_t Voltage)
{
DISPLAY_NUM_ST DisplayNumPara;
uint16_t VoltageNumber;
VoltageNumber = Voltage / 10;
if (Voltage % 10 > 5)
{
VoltageNumber++;
}
uint16_t Voltage_Hundred;
uint16_t Voltage_Ten;
uint16_t Voltage_Unit;
uint16_t Front;
/*数据处理*/
Voltage_Hundred = VoltageNumber / 100;
Voltage_Ten = (VoltageNumber % 100) / 10;
Voltage_Unit = VoltageNumber % 10;
Front = Voltage_Hundred * 10 + Voltage_Ten;
DisplayNumPara.NumList = NumbeList_PhoneConnect_Voltage;
if ((VoltageNumber >= 100) && (VoltageNumber < 1000))
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0452_717_516); /* V */
SetPagePic(GRAPHICS_PAGE_0, Pic_0454_704_526); /* . */
DisplayNumPara.x = 707;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 0;
DisplayNumPara.y = GROUP_PIC_USE_PSD_Y_POS;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 1;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, Voltage_Unit);
DisplayNumPara.x = 693;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 10;
DisplayNumPara.y = GROUP_PIC_USE_PSD_Y_POS;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 2;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, Front);
}
else if (0 <= VoltageNumber < 100)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0452_712_516); /* V */
SetPagePic(GRAPHICS_PAGE_0, Pic_0454_699_526); /* . */
DisplayNumPara.x = 688;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 14;
DisplayNumPara.y = GROUP_PIC_USE_PSD_Y_POS;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 2;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, VoltageNumber);
}
}
/*大计里程显示函数*/
static void AMT630H_GUI_ODO(uint32_t ODO, uint8_t Uint)
{
......@@ -3975,7 +4154,7 @@ static void AMT630H_GUI_VSpeed(uint16_t VSpeed)
{
if (VSpeedNumber == 1)
{
DisplayNumPara.x = 492; // 1的宽度与其他数字不同 坐标没给
DisplayNumPara.x = 492;
}
else
{
......@@ -4038,7 +4217,7 @@ static void AMT630H_GUI_VSpeed(uint16_t VSpeed)
{
if (VSpeedNumber == 1)
{
DisplayNumPara.x = 492; // 1的宽度与其他数字不同 坐标没给
DisplayNumPara.x = 492;
}
else
{
......@@ -4071,64 +4250,64 @@ static void AMT630H_GUI_VSpeed(uint16_t VSpeed)
static void AMT630H_GUI_PhoneConnect_VSpeed(uint16_t VSpeed)
{
if(g_u8UnitSetting == Metric)
{
//SetPagePic(GRAPHICS_PAGE_0, );/*单位 km/h */
}
else if(g_u8UnitSetting == Imperial)
{
//SetPagePic(GRAPHICS_PAGE_0, );/*单位 mph/h */
}
else
{
;
}
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0398_632_551); /*单位 km/h */
}
else if(g_u8UnitSetting == Imperial)
{
//SetPagePic(GRAPHICS_PAGE_0, Pic_0942_634_551); /*单位 mph/h */ /*未更改pinbin文件待解*/
}
else
{
;
}
/*数据处理*/
DISPLAY_NUM_ST DisplayNumPara;
uint16_t VSpeedNumber;
VSpeedNumber = VSpeed;
/*数据处理*/
DISPLAY_NUM_ST DisplayNumPara;
uint16_t VSpeedNumber;
VSpeedNumber = VSpeed;
DisplayNumPara.NumList = NumbeList_PhoneConnect_VSpeed;
if (100 <= VSpeedNumber)
{
DisplayNumPara.x = 544;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 60;
DisplayNumPara.y = GROUP_PIC_USE_PSD_Y_POS;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 3;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, VSpeedNumber);
}
DisplayNumPara.NumList = NumbeList_PhoneConnect_VSpeed;
if (100 <= VSpeedNumber)
{
DisplayNumPara.x = 544;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 60;
DisplayNumPara.y = GROUP_PIC_USE_PSD_Y_POS;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 3;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, VSpeedNumber);
}
else if ((10 <= VSpeedNumber))
{
DisplayNumPara.x = 514;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 60;
DisplayNumPara.y = GROUP_PIC_USE_PSD_Y_POS;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 2;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, VSpeedNumber);
}
else if ((10 <= VSpeedNumber))
{
DisplayNumPara.x = 514;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 60;
DisplayNumPara.y = GROUP_PIC_USE_PSD_Y_POS;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 2;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, VSpeedNumber);
}
else if (0 <= VSpeedNumber)
else if (0 <= VSpeedNumber)
{
if (VSpeedNumber == 1)
{
if (VSpeedNumber == 1)
{
DisplayNumPara.x = 484; // 1的宽度与其他数字不同 坐标没给
}
else
{
DisplayNumPara.x = 484;
}
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 60;
DisplayNumPara.y = GROUP_PIC_USE_PSD_Y_POS;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 1;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, VSpeedNumber);
DisplayNumPara.x = 502;
}
else
{
;
DisplayNumPara.x = 484;
}
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 60;
DisplayNumPara.y = GROUP_PIC_USE_PSD_Y_POS;
DisplayNumPara.DecimalNum = 0;
DisplayNumPara.MinDigits = 1;
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, VSpeedNumber);
}
else
{
;
}
}
/*转速显示函数*/
......@@ -4213,7 +4392,35 @@ static void AMT630H_GUI_ESpeed(uint16_t ESpeed)
;
}
}
/*
*NAME : AMT630H_GUI_PhoneConnect_ESpeed
*FUNCTION : 投屏界面转速显示
*PARAMETER : uint16_t ESpeed-转速
*RETURN : NULL
*/
static void AMT630H_GUI_PhoneConnect_ESpeed(uint16_t ESpeed)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0384_103_570); /* 转速单位x1000r/min */
DISPLAY_NUM_ST DisplayNumPara;
uint16_t ESpeedNumber;
ESpeedNumber = ESpeed / 1000;
DisplayNumPara.NumList = NumbeList_PhoneConnect_ESpeed;
DisplayNumPara.x = 53; /*在UI所给坐标基础上进行调整*/
DisplayNumPara.y = GROUP_PIC_USE_PSD_Y_POS;
DisplayNumPara.NumInterval = GROUP_PIC_DIR_LEFT | 60;
DisplayNumPara.DecimalNum = 0;
if(ESpeedNumber >= 10)
{
DisplayNumPara.MinDigits = 2;
}
else
{
DisplayNumPara.MinDigits = 1;
}
DisplayNum(GRAPHICS_PAGE_0, &DisplayNumPara, ESpeedNumber);
}
/******************************************************************************************/
/**
* @brief 主界面显示
......@@ -4347,6 +4554,7 @@ void AMT630H_GUI_BACKGRAND_SelfCheck()
SetPagePic(GRAPHICS_PAGE_0, Pic_0737_875_23);/*WIFI*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0740_682_21);/*蓝牙*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0748_194_26);/*E*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0563_923_407); /*红色电压指示灯*/
AMT630H_GUI_TIME(Get_Dis_Hour_Time(), Get_Dis_Minute_Time());
if(KL30_VOLTAGE_time < 10)
......@@ -4417,27 +4625,27 @@ void AMT630H_GUI_BACKGRAND_SelfCheck()
g_u16espeednumberdown -= 12;/*g_u16espeednumberdown = 0 转速自检结束*/
}
}
/*
*电压值自检
*电压自检范围:0V~16V
*/
if(g_u16voltagenumberup <= 160)
{
AMT630H_GUI_Voltage(g_u16voltagenumberup*10);
g_u16voltagenumberup += 5;
}
else
{
if(g_u16voltagenumberdown > 0)
{
AMT630H_GUI_Voltage(g_u16voltagenumberdown*10);
g_u16voltagenumberdown -= 5;
}
else
{
;
}
}
// /*
// *电压值自检
// *电压自检范围:0V~16V
// */
// if(g_u16voltagenumberup <= 160)
// {
// AMT630H_GUI_Voltage(g_u16voltagenumberup*10);
// g_u16voltagenumberup += 5;
// }
// else
// {
// if(g_u16voltagenumberdown > 0)
// {
// AMT630H_GUI_Voltage(g_u16voltagenumberdown*10);
// g_u16voltagenumberdown -= 5;
// }
// else
// {
// ;
// }
// }
/*结束状态*/
if(g_u16fuelnumberdown == 0)
{
......@@ -4451,12 +4659,12 @@ void AMT630H_GUI_BACKGRAND_SelfCheck()
{
AMT630H_GUI_ESpeed(g_u16espeednumberdown);
}
if(g_u16voltagenumberdown == 0)
{
AMT630H_GUI_Voltage(0);
}
// if(g_u16voltagenumberdown == 0)
// {
// AMT630H_GUI_Voltage(0);
// }
/*结束自检*/
if((g_u16fuelnumberdown == 0)&&(g_u16vspeednumberdown == 0)&&(g_u16espeednumberdown == 0)&&(g_u16voltagenumberdown == 0))
if((g_u16fuelnumberdown == 0)&&(g_u16vspeednumberdown == 0)&&(g_u16espeednumberdown == 0))
{
g_u8SelfCheck = 1;/*自检结束标志*/
Voltage_Selfcheck = 0;
......@@ -4475,8 +4683,8 @@ void AMT630H_GUI_SELFCHECK_STS_INIT(void)
g_u16vspeednumberdown = 200U;
g_u16espeednumberup = 0U;
g_u16espeednumberdown = 300U;
g_u16voltagenumberup = 0U;
g_u16voltagenumberdown = 160U;
// g_u16voltagenumberup = 0U;
// g_u16voltagenumberdown = 160U;
}
......@@ -4577,19 +4785,19 @@ void AMT630H_GUI_ReadPosittion_Display(void)
case MENU_ITEM_BLUETOOTH_CONNECT: /*03 蓝牙连接*/
AMT630H_GUI_SETTING();
AMT630H_GUI_Bluetooth_Information(8, Get_Dis_Bluetooth_Open_Close());
AMT630H_GUI_Bluetooth_Information( Get_Dis_Bluetooth_Open_Close());
break;
case MENU_ITEM_BLUETOOTH_OPEN_CLOSE: /*12 蓝牙_开*/
AMT630H_GUI_SETTING();
AMT630H_GUI_Bluetooth_Connect_Setting(MENU_ITEM_BLUETOOTH_OPEN_CLOSE, 8, Get_Dis_Bluetooth_Open_Close());
AMT630H_GUI_Bluetooth_Connect_Setting(MENU_ITEM_BLUETOOTH_OPEN_CLOSE, Get_Dis_Bluetooth_Open_Close());
break;
case MENU_ITEM_BLUETOOTH_SYNC: /*13 蓝牙同步联系人*/
AMT630H_GUI_SETTING();
AMT630H_GUI_Bluetooth_Connect_Setting(MENU_ITEM_BLUETOOTH_SYNC, 8, Get_Dis_Bluetooth_Open_Close());
AMT630H_GUI_Bluetooth_Connect_Setting(MENU_ITEM_BLUETOOTH_SYNC, Get_Dis_Bluetooth_Open_Close());
break;
case MENU_ITEM_BLUETOOTH_BACK: /*14 蓝牙返回*/
AMT630H_GUI_SETTING();
AMT630H_GUI_Bluetooth_Connect_Setting(MENU_ITEM_BLUETOOTH_BACK, 8, Get_Dis_Bluetooth_Open_Close());
AMT630H_GUI_Bluetooth_Connect_Setting(MENU_ITEM_BLUETOOTH_BACK, Get_Dis_Bluetooth_Open_Close());
break;
case MENU_ITEM_CLOCK_SETTING: /*15 时钟设置*/
AMT630H_GUI_SETTING();
......@@ -4700,11 +4908,34 @@ void AMT630H_GUI_ReadPosittion_Display(void)
PicObj.navigation_task_id = Pic_0411;//红色小e 19B
if (GetPhoneMirrorst() == 0)
{ SetPagePic(GRAPHICS_PAGE_0, Pic_0001_0_0);
SetPagePic(GRAPHICS_PAGE_0, Pic_0476_0_0);
SetPagePic(GRAPHICS_PAGE_0, Pic_0476_0_0); /*上半屏*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0941_0_470); /*下半屏*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0478_188_310); /*版本*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0491_188_343); /*状态*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0494_410_144);
SetPagePic(GRAPHICS_PAGE_0, Pic_0495_655_197);
SetPagePic(GRAPHICS_PAGE_0, Pic_0496_410_197);
SetPagePic(GRAPHICS_PAGE_0, Pic_0498_411_252); /*UUID*/
// /*是否激活接口待补充*/
// /*!!!!!!!!!!!!别删!!!!!!!!!!!!*/
// if(/*已激活*/)
// {
// SetPagePic(GRAPHICS_PAGE_0, Pic_0492_243_344);
// }
// else
// {
// SetPagePic(GRAPHICS_PAGE_0, Pic_0493_242_344);
// }
// /*!!!!!!!!!!!!别删!!!!!!!!!!!!*/
PackedTransfer_DisplayPhoneMirrorQRcode(1, PicObj);
}
else
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0941_0_470); /*下半屏*/
PackedTransfer_DisplayPhoneMirrorQRcode(0, PicObj);
}
SetPagePic(GRAPHICS_PAGE_0, Pic_0479_242_313);
......@@ -4712,6 +4943,21 @@ void AMT630H_GUI_ReadPosittion_Display(void)
AMT630H_GUI_PhoneConnect_Light();
AMT630H_GUI_PhoneConnect_TIME(Get_Dis_Hour_Time(), Get_Dis_Minute_Time());
AMT630H_GUI_PhoneConnect_VSpeed(VechileSpeed);
AMT630H_GUI_PhoneConnect_ESpeed(Get_DispEngineSpeed());
AMT630H_GUI_PhoneConnect_Fuel(Get_CurFuelSetp());
AMT630H_GUI_PhoneConnect_Telephone();
if(KL30_VOLTAGE_time < 10)
{
KL30_VOLTAGE_time++;
}
else
{
KL30_VOLTAGE_time = 0;
KL30_VOLTAGE_Value = (ADC_Read_Signal(ADC_CH_KL30_VOLTAGE)) / 10;
}
AMT630H_GUI_PhoneConnect_Voltage(KL30_VOLTAGE_Value);
break;
default:
break;
......
......@@ -118,7 +118,8 @@ static const uint16_t PicIndexData[] = {
Pic_0910, 13, 639, 293, Pic_0911, 17, 636, 292, Pic_0912, 13, 639, 293, Pic_0913, 17, 636, 292, Pic_0914, 13, 638, 293, Pic_0915, 16, 636, 293, Pic_0916, 11, 640, 293, Pic_0917, 14, 639, 293, Pic_0899, 11, 638, 293, Pic_0918, 3, 643, 293,
Pic_0898, 14, 637, 293, Pic_0897, 15, 637, 292, Pic_0919, 11, 640, 293, Pic_0920, 12, 639, 293, Pic_0921, 14, 638, 293, Pic_0922, 14, 638, 292, Pic_0923, 14, 638, 293, Pic_0924, 15, 637, 293, Pic_0925, 221, 501, 160, Pic_0926, 50, 619, 240,
Pic_0926, 50, 619, 175, Pic_0927, 50, 619, 240, Pic_0927, 50, 619, 175, Pic_0928, 75, 894, 310, Pic_0929, 75, 894, 310, Pic_0930, 64, 612, 240, Pic_0930, 64, 612, 175, Pic_0931, 64, 612, 240, Pic_0931, 64, 612, 175, Pic_0932, 777, 124, 85,
Pic_0933, 317, 101, 210, Pic_0934, 209, 102, 260, Pic_0935, 461, 36, 367, Pic_0936, 350, 92, 367, Pic_0937, 323, 564, 521, Pic_0938, 41, 62, 399, Pic_0939, 41, 62, 401,
Pic_0933, 317, 101, 210, Pic_0934, 209, 102, 260, Pic_0935, 461, 36, 367, Pic_0936, 350, 92, 367, Pic_0937, 323, 564, 521, Pic_0938, 41, 62, 399, Pic_0939, 41, 62, 401, Pic_0940, 155, 53, 498, Pic_0941, 1521, 0, 470, Pic_0942, 46, 634, 551,
Pic_0943, 28, 751, 555,
};
#define PicIndexData_LEN 14888
//uint32_t PicIndexDataLEN = 0;
......
#ifndef PICBIN_H
#define PICBIN_H
/* Flash Bin Version:20240902 2024-09-02 13:18:34 Compression ratio:70.00% */
/* Flash Bin Version:20240915 2024-09-15 09:22:36 Compression ratio:70.00% */
#define Pic_0001 1
#define Pic_0002 2
#define Pic_0003 3
......@@ -941,6 +941,10 @@
#define Pic_0937 937
#define Pic_0938 938
#define Pic_0939 939
#define Pic_0940 940
#define Pic_0941 941
#define Pic_0942 942
#define Pic_0943 943
enum {
Pic_0001_0_0 = 0,
......@@ -2125,9 +2129,13 @@ enum {
Pic_0937_564_521,
Pic_0938_62_399,
Pic_0939_62_401,
Pic_0940_53_498,
Pic_0941_0_470,
Pic_0942_634_551,
Pic_0943_751_555,
};
#define PIC_INDEX_DATA_CRC 0x53F47F46
#define PIC_INDEX_DATA_CRC 0x8509F1BE
extern void User_PicIndexDataInit(void);
#endif
......@@ -306,7 +306,7 @@ void Get_Into_OTA_Update_Mode(void)
{
if(Menu_Get_Current_Cursor_Information() == MENU_ITEM_FAULT_INFORMATION)
{
OTA_Update_Flag = ! OTA_Update_Flag;
OTA_Update_Flag = 1U;
}
}
void KEY_LEFT_EVENT_NONE_Service(void)
......@@ -387,13 +387,13 @@ void Get_DisTime_Service(void)
void My_Key_Service(void)
{
/* 自检时不可操作按键 */
if(g_u8SelfCheck)
/* 自检和OTA界面时不可操作按键 */
if((g_u8SelfCheck) && (OTA_Update_Flag == 0))
{
if((Get_ActualVechileSpeed() == 0) ||((Get_DispVechileSpeed() >= 1990) && (Get_DispEngineSpeed() >= 12000)))
{
Key_Service();
}
}
}
}
......
......@@ -66,6 +66,7 @@ static void Power_KL30_Init(void)
g_stRTCInformation.u8RTCYear = 20;
RTE_RTC_Init(g_stRTCInformation);
Menu_User_Init();
UDS_Startup_Init();
Can_Init();
Protocol_KL30_Wakeup_Init();
......
......@@ -2,7 +2,7 @@
#define __FLASH_H__
#include <stdint.h>
#include "common.h"
#define SECTOR_SIZE 512
#define SECTOR_SIZE 1024
#define WORD_SIZE 4
//#define FLASH_PROTCET
#define PROTECT_VALUE ((uint32_t)0x1234ABCD)
......
......@@ -61,40 +61,46 @@ int EraseChip (uint32_t adr)
* @param adr - sector address of user code flash
* @return status: 0 - OK, 1 - Failed
***********************************************************************************************************************/
int EraseSector (uint32_t adr)
int EraseSector(uint32_t adr)
{
#ifdef FLASH_PROTCET
if(flash_protect_flag != PROTECT_VALUE)
{
return(1);
}
flash_protect_flag = 0;
if (flash_protect_flag != PROTECT_VALUE)
{
return (1);
}
flash_protect_flag = 0;
#endif
__DI;
__DI;
FMC->FLERMD = 0x10;
FMC->FLPROT = 0xF1;
FMC->FLOPMD1 = 0x55;
FMC->FLOPMD2 = 0xAA;
FMC->FLOPMD2 = 0xAA;
// Write data to start address of sector to trigger Erase Operation
*(uint32_t *) adr = 0xFFFFFFFF;
*(uint32_t *)adr = 0xFFFFFFFF;
// polling Erase Over Flag
while((FMC->FLSTS & FMC_FLSTS_OVF_Msk) == 0);
while ((FMC->FLSTS & FMC_FLSTS_OVF_Msk) == 0)
{
;
}
FMC->FLSTS = FMC_FLSTS_OVF_Msk;
FMC->FLERMD = 0x00;
FMC->FLPROT = 0xF0;
if(FMC->FLSTS & FMC_FLSTS_EVF_Msk)
/* if(FMC->FLSTS & FMC_FLSTS_EVF_Msk)
{
FMC->FLSTS = FMC_FLSTS_EVF_Msk;
__EI;
return(1); /* verify ng */
return(1);
}
else
{
__EI;
return(0); /* verify ok */
}
return(0);
} */
__EI;
return 0;
}
/***********************************************************************************************************************
......
......@@ -203,11 +203,13 @@ void UDS_S_Data_Indication(uint16_t S_TAtype, uint8_t *S_Data, uint16_t S_Length
返回值:无 SYSC0_RUNPLL2CNTR
******************************************************************************/
extern uint8_t S3_Server_refresh;
extern uint8_t S3_ServerEN;
extern uint8_t SessionType;
void UDS_Process_Service_Request(void)
{
if (UDS_APP_RX.A_PDU.New)
{
S3_Server_refresh = 1;
S3_ServerEN = 0; // 收到消息时,暂停S3Timer
switch (UDS_APP_RX.A_PDU.A_PCI.SI)
{
case 0x10: UDS_Service_10_Indication(UDS_APP_RX.A_PDU.TA_type, UDS_APP_RX.A_PDU.Length, UDS_APP_RX.A_PDU.Data);
......@@ -218,11 +220,11 @@ void UDS_Process_Service_Request(void)
UDS_Service_22_Indication(UDS_APP_RX.A_PDU.TA_type, UDS_APP_RX.A_PDU.Length, UDS_APP_RX.A_PDU.Data);
}
break;
/* case 0x2E: UDS_Service_2E_Indication(UDS_APP_RX.A_PDU.TA_type, UDS_APP_RX.A_PDU.Length, UDS_APP_RX.A_PDU.Data);
break;
case 0x27: UDS_Service_27_Indication(UDS_APP_RX.A_PDU.TA_type, UDS_APP_RX.A_PDU.Length, UDS_APP_RX.A_PDU.Data);
break;
case 0x28: UDS_Service_28_Indication(UDS_APP_RX.A_PDU.TA_type, UDS_APP_RX.A_PDU.Length, UDS_APP_RX.A_PDU.Data);
case 0x2E: UDS_Service_2E_Indication(UDS_APP_RX.A_PDU.TA_type, UDS_APP_RX.A_PDU.Length, UDS_APP_RX.A_PDU.Data);
break;
/* case 0x28: UDS_Service_28_Indication(UDS_APP_RX.A_PDU.TA_type, UDS_APP_RX.A_PDU.Length, UDS_APP_RX.A_PDU.Data);
break;
case 0x85: UDS_Service_85_Indication(UDS_APP_RX.A_PDU.TA_type, UDS_APP_RX.A_PDU.Length, UDS_APP_RX.A_PDU.Data);
break; */
......@@ -239,6 +241,12 @@ void UDS_Process_Service_Request(void)
break;
}
UDS_APP_RX.A_PDU.New = 0;
if(SessionType > DefaultSession) // 非默认会话时执行
{
S3_Server_refresh = 1; // 诊断请求处理完成, 刷新S3Timer
S3_ServerEN = 1; // 消息处理完成,恢复S3Timer计时
}
}
}
......
......@@ -34,12 +34,22 @@ DiagSendDataNeg NegRes;
uint8_t UDS_ISO14229_Transfer[250];
DiagFlag DiagDataForFlag;
uint8_t Service27_DelayTimer_Enable;
uint8_t Service27_DelayTimer;
uint8_t Services27_Seed_Requested;
uint8_t DiagLockFlag;
uint32_t Ser27_SeedRandomNumber;
uint32_t GenerateKey;
uint8_t Attemptcnt;
/****************S3Timer********************/
uint8_t S3_ServerEN = 0;
uint8_t S3_ServerCnt = 0;
uint8_t S3_Server_refresh = 0;
/****************DiagnosticSession*****************/
uint8_t SessionType = 0x01;
uint8_t SessionType;
Diag_Write_Data_t Diag_Write_Data;
/******************************************************************************
The service access point of the diagnostics application layer provides a number
of services that all have the same general structure. For each service, three
......@@ -68,7 +78,7 @@ uint8_t MCU_HWversion[6] = {'H', 'V', (uint8_t)((HWV >> 8u) & 0x0Fu) + 0x30u, '.
uint8_t MCU_FBLversion[6] = {'B', 'V', (uint8_t)((BTV >> 8u) & 0x0Fu) + 0x30u, '.', (uint8_t)((BTV >> 4u) & 0x0Fu) + 0x30u, (uint8_t)(BTV & 0x0Fu) + 0x30u};
//零件号信息 F187
uint8_t MCU_PartNumber[16] = {'K', 'E', 'E', 'W', 'A', 'Y', '_', 'T', '0', '6', '_', 'M', 'E', 'T', 'E', 'R'};
uint8_t MCU_PartNumber[12] = {'H', 'J', 'Y', 'B', '-', '7', '5', '0', '0', 'T', 'F', 'T'};
/* internal program info */
const uint8_t DID_1024[13] =
......@@ -110,13 +120,36 @@ void S3_ServerCNTT(void)
if ( S3_ServerCnt >= S3_SERVER )
{
DIAG_InitParameter( );
UDS_Normal_Init( );
SessionType = DefaultSession;
}
else
{
++S3_ServerCnt;
}
}
if(Service27_DelayTimer_Enable == 1U)
{
if(Service27_DelayTimer >= 100U)
{
Service27_DelayTimer_Enable = 0U;
Attemptcnt -= AttemptMaxCnt - 1U;
Service27_DelayTimer = 0U;
}
else
{
++Service27_DelayTimer;
}
}
}
void Ser27_CreateRandomSeed(void)
{
do
{
Ser27_SeedRandomNumber = Ser27_SeedRandomNumber * 1103515245ul + 12345u;
} while ((Ser27_SeedRandomNumber == 0U) || (Ser27_SeedRandomNumber == 0xFFFFFFFFU));
}
uint8_t SerXXNRC12Filter(uint8_t insub, const uint8_t *supportsub, uint8_t size, uint8_t *index)
......@@ -311,7 +344,7 @@ void UDS_Service_10_Indication(uint16_t A_TA_type, uint16_t A_Length, uint8_t *A
NrcCode = SerXXNRC12Filter(SubFunction, Ser10Sub, sizeof(Ser10Sub), &Index);
}
if ((0 == NrcCode) && (DIAG_ID_Rx_FUN == FunorPhy) && (ProgrammingSession == Ser10Sub[Index]))
if ((0 == NrcCode) && (DIAG_ID_Rx_FUN == FunorPhy) && (ProgrammingSession == SubFunction))
{
NrcCode = subFunctionNotSupported;
}
......@@ -339,12 +372,8 @@ void UDS_Service_10_Indication(uint16_t A_TA_type, uint16_t A_Length, uint8_t *A
UDS_ISO14229_Transfer[4] = 200;
if (DefaultSession == SubFunction)
{
S3_ServerEN = 0;
UDS_Normal_Init();
SessionType = DefaultSession;
DIAG_InitParameter();
CAN_RX_SetEnable(&CAN_CH0_CanMsgOp, CAN_N_RX_Enable);
CAN_TX_SetEnable(&CAN_CH0_CanMsgTxOp, CAN_N_TX_Enable);//切会话解除
if (AbleResponseType == Ser10BanResponse)
{
......@@ -360,10 +389,6 @@ void UDS_Service_10_Indication(uint16_t A_TA_type, uint16_t A_Length, uint8_t *A
}
else if (ProgrammingSession == SubFunction)
{
S3_ServerEN = 1;
S3_Server_refresh = 1;
SessionType = ProgrammingSession;
if (AbleResponseType == Ser10BanResponse)
{
if (bit_is_clear(UDS_ISO14229_Transfer[0], 7))
......@@ -372,22 +397,17 @@ void UDS_Service_10_Indication(uint16_t A_TA_type, uint16_t A_Length, uint8_t *A
UDS_Service_Response(si, NEGATIVE_RSP, DIAG_ID_Tx, 1, (uint8_t *)(&NegRes.code));
Write_App_InValid(Jump_To_Boot_Need_Answer);
for (i = 0; i < 250; ++i)
{
__NOP();
}
__NVIC_SystemReset();
}
else
{
Write_App_InValid(Jump_To_Boot_No_Answer);
for (i = 0; i < 250; ++i)
{
__NOP();
}
__NVIC_SystemReset();
}
for (i = 0; i < 250; ++i)
{
__NOP();
}
__NVIC_SystemReset();
}
else
{
......@@ -403,8 +423,7 @@ void UDS_Service_10_Indication(uint16_t A_TA_type, uint16_t A_Length, uint8_t *A
}
else if (ExtendedDiagnosticSession == SubFunction)
{
S3_ServerEN = 1;
S3_Server_refresh = 1;
UDS_Normal_Init();
SessionType = ExtendedDiagnosticSession;
if (AbleResponseType == Ser10BanResponse)
......@@ -428,14 +447,12 @@ void UDS_Service_10_Indication(uint16_t A_TA_type, uint16_t A_Length, uint8_t *A
{
NegRes.code = NrcCode;
UDS_Service_Response(si, NEGATIVE_RSP, DIAG_ID_Tx, 1, (uint8_t *)(&NegRes.code));
return;
}
}
else
{
NegRes.code = NrcCode;
UDS_Service_Response(si, NEGATIVE_RSP, DIAG_ID_Tx, 1, (uint8_t *)(&NegRes.code));
return;
}
}
}
......@@ -522,10 +539,11 @@ void UDS_Service_11_Indication(uint16_t A_TA_type, uint16_t A_Length, uint8_t *A
{
UDS_Service_Response(si, POSITIVE_RSP, DIAG_ID_Tx, 1, UDS_ISO14229_Transfer);
}
i = 900;
i = 6400;
while (--i)
{
__NOP();
RTE_WDT_Clear();
}
__NVIC_SystemReset();
}
......@@ -557,7 +575,7 @@ static const uint8_t Ser22BanResponse = DisableResponseType;
static const uint8_t Ser22Sub [] = {0xFF};
static const uint8_t Ser22MinLen [] = {2};
static const uint8_t Ser22SubLen [] = {2};
static const uint16_t Ser22DIDList [] = {0xF195, 0xF193, 0xF180, 0xF187, 0x1024, 0x1028, 0xF184,/*0x2024*/ };
static const uint16_t Ser22DIDList [] = {0xF195, 0xF193, 0xF180, 0xF187, 0x1024, 0x1028, 0xF184, 0x5000 };
static const uint8_t Ser22SupportSession = DefaultMode | ProgrammingMode | ExtendedDiagnosticMode;
static const uint8_t Ser22SubSupportSession [] = {DefaultMode | ProgrammingMode | ExtendedDiagnosticMode};
void UDS_Service_22_Indication(uint16_t A_TA_type, uint16_t A_Length, uint8_t *A_Data)
......@@ -622,7 +640,7 @@ void UDS_Service_22_Indication(uint16_t A_TA_type, uint16_t A_Length, uint8_t *A
if (0 == NrcCode)
{
DID = ((uint16_t)UDS_ISO14229_Transfer[0] << 8) | UDS_ISO14229_Transfer[1];
NrcCode = SerXXNRC31DIDFilter(DID, Ser22DIDList, (sizeof(Ser22DIDList) / 2), &Index);
NrcCode = SerXXNRC31DIDFilter(DID, Ser22DIDList, (uint8_t)(sizeof(Ser22DIDList) / 2), &Index);
}
if (0 == NrcCode)
......@@ -653,11 +671,16 @@ void UDS_Service_22_Indication(uint16_t A_TA_type, uint16_t A_Length, uint8_t *A
break;
case 0xF187: // 读零件号
for (i = 0; i < 16; i++)
for (i = 0; i < 12; i++)
{
UDS_ISO14229_Transfer[i + 2] = MCU_PartNumber[i];
}
UDS_Service_Response(si, POSITIVE_RSP, DIAG_ID_Tx, 2 + 16, UDS_ISO14229_Transfer);
UDS_Service_Response(si, POSITIVE_RSP, DIAG_ID_Tx, 2 + 12, UDS_ISO14229_Transfer);
break;
case 0x5000U: // 读UUID
(void)memcpy(&UDS_ISO14229_Transfer[2], Diag_Write_Data.DID_5000, sizeof(Diag_Write_Data.DID_5000));
UDS_Service_Response(si, POSITIVE_RSP, DIAG_ID_Tx, 2 + sizeof(Diag_Write_Data.DID_5000), UDS_ISO14229_Transfer);
break;
case 0x1024: // 读内部版本号
......@@ -700,6 +723,284 @@ void UDS_Service_22_Indication(uint16_t A_TA_type, uint16_t A_Length, uint8_t *A
}
}
void UDS_Service_27_Indication(uint32_t A_TA_type, uint16_t A_Length, uint8_t *A_Data)
{
uint16_t i;
uint8_t NRC;
uint32_t KeyReceive;
uint8_t Seed_Array[4];
uint8_t SID = SecurityAccess;
uint8_t SubFunction = 0U;
uint16_t Data_Length = A_Length;
uint32_t Rx_ID = A_TA_type;
/* do not support functional address */
if (Rx_ID == DIAG_ID_Rx_FUN)
{
NRC = serviceNotSupported;
}
else
{
NRC = POSITIVE_RSP;
}
/* NRC7F */
if (0U == NRC)
{
if (SessionType != ExtendedDiagnosticSession)
{
NRC = serviceNotSupportedInActiveSession;
}
}
/* NRC13 */
if (0U == NRC)
{
if (Data_Length < 1U)
{
NRC = incorrectMessageLength;
}
}
/* NRC12 */
if (0U == NRC)
{
for (i = 0; i < Data_Length; i++)
{
UDS_ISO14229_Transfer[i] = *(A_Data + i);
}
SubFunction = UDS_ISO14229_Transfer[0];
if ((SubFunction != requestSeed_LV1) && (SubFunction != sendKey_LV1))
{
NRC = subFunctionNotSupported;
}
}
/* NRC13 */
if (0U == NRC)
{
if (SubFunction == requestSeed_LV1)
{
if (Data_Length != 1U)
{
NRC = incorrectMessageLength;
}
}
else
{
if (Data_Length != 5U)
{
NRC = incorrectMessageLength;
}
}
}
/* NRC24 */
if (0U == NRC)
{
if (SubFunction == sendKey_LV1)
{
if (Services27_Seed_Requested != 1U)
{
NRC = requestSequenceError;
}
}
}
/* NRC37 */
if (0U == NRC)
{
if (SubFunction == requestSeed_LV1)
{
if (Service27_DelayTimer_Enable == 1)
{
NRC = requiredTimeDelayNotExpired;
}
}
}
if (0U == NRC)
{
switch (SubFunction)
{
case requestSeed_LV1:
if (DiagLockFlag == NormalKeyUnlock)
{
UDS_ISO14229_Transfer[0] = requestSeed_LV1;
UDS_ISO14229_Transfer[1] = 0;
UDS_ISO14229_Transfer[2] = 0;
UDS_ISO14229_Transfer[3] = 0;
UDS_ISO14229_Transfer[4] = 0;
}
else
{
Ser27_CreateRandomSeed();
UDS_ISO14229_Transfer[1] = (uint8_t)(Ser27_SeedRandomNumber >> 24U);
UDS_ISO14229_Transfer[2] = (uint8_t)(Ser27_SeedRandomNumber >> 16U);
UDS_ISO14229_Transfer[3] = (uint8_t)(Ser27_SeedRandomNumber >> 8U);
UDS_ISO14229_Transfer[4] = (uint8_t)Ser27_SeedRandomNumber;
Services27_Seed_Requested = 1;
}
UDS_Service_Response(SID, POSITIVE_RSP, DIAG_ID_Tx, 5, UDS_ISO14229_Transfer);
Seed_Array[0] = UDS_ISO14229_Transfer[1];
Seed_Array[1] = UDS_ISO14229_Transfer[2];
Seed_Array[2] = UDS_ISO14229_Transfer[3];
Seed_Array[3] = UDS_ISO14229_Transfer[4];
GenerateKey = CalculateKey(Seed_Array);
break;
case sendKey_LV1:
Services27_Seed_Requested = 0U;
KeyReceive = Combine_U8_Into_U32(&UDS_ISO14229_Transfer[1]);
if (KeyReceive == GenerateKey)
{
DiagLockFlag = NormalKeyUnlock;
UDS_Service_Response(SID, POSITIVE_RSP, DIAG_ID_Tx, 1, UDS_ISO14229_Transfer);
}
else
{
Attemptcnt++;
if (Attemptcnt >= 3)
{
Service27_DelayTimer_Enable = 1U;
NRC = exceedNumberOfAttempts;
UDS_Service_Response(SID, NEGATIVE_RSP, DIAG_ID_Tx, 1, (uint8_t *)(&NRC));
}
else
{
NRC = invalidKey;
UDS_Service_Response(SID, NEGATIVE_RSP, DIAG_ID_Tx, 1, (uint8_t *)(&NRC));
}
}
break;
default:
NRC = subFunctionNotSupported;
UDS_Service_Response(SID, NEGATIVE_RSP, DIAG_ID_Tx, 1, (uint8_t *)(&NRC));
break;
}
}
else
{
if(Rx_ID == DIAG_ID_Rx_PHY)
{
UDS_Service_Response(SID, NEGATIVE_RSP, DIAG_ID_Tx, 1, (uint8_t *)(&NRC));
}
}
}
void UDS_Service_2E_Indication(uint32_t A_TA_type, uint16_t A_Length, uint8_t *A_Data)
{
uint16_t i = 0U;
uint8_t ret = 0U;
uint8_t NRC;
uint8_t SID = WriteDataByIdentifier;
uint16_t Data_Length = A_Length;
uint32_t Rx_ID = A_TA_type;
uint16_t DID = 0U;
/* do not support functional address */
if (Rx_ID == DIAG_ID_Rx_FUN)
{
NRC = serviceNotSupported;
}
else
{
NRC = POSITIVE_RSP;
}
/* NRC7F */
if (0U == NRC)
{
if (SessionType != ExtendedDiagnosticSession)
{
NRC = serviceNotSupportedInActiveSession;
}
}
/* NRC33 */
if (0U == NRC)
{
if (DiagLockFlag == NormalKeyLock)
{
NRC = securityAccessDenied;
}
}
/* NRC13 */
if (0U == NRC)
{
if (Data_Length < 3U)
{
NRC = incorrectMessageLength;
}
}
/* NRC31 */
if (0U == NRC)
{
for (i = 0; i < Data_Length; i++)
{
UDS_ISO14229_Transfer[i] = *(A_Data + i);
}
DID = ((uint16_t)UDS_ISO14229_Transfer[0] << 8) | (uint16_t)UDS_ISO14229_Transfer[1];
}
if (0U == NRC)
{
if(DID == 0x5000)
{
if(Data_Length != 34U)
{
NRC = incorrectMessageLength;
}
}
}
if (0U == NRC)
{
switch (DID)
{
case 0x5000U:
Diag_Write_Data.Flag = FLAG_APP_FLAG;
(void)memcpy(Diag_Write_Data.DID_5000, &UDS_ISO14229_Transfer[2], sizeof(Diag_Write_Data.DID_5000));
ret = Write_Data_Flash(FLASH_APP_RWDATA_INFO, sizeof(Diag_Write_Data), (uint8_t *)&Diag_Write_Data.Flag);
break;
default:
NRC = requestOutOfRange;
break;
}
if (0U == NRC)
{
if (ret == 0U)
{
UDS_Service_Response(SID, POSITIVE_RSP, DIAG_ID_Tx, 2U, UDS_ISO14229_Transfer);
}
else
{
NRC = generalProgrammingFailure;
UDS_Service_Response(SID, NEGATIVE_RSP, DIAG_ID_Tx, 1, &NRC);
}
}
else
{
UDS_Service_Response(SID, NEGATIVE_RSP, DIAG_ID_Tx, 1, &NRC);
}
}
else
{
if (Rx_ID == DIAG_ID_Rx_PHY)
{
UDS_Service_Response(SID, NEGATIVE_RSP, DIAG_ID_Tx, 1, &NRC);
}
}
}
/******************************************************************************
3E# - TesterPresent
******************************************************************************/
......@@ -800,12 +1101,34 @@ void UDS_Service_3E_Indication(uint16_t A_TA_type, uint16_t A_Length, uint8_t *A
}
}
void UDS_Normal_Init(void)
{
Services27_Seed_Requested = 0U;
DiagLockFlag = NormalKeyLock;
GenerateKey = 0U;
}
/*************IGN on,S3 Timeout****************/
void DIAG_InitParameter(void)
void UDS_Startup_Init(void)
{
S3_ServerCnt = 0;
S3_ServerEN = 0;
S3_Server_refresh = 0;
SessionType = DefaultSession;
Ser27_SeedRandomNumber = 20240728U;
Services27_Seed_Requested = 0U;
DiagLockFlag = NormalKeyLock;
GenerateKey = 0U;
Attemptcnt = 0U;
Service27_DelayTimer = 0U;
Service27_DelayTimer_Enable = 0U;
flash_read(FLASH_APP_RWDATA_INFO, sizeof(Diag_Write_Data), (uint8_t *)&Diag_Write_Data.Flag);
if(Diag_Write_Data.Flag != FLAG_APP_FLAG)
{
memset((uint8_t *)&Diag_Write_Data.Flag, 0xFFU, sizeof(Diag_Write_Data));
}
}
void Get_Into_630H_Update_MCU_Mode(void)
......@@ -818,3 +1141,60 @@ void Get_Into_630H_Update_MCU_Mode(void)
}
__NVIC_SystemReset();
}
uint32_t CalculateKey(uint8_t seed_array[])
{
uint8_t key_array[4];
uint32_t key_value;
key_array[0] = seed_array[0] | seed_array[3];
key_array[1] = (seed_array[1] >> 1) | (seed_array[2] << 1);
key_array[2] = (seed_array[2] >> 2) | (seed_array[1] << 2);
key_array[3] = (seed_array[3] >> 3) | (seed_array[0] << 3);
key_value = ((uint32_t)key_array[0] << 24U);
key_value = key_value | ((uint32_t)key_array[1] << 16U);
key_value = key_value | ((uint32_t)key_array[2] << 8U);
key_value = key_value | (uint32_t)key_array[3];
return (key_value);
}
/**
* @brief 按照传入的8bit数据的指针,向后查找4个8bit数据,按照顺序组合成一个32bit数据
*/
uint32_t Combine_U8_Into_U32(uint8_t *U8)
{
uint32_t ret = 0U;
uint32_t d_temp;
d_temp = (uint32_t)U8[0];
ret = (d_temp << 24) & 0xFF000000UL;
d_temp = (uint32_t)U8[1];
ret = ret | ((d_temp << 16) & 0x00FF0000UL);
d_temp = (uint32_t)U8[2];
ret = ret | ((d_temp << 8) & 0x0000FF00UL);
d_temp = (uint32_t)U8[3];
ret = ret | (d_temp & 0x000000FFUL);
return (ret);
}
uint8_t Write_Data_Flash(uint32_t addr, uint32_t size, uint8_t *data)
{
uint8_t ret;
erase_memory(FLASH_APP_RWDATA_INFO, (FLASH_APP_RWDATA_INFO + size));
ret = flash_write(FLASH_APP_RWDATA_INFO, size, data);
return (ret);
}
void erase_memory(uint32_t start_addr, uint32_t end_addr)
{
uint32_t i;
for (i = start_addr; i < end_addr; i += FLASH_PAGE_SIZE)
{
(void)EraseSector(i);
if((i % (FLASH_PAGE_SIZE * 16U)) == 0U) /* feed watch dog after erase 16 block */
{
RTE_WDT_Clear();
}
}
}
......@@ -29,12 +29,12 @@
/******************************************************************************
program version
*******************************************************************************/
#define SWV 0x105 // 0x100 = 1.00 software version 软件版本号
#define SWV 0x106 // 0x100 = 1.00 software version 软件版本号
#define HWV 0x110 // 0x100 = 1.00 hardware version 硬件版本号
#define BTV 0x104 // 0x100 = 1.00 bootloader version boot程序版本号
#define internal_version (105UL) /* 内部版本号 105 -> 1.05 */
#define internal_date (20240805UL) /* 内部版本日期 20240805 -> 2024.08.05 */
#define internal_version (106UL) /* 内部版本号 105 -> 1.05 */
#define internal_date (20240915UL) /* 内部版本日期 20240805 -> 2024.08.05 */
/**
*DFlash
......@@ -47,6 +47,8 @@
#define FLASH_APP_RODATA_INFO (0x00501C00UL) /* 存储只读DID信息 */
#define FLASH_APP_RWDATA_INFO (0x00502000UL) /* 存储可写的DID信息 */
#define FLASH_PAGE_SIZE (0x400UL) /* FLASH 页面大小 */
#define Data_Flash_Addr_BootValid_OFFSET 0x00000000
#define Data_Flash_Addr_DiagReceive_OFFSET 0x00002000
#define Data_Flash_Addr_Diag2E_OFFSET 0x00004000
......@@ -56,6 +58,8 @@
#define Jump_To_Boot_No_Answer 0xA77A8AA8
#define Flag_App_OTAStatus 0x3663B88B // ����Boot��ԭ������ΪOTA
#define FLAG_APP_FLAG (0xA77A5AA5U) /* 表示APP标识已写入 */
#define EnableInterrupts \
{ \
__asm CLI; \
......@@ -176,8 +180,6 @@
// #define sendKey_LV11 0x12
#define NormalKeyUnlock 0x01
#define NormalKeyLock 0x00
#define BootKeyUnlock 0x02
#define BootKeyLock 0x00
#define RequestSeedMaxCnt 0x04
#define AttemptMaxCnt 0x03
......@@ -338,26 +340,45 @@ typedef struct
uint8_t OpCode;
} DiagSendDataNeg;
void UDS_Service_10_Indication(uint16_t A_TA_type, uint16_t A_Length, uint8_t *A_Data);
void UDS_Service_11_Indication(uint16_t A_TA_type, uint16_t A_Length, uint8_t *A_Data);
void UDS_Service_22_Indication(uint16_t A_TA_type, uint16_t A_Length, uint8_t *A_Data);
void UDS_Service_3E_Indication(uint16_t A_TA_type, uint16_t A_Length, uint8_t *A_Data);
void S3_ServerCNTT(void);
extern void DIAG_InitParameter(void);
typedef struct
{
uint32_t Flag;
uint8_t DID_5000[32]; /* programming date */
// uint8_t fill_data[17]; /* 用于保证该结构体长度是4的倍数 */
} Diag_Write_Data_t;
extern void UDS_Service_10_Indication(uint16_t A_TA_type, uint16_t A_Length, uint8_t *A_Data);
extern void UDS_Service_11_Indication(uint16_t A_TA_type, uint16_t A_Length, uint8_t *A_Data);
extern void UDS_Service_22_Indication(uint16_t A_TA_type, uint16_t A_Length, uint8_t *A_Data);
extern void UDS_Service_27_Indication(uint32_t A_TA_type, uint16_t A_Length, uint8_t *A_Data);
extern void UDS_Service_2E_Indication(uint32_t A_TA_type, uint16_t A_Length, uint8_t *A_Data);
extern void UDS_Service_3E_Indication(uint16_t A_TA_type, uint16_t A_Length, uint8_t *A_Data);
extern void S3_ServerCNTT(void);
extern void UDS_Normal_Init(void);
extern void UDS_Startup_Init(void);
typedef void (*InitFunction)(void);
/***********Local Functin*************/
uint8_t GetCurrentSession(void);
uint8_t SerXXNRC12Filter(uint8_t insub, const uint8_t *supportsub, uint8_t size, uint8_t *index);
uint8_t SerXXNRC13Filter(uint8_t type, uint8_t serlength, const uint8_t *length, uint8_t index);
uint8_t SerXXNRC22Filter(void);
uint8_t SerXXNRC31DIDFilter(uint16_t inDID, const uint16_t *DIDList, uint8_t size, uint8_t *index);
uint8_t SerXXNRC7EFilter(const uint8_t *SubSupportSession, uint8_t index);
uint8_t SerXXNRC7FFilter(uint8_t SupportSession);
void Write_App_InValid(uint32_t m32);
extern uint8_t GetCurrentSession(void);
extern uint8_t SerXXNRC12Filter(uint8_t insub, const uint8_t *supportsub, uint8_t size, uint8_t *index);
extern uint8_t SerXXNRC13Filter(uint8_t type, uint8_t serlength, const uint8_t *length, uint8_t index);
extern uint8_t SerXXNRC22Filter(void);
extern uint8_t SerXXNRC31DIDFilter(uint16_t inDID, const uint16_t *DIDList, uint8_t size, uint8_t *index);
extern uint8_t SerXXNRC7EFilter(const uint8_t *SubSupportSession, uint8_t index);
extern uint8_t SerXXNRC7FFilter(uint8_t SupportSession);
extern void Write_App_InValid(uint32_t m32);
extern void Get_Into_630H_Update_MCU_Mode(void);
extern void Check_MCU_Info_in_630H(void);
extern void Ser27_CreateRandomSeed(void);
extern uint32_t CalculateKey(uint8_t seed_array[]);
extern uint32_t Combine_U8_Into_U32(uint8_t *U8);
extern uint8_t Write_Data_Flash(uint32_t addr, uint32_t size, uint8_t *data);
extern void erase_memory(uint32_t start_addr, uint32_t end_addr);
#endif
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