Commit d2dfa673 authored by 王雅楠's avatar 王雅楠

Merge branch 'wangyanan' into 'dev'

Wangyanan

See merge request !53
parents e5b12ed6 395f6416
...@@ -2765,16 +2765,6 @@ static const uint16_t PICList_ESpeed_NIGHT[] = { ...@@ -2765,16 +2765,6 @@ static const uint16_t PICList_ESpeed_NIGHT[] = {
Pic_0716_782_125, Pic_0716_782_125,
}; };
static const uint16_t PICList_Fuel[] = { static const uint16_t PICList_Fuel[] = {
Pic_0554_315_473,
Pic_0555_366_473,
Pic_0556_426_473,
Pic_0557_469_473,
Pic_0558_514_473,
Pic_0559_550_473,
Pic_0560_586_473,
Pic_0561_623_473,
};
static const uint16_t PICList_Fuel_RED[] = {
Pic_0562_315_473, Pic_0562_315_473,
Pic_0555_366_473, Pic_0555_366_473,
Pic_0556_426_473, Pic_0556_426_473,
...@@ -2784,6 +2774,16 @@ static const uint16_t PICList_Fuel_RED[] = { ...@@ -2784,6 +2774,16 @@ static const uint16_t PICList_Fuel_RED[] = {
Pic_0560_586_473, Pic_0560_586_473,
Pic_0561_623_473, Pic_0561_623_473,
}; };
// static const uint16_t PICList_Fuel_RED[] = {
// Pic_0562_315_473,
// Pic_0555_366_473,
// Pic_0556_426_473,
// Pic_0557_469_473,
// Pic_0558_514_473,
// Pic_0559_550_473,
// Pic_0560_586_473,
// Pic_0561_623_473,
// };
static const uint16_t PICList_Fuel_SelfCheck[] ={ static const uint16_t PICList_Fuel_SelfCheck[] ={
Pic_0554_315_473, Pic_0554_315_473,
Pic_0555_366_473, Pic_0555_366_473,
...@@ -2845,7 +2845,14 @@ static void AMT630H_GUI_Light() ...@@ -2845,7 +2845,14 @@ static void AMT630H_GUI_Light()
} }
if(Get_TelltalesLedSts(em_LED_Coolant_Temperature)) if(Get_TelltalesLedSts(em_LED_Coolant_Temperature))
{ {
SetPagePic(GRAPHICS_PAGE_0, Pic_0741_616_20); if(FLASH_SYNC_1Hz)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0741_616_20);/*水温灯报警闪烁1HZ*/
}
else
{
;
}
} }
if(Get_TelltalesLedSts(em_LED_WIFI)) if(Get_TelltalesLedSts(em_LED_WIFI))
{ {
...@@ -2953,23 +2960,31 @@ static void AMT630H_GUI_TIME(uint16_t Hour, uint16_t Minute) ...@@ -2953,23 +2960,31 @@ static void AMT630H_GUI_TIME(uint16_t Hour, uint16_t Minute)
// } // }
/*燃油显示函数*/ /*燃油显示函数*/
uint8_t g_u16_GUI_PerFuelLevel = 0; uint8_t g_u16_GUI_PerFuelLevel = 1;
static void AMT630H_GUI_Fuel(uint8_t Fuel) static void AMT630H_GUI_Fuel(uint8_t Fuel)
{ {
/*外部传参燃油处于数组第几格*/ /*外部传参燃油处于数组第几格*/
/*R>83且处于非开路状态时 黄色燃油灯闪烁*/ /*R>83且处于非开路状态时 黄色燃油灯闪烁*/
/*R开路状态时 黄色燃油灯闪烁*/ /*R开路状态时 黄色燃油灯闪烁*/
/*以上两种情况黄色燃油灯闪烁的频率不同*/ /*以上两种情况黄色燃油灯闪烁的频率不同*/
static uint8_t s_FuelLowTime = 0U;
uint8_t FuelLevel; uint8_t FuelLevel;
FuelLevel = Fuel; FuelLevel = Fuel;
static uint8_t s_FuelLowTime = 0U; if(Fuel == 0)
{
FuelLevel = 1;
}
else
{
;
}
if (g_u8Display_Mode == ModeDAY) if (g_u8Display_Mode == ModeDAY)
{ {
SetPagePic(GRAPHICS_PAGE_0, Pic_0553_315_473); /*燃油格*/ SetPagePic(GRAPHICS_PAGE_0, Pic_0553_315_473); /*燃油格*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0549_299_533); /*E*/ SetPagePic(GRAPHICS_PAGE_0, Pic_0549_299_533); /*E*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0550_715_533); /*F*/ SetPagePic(GRAPHICS_PAGE_0, Pic_0550_715_533); /*F*/
/*燃油桶闪烁*/ /*开路状态黄色燃油灯 1HZ闪烁*/
if (FuelLevel == 0) if (Fuel == 0)
{ {
if (FLASH_SYNC_1Hz) if (FLASH_SYNC_1Hz)
{ {
...@@ -2977,7 +2992,7 @@ static void AMT630H_GUI_Fuel(uint8_t Fuel) ...@@ -2977,7 +2992,7 @@ static void AMT630H_GUI_Fuel(uint8_t Fuel)
} }
s_FuelLowTime = 0; s_FuelLowTime = 0;
} }
else if (FuelLevel == 1) else if (Fuel == 1)
{ {
s_FuelLowTime++; s_FuelLowTime++;
if (s_FuelLowTime <= 15) if (s_FuelLowTime <= 15)
...@@ -3000,7 +3015,7 @@ static void AMT630H_GUI_Fuel(uint8_t Fuel) ...@@ -3000,7 +3015,7 @@ static void AMT630H_GUI_Fuel(uint8_t Fuel)
SetPagePic(GRAPHICS_PAGE_0, Pic_0662_315_473); /*燃油格*/ SetPagePic(GRAPHICS_PAGE_0, Pic_0662_315_473); /*燃油格*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0549_299_533); /*E*/ SetPagePic(GRAPHICS_PAGE_0, Pic_0549_299_533); /*E*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0660_715_533); /*F*/ SetPagePic(GRAPHICS_PAGE_0, Pic_0660_715_533); /*F*/
if (FuelLevel == 0) if (Fuel == 0)
{ {
if (FLASH_SYNC_1Hz) if (FLASH_SYNC_1Hz)
{ {
...@@ -3008,7 +3023,7 @@ static void AMT630H_GUI_Fuel(uint8_t Fuel) ...@@ -3008,7 +3023,7 @@ static void AMT630H_GUI_Fuel(uint8_t Fuel)
} }
s_FuelLowTime = 0; s_FuelLowTime = 0;
} }
else if (FuelLevel == 1) else if (Fuel == 1)
{ {
s_FuelLowTime++; s_FuelLowTime++;
if (s_FuelLowTime <= 15) if (s_FuelLowTime <= 15)
...@@ -3027,13 +3042,12 @@ static void AMT630H_GUI_Fuel(uint8_t Fuel) ...@@ -3027,13 +3042,12 @@ static void AMT630H_GUI_Fuel(uint8_t Fuel)
} }
} }
/*燃油格数走格*/ /*燃油格数走格*/
if (FuelLevel > 0) if (FuelLevel > 0)
{ {
if (FuelLevel != g_u16_GUI_PerFuelLevel) if (FuelLevel != g_u16_GUI_PerFuelLevel)
{ {
for (uint8_t i = 0; i <= g_u16_GUI_PerFuelLevel; i++) for (uint8_t i = 0; i < g_u16_GUI_PerFuelLevel; i++)
{ {
SetPagePic(GRAPHICS_PAGE_0, PICList_Fuel[i]); SetPagePic(GRAPHICS_PAGE_0, PICList_Fuel[i]);
} }
...@@ -3051,27 +3065,60 @@ static void AMT630H_GUI_Fuel(uint8_t Fuel) ...@@ -3051,27 +3065,60 @@ static void AMT630H_GUI_Fuel(uint8_t Fuel)
; ;
} }
} }
else if (FuelLevel == g_u16_GUI_PerFuelLevel) if (FuelLevel == g_u16_GUI_PerFuelLevel)
{ {
g_u16_GUI_PerFuelLevel = FuelLevel; g_u16_GUI_PerFuelLevel = FuelLevel;
for (uint8_t i = 0; i <= g_u16_GUI_PerFuelLevel; i++) for (uint8_t i = 0; i < g_u16_GUI_PerFuelLevel; i++)
{ {
SetPagePic(GRAPHICS_PAGE_0, PICList_Fuel[i]); SetPagePic(GRAPHICS_PAGE_0, PICList_Fuel[i]);
} }
} }
}
else
{
;
}
}
uint16_t g_u16PerFuel_SelfCheck = 0;
/*燃油自检函数*/
static void AMT630H_GUI_Fuel_SelfCheck(uint8_t Fuel)
{
uint8_t FuelLevel;
FuelLevel = Fuel;
if(Fuel == 1)
{
FuelLevel = 2;
} }
else else
{
;
}
if (g_u8Display_Mode == ModeDAY)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0553_315_473); /*燃油格*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0549_299_533); /*E*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0550_715_533); /*F*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0551_503_529); /*黑色燃油灯*/
}
else if (g_u8Display_Mode == ModeNIGHT)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0662_315_473); /*燃油格*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0549_299_533); /*E*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0660_715_533); /*F*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0661_503_529); /*白色燃油灯*/
}
/*开机自检燃油走格*/
if (FuelLevel > 0)
{ {
if (FuelLevel != g_u16_GUI_PerFuelLevel) if (FuelLevel != g_u16_GUI_PerFuelLevel)
{ {
for (uint8_t i = 0; i <= g_u16_GUI_PerFuelLevel; i++) for (uint8_t i = 0; i < g_u16_GUI_PerFuelLevel; i++)
{ {
{ SetPagePic(GRAPHICS_PAGE_0, PICList_Fuel_SelfCheck[i]);
SetPagePic(GRAPHICS_PAGE_0, PICList_Fuel_RED[i]);
}
} }
if (FuelLevel > g_u16_GUI_PerFuelLevel) if (FuelLevel > g_u16_GUI_PerFuelLevel)
{ {
g_u16_GUI_PerFuelLevel++; g_u16_GUI_PerFuelLevel++;
...@@ -3084,60 +3131,74 @@ static void AMT630H_GUI_Fuel(uint8_t Fuel) ...@@ -3084,60 +3131,74 @@ static void AMT630H_GUI_Fuel(uint8_t Fuel)
{ {
; ;
} }
} }
else if (FuelLevel == g_u16_GUI_PerFuelLevel) if (FuelLevel == g_u16_GUI_PerFuelLevel)
{ {
g_u16_GUI_PerFuelLevel = FuelLevel; g_u16_GUI_PerFuelLevel = FuelLevel;
for (uint8_t i = 0; i <= g_u16_GUI_PerFuelLevel; i++) for (uint8_t i = 0; i < g_u16_GUI_PerFuelLevel; i++)
{ {
{ SetPagePic(GRAPHICS_PAGE_0, PICList_Fuel_SelfCheck[i]);
SetPagePic(GRAPHICS_PAGE_0, PICList_Fuel_RED[i]);
}
} }
} }
}
}
/*燃油自检函数*/
static void AMT630H_GUI_Fuel_SelfCheck(uint8_t Fuel)
{
uint8_t FuelLevel;
FuelLevel = Fuel;
if (g_u8Display_Mode == ModeDAY)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0553_315_473); /*燃油格*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0549_299_533); /*E*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0550_715_533); /*F*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0551_503_529); /*黑色燃油灯*/
} }
else if (g_u8Display_Mode == ModeNIGHT) else
{ {
SetPagePic(GRAPHICS_PAGE_0, Pic_0662_315_473); /*燃油格*/ SetPagePic(GRAPHICS_PAGE_0, Pic_0562_315_473);/*燃油红区*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0549_299_533); /*E*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0660_715_533); /*F*/
SetPagePic(GRAPHICS_PAGE_0, Pic_0661_503_529); /*白色燃油灯*/
} }
/*燃油格数走格*/
if (FuelLevel > g_u16_GUI_PerFuelLevel)
{ // if (FuelLevel != g_u16PerFuel_SelfCheck)
g_u16_GUI_PerFuelLevel++; // {
} // if(g_u16PerFuel_SelfCheck == 0)
else if ((FuelLevel < g_u16_GUI_PerFuelLevel) && (g_u16_GUI_PerFuelLevel != 0)) // {
{ // SetPagePic(GRAPHICS_PAGE_0, Pic_0562_315_473);
g_u16_GUI_PerFuelLevel--; // }
} // else
else // {
{ // for (uint8_t i = 0; i < g_u16PerFuel_SelfCheck; i++)
; // {
} // SetPagePic(GRAPHICS_PAGE_0, PICList_Fuel_SelfCheck[i]);
for (uint8_t i = 0; i < g_u16_GUI_PerFuelLevel; i++) // }
{
SetPagePic(GRAPHICS_PAGE_0, PICList_Fuel_SelfCheck[i]); // if (FuelLevel > g_u16PerFuel_SelfCheck)
} // {
// g_u16PerFuel_SelfCheck++;
// }
// else
// {
// ;
// }
// }
// }
// else
// {
// for (uint8_t i = 0; i < g_u16_GUI_PerFuelLevel; i++)
// {
// SetPagePic(GRAPHICS_PAGE_0, PICList_Fuel_SelfCheck[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
// {
// ;
// }
// for (uint8_t i = 0; i < g_u16_GUI_PerFuelLevel; i++)
// {
// SetPagePic(GRAPHICS_PAGE_0, PICList_Fuel_SelfCheck[i]);
// }
} }
......
...@@ -5,6 +5,10 @@ ...@@ -5,6 +5,10 @@
#include "Line_In\Line_In_user.h" #include "Line_In\Line_In_user.h"
#include "Components.h" #include "Components.h"
uint8_t ECU_Engine_Temperature_flag = 0;
static Tellib_uint16_t LED_Turn_Left_Judgement(void); static Tellib_uint16_t LED_Turn_Left_Judgement(void);
static void LED_Turn_Left_Execution(Tellib_uint16_t led_status); static void LED_Turn_Left_Execution(Tellib_uint16_t led_status);
static Tellib_uint16_t LED_Turn_Right_Judgement(void); static Tellib_uint16_t LED_Turn_Right_Judgement(void);
...@@ -228,7 +232,7 @@ static Tellib_uint16_t LED_TCS_Judgement(void) ...@@ -228,7 +232,7 @@ static Tellib_uint16_t LED_TCS_Judgement(void)
} }
else else
{ {
if(Get_CAN_CH0_ID_37B_Sig_TCS_Work_Mode == 0x0) if(Get_CAN_CH0_ID_37B_Sig_TCS_Work_Mode() == 0x0)
{ {
if(Get_CAN_CH0_ID_37B_Sig_TCS_Warning_Lamp() == 0x1) if(Get_CAN_CH0_ID_37B_Sig_TCS_Warning_Lamp() == 0x1)
{ {
...@@ -243,24 +247,13 @@ static Tellib_uint16_t LED_TCS_Judgement(void) ...@@ -243,24 +247,13 @@ static Tellib_uint16_t LED_TCS_Judgement(void)
LED_STATE = 0u; LED_STATE = 0u;
} }
} }
else if(Get_CAN_CH0_ID_37B_Sig_TCS_Work_Mode == 0x0) else if(Get_CAN_CH0_ID_37B_Sig_TCS_Work_Mode() == 0x1u)
{ {
if(Get_CAN_CH0_ID_37B_Sig_TCS_Warning_Lamp() == 0x1) LED_STATE = 2u;/*TCS/亮*/
{
LED_STATE = 2u;/*TCS/亮*/
}
else if(Get_CAN_CH0_ID_37B_Sig_TCS_Warning_Lamp() == 0x0)
{
LED_STATE = 0u;
}
else
{
LED_STATE = 0u;
}
} }
else else
{ {
; LED_STATE = 0u;
} }
} }
return LED_STATE; return LED_STATE;
...@@ -342,34 +335,69 @@ static void LED_Fuel_Level_Low_Execution(Tellib_uint16_t led_status) ...@@ -342,34 +335,69 @@ static void LED_Fuel_Level_Low_Execution(Tellib_uint16_t led_status)
{ {
} }
// uint16_t ECU_Engine_Temperature_R =0;
// uint32_t test_ECU_Engine_Temperature =0;
/*信号来源:ECU_101 +硬线-P11 阻值 CAN>硬线*/ /*信号来源:ECU_101 +硬线-P11 阻值 CAN>硬线*/
static Tellib_uint16_t LED_Coolant_Temperature_Judgement(void) static Tellib_uint16_t LED_Coolant_Temperature_Judgement(void)
{ {
Tellib_uint16_t LED_STATE = 0u; Tellib_uint16_t LED_STATE = 0u;
if (CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CH0_101_Msg_Count) == CAN_SIG_LOST) if (CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CH0_101_Msg_Count) == CAN_SIG_LOST)
{ {
LED_STATE = 0u; // ECU_Engine_Temperature_R = ADC_Read_Signal(ADC_CH_COOLANT_TEMP1_R);
if(Line_In_Get_Status(LINE_IN_Coolant_Temperature)) if(ADC_Read_Signal(ADC_CH_COOLANT_TEMP1_R) <= 20)
{ {
ECU_Engine_Temperature_flag = 1;
LED_STATE = 1u; LED_STATE = 1u;
} }
else else if(ADC_Read_Signal(ADC_CH_COOLANT_TEMP1_R) >= 23)
{ {
ECU_Engine_Temperature_flag = 0;
LED_STATE = 0u; LED_STATE = 0u;
} }
else
{
if(ECU_Engine_Temperature_flag == 1)
{
LED_STATE = 1u;
}
else if(ECU_Engine_Temperature_flag == 0)
{
LED_STATE = 0u;
}
else
{
LED_STATE = 0u;
}
}
} }
else else
{ {
if(Get_CAN_CH0_ID_101_Sig_ECU_Engine_Temperature_State() == 0x01UL) // test_ECU_Engine_Temperature = Get_CAN_CH0_ID_101_Sig_ECU_Engine_Temperature();
if(Get_CAN_CH0_ID_101_Sig_ECU_Engine_Temperature() >= 120 )
{ {
LED_STATE = 1u; ECU_Engine_Temperature_flag = 1;
LED_STATE = 1u;
} }
else else if(Get_CAN_CH0_ID_101_Sig_ECU_Engine_Temperature() <= 118)
{ {
ECU_Engine_Temperature_flag = 0;
LED_STATE = 0u; LED_STATE = 0u;
} }
else
{
if(ECU_Engine_Temperature_flag == 1)
{
LED_STATE = 1u;
}
else if(ECU_Engine_Temperature_flag == 0)
{
LED_STATE = 0u;
}
else
{
LED_STATE = 0u;
}
}
} }
return LED_STATE; return LED_STATE;
} }
......
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