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

🎈 perf:优化车速、转速、燃油同时结束自检

parent 12a6fe03
......@@ -20,7 +20,7 @@ User definitions
typedef unsigned short MD_STATUS;
#define HAS_BOOTLOADER (1u) // 仅仿真App时设置为0
#define HAS_BOOTLOADER (0u) // 仅仿真App时设置为0
#define APP_BASE (0x0000C400ul)
/* Status list definition */
......
......@@ -9,11 +9,10 @@ uint8_t g_u8UnitSetting = Metric ;
uint8_t g_u8SelfCheck = 0;/*自检*/
uint16_t g_u16fuelnumberup = 0;
uint16_t g_u16fuelnumberdown =7 ;
uint16_t g_u16vspeednumberup = 0;
uint16_t g_u16vspeednumberdown = 200;
uint16_t g_u16vspeednumberdown = 600;
uint16_t g_u16espeednumberup = 0;
uint16_t g_u16espeednumberdown = 12000;
uint16_t g_u16espeednumberdown = 600;
//自检函数
void AMT630H_GUI_BACKGRAND_SelfCheck(void);
......@@ -2555,6 +2554,16 @@ static const uint16_t PICList_Fuel[] = {
Pic_0560_586_473,
Pic_0561_623_473,
};
static const uint16_t PICList_Fuel_SelfCheck[] ={
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 void AMT630H_GUI_Light()
......@@ -2781,10 +2790,12 @@ static void AMT630H_GUI_Fuel(uint8_t Fuel)
}
else if (FuelLevel == g_u16_GUI_PerFuelLevel)
{
;
}
}
else if (FuelLevel == g_u16_GUI_PerFuelLevel)
{
}
for (uint8_t i = 0; i < g_u16_GUI_PerFuelLevel; i++)
......@@ -2798,6 +2809,65 @@ static void AMT630H_GUI_Fuel(uint8_t Fuel)
}
}
/*燃油自检函数*/
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)
{
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 > 1)
{
if (FuelLevel != g_u16_GUI_PerFuelLevel)
{
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
{
;
}
}
else if (FuelLevel == g_u16_GUI_PerFuelLevel)
{
SetPagePic(GRAPHICS_PAGE_0, Pic_0554_315_473);
}
for (uint8_t i = 0; i < g_u16_GUI_PerFuelLevel; i++)
{
SetPagePic(GRAPHICS_PAGE_0, PICList_Fuel_SelfCheck[i]);
}
}
else
{
;
}
}
/*电压显示函数*/
static void AMT630H_GUI_Voltage(uint16_t Voltage)
{
......@@ -3355,35 +3425,27 @@ void AMT630H_GUI_BACKGRAND_SelfCheck()
// AMT630H_GUI_Telephone(Telephone);
AMT630H_GUI_Voltage((ADC_Read_Signal(ADC_CH_KL30_VOLTAGE)) / 10);
AMT630H_GUI_ODO(Get_ODO_Value() / 10, 0);
if(g_u16fuelnumberup < 7)
if(g_u16fuelnumberup < 1200)
{
g_u16fuelnumberup++;
AMT630H_GUI_Fuel(g_u16fuelnumberup);/*初始化g_u16fuelnumberup = 0*/
g_u16fuelnumberup+=6;
AMT630H_GUI_Fuel_SelfCheck(g_u16fuelnumberup/150);/*初始化g_u16fuelnumberup = 0*/
}
else
{
if(g_u16fuelnumberdown >= 1)
{
AMT630H_GUI_Fuel(g_u16fuelnumberdown);/*初始化g_u16fuelnumberdown = 7*/
g_u16fuelnumberdown--;/*g_u16fuelnumberdown=0燃油自检结束*/
}
else
{
;
}
;
}
if(g_u16vspeednumberup < 200)
if(g_u16vspeednumberup < 600)
{
AMT630H_GUI_VSpeed(g_u16vspeednumberup);/*初始化g_u16vspeednumberup = 0*/
g_u16vspeednumberup++;
AMT630H_GUI_VSpeed(g_u16vspeednumberup/3);/*初始化g_u16vspeednumberup = 0*/
g_u16vspeednumberup+=6;
}
else
{
if(g_u16vspeednumberdown >0)
{
g_u16vspeednumberdown--;/*初始化g_u16vspeednumberup=200*/
AMT630H_GUI_VSpeed(g_u16vspeednumberdown);/*if g_u16vspeednumberup=0 车速自检结束*/
g_u16vspeednumberdown-=6;/*初始化g_u16vspeednumberup=1200*/
AMT630H_GUI_VSpeed(g_u16vspeednumberdown/3);/*if g_u16vspeednumberup=0 车速自检结束*/
}
else
{
......@@ -3391,23 +3453,23 @@ void AMT630H_GUI_BACKGRAND_SelfCheck()
}
}
if(g_u16espeednumberup <= 12000)
if(g_u16espeednumberup <= 600)
{
AMT630H_GUI_ESpeed(g_u16espeednumberup);/*初始化g_u16espeednumberup = 0*/
g_u16espeednumberup+=1000;
AMT630H_GUI_ESpeed(g_u16espeednumberup*20);/*初始化g_u16espeednumberup = 0*/
g_u16espeednumberup+=6;
}
else
{
if(g_u16espeednumberdown > 0)
{
AMT630H_GUI_ESpeed(g_u16espeednumberdown);/*初始化g_u16espeednumberdown = 12000*/
g_u16espeednumberdown-=1000;/*g_u16espeednumberdown = 0 转速自检结束*/
AMT630H_GUI_ESpeed(g_u16espeednumberdown*20);/*初始化g_u16espeednumberdown = 600*/
g_u16espeednumberdown-=6;/*g_u16espeednumberdown = 0 转速自检结束*/
}
}
if(g_u16fuelnumberdown == 0)
if(g_u16fuelnumberup == 1200)
{
AMT630H_GUI_Fuel(g_u16fuelnumberdown);
AMT630H_GUI_Fuel(8);
}
if(g_u16vspeednumberdown == 0)
{
......@@ -3417,7 +3479,7 @@ void AMT630H_GUI_BACKGRAND_SelfCheck()
{
AMT630H_GUI_ESpeed(g_u16espeednumberdown);
}
if((g_u16fuelnumberdown == 0)&&(g_u16vspeednumberdown == 0)&&(g_u16espeednumberdown == 0))
if((g_u16fuelnumberup == 1200)&&(g_u16vspeednumberdown == 0)&&(g_u16espeednumberdown == 0))
{
g_u8SelfCheck = 1;/*自检结束标志*/
}
......
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