Commit d9d80769 authored by 李俭双's avatar 李俭双

feat:完善显示逻辑

parent 0afdb47e
...@@ -66,6 +66,7 @@ void Clear_Bu98(void) ...@@ -66,6 +66,7 @@ void Clear_Bu98(void)
void Gauge_Service(void) void Gauge_Service(void)
{ {
static uint16_t VSpeed_Count = 0u; static uint16_t VSpeed_Count = 0u;
uint32_t i = 0;
if (ClearODO_Flag == 1) if (ClearODO_Flag == 1)
{ {
if ( Common_Get_IG_Sts( ) == COMMON_POWER_ON ) if ( Common_Get_IG_Sts( ) == COMMON_POWER_ON )
...@@ -83,6 +84,12 @@ void Gauge_Service(void) ...@@ -83,6 +84,12 @@ void Gauge_Service(void)
{ {
if (Common_GetIgnOnTime() >= 3000) if (Common_GetIgnOnTime() >= 3000)
{ {
//for(i = 0; i < BU98R10_DDRAM_SIZE; i ++)
//{
// BU98R10Chip0DDRAM.Byte[i] = 1;
// BU98R10Chip1DDRAM.Byte[i] = 1;
//}
i = Get_Trip_Value();
if (VSpeed_Count < 3) if (VSpeed_Count < 3)
{ {
VSpeed_Count++; VSpeed_Count++;
......
...@@ -14,9 +14,9 @@ uint8_t DTC_DISTimer = 0; ...@@ -14,9 +14,9 @@ uint8_t DTC_DISTimer = 0;
const uint8_t SEG_DISPLAY_NUMBER0[] = {0x3Fu, 0x06u, 0x5Bu, 0x4Fu, 0x66u, 0x6Du, 0x7Du, 0x07u, 0x7Fu, 0x6Fu, 0x00, 0x40, 0x73, 0x77, 0x7C, 0x39, 0x5E, 0x79, 0x71}; const uint8_t SEG_DISPLAY_NUMBER0[] = {0x3Fu, 0x06u, 0x5Bu, 0x4Fu, 0x66u, 0x6Du, 0x7Du, 0x07u, 0x7Fu, 0x6Fu, 0x00, 0x40, 0x73, 0x77, 0x7C, 0x39, 0x5E, 0x79, 0x71};
const uint8_t SEG_UNDISPLAY_NUMBER0[] = {0x00u, 0x06u, 0x5Bu, 0x4Fu, 0x66u, 0x6Du, 0x7Du, 0x07u, 0x7Fu, 0x6Fu}; const uint8_t SEG_UNDISPLAY_NUMBER0[] = {0x00u, 0x06u, 0x5Bu, 0x4Fu, 0x66u, 0x6Du, 0x7Du, 0x07u, 0x7Fu, 0x6Fu};
void SEG_SET_DTC_NUM(uint16_t num) void SEG_SET_DTC_NUM(uint32_t num)
{ {
uint16_t Num = 0; uint32_t Num = 0;
uint8_t m8 = 0; uint8_t m8 = 0;
Num = (num & 0xFF000000) >> 24; Num = (num & 0xFF000000) >> 24;
m8 = SEG_DISPLAY_NUMBER0[Num]; m8 = SEG_DISPLAY_NUMBER0[Num];
...@@ -200,59 +200,59 @@ void SEG_SET_DTC_NUM(uint16_t num) ...@@ -200,59 +200,59 @@ void SEG_SET_DTC_NUM(uint16_t num)
if (Bit_Is_Set(m8, 0)) if (Bit_Is_Set(m8, 0))
{ {
IC1_SEG064 = IC_SEG_ON; IC1_SEG042 = IC_SEG_ON;
} }
else else
{ {
IC1_SEG064 = IC_SEG_OFF; IC1_SEG042 = IC_SEG_OFF;
} }
if (Bit_Is_Set(m8, 1)) if (Bit_Is_Set(m8, 1))
{ {
IC1_SEG063 = IC_SEG_ON; IC1_SEG041 = IC_SEG_ON;
} }
else else
{ {
IC1_SEG063 = IC_SEG_OFF; IC1_SEG041 = IC_SEG_OFF;
} }
if (Bit_Is_Set(m8, 2)) if (Bit_Is_Set(m8, 2))
{ {
IC1_SEG061 = IC_SEG_ON; IC1_SEG039 = IC_SEG_ON;
} }
else else
{ {
IC1_SEG061 = IC_SEG_OFF; IC1_SEG039 = IC_SEG_OFF;
} }
if (Bit_Is_Set(m8, 3)) if (Bit_Is_Set(m8, 3))
{ {
IC1_SEG067 = IC_SEG_ON; IC1_SEG038 = IC_SEG_ON;
} }
else else
{ {
IC1_SEG067 = IC_SEG_OFF; IC1_SEG038 = IC_SEG_OFF;
} }
if (Bit_Is_Set(m8, 4)) if (Bit_Is_Set(m8, 4))
{ {
IC1_SEG066 = IC_SEG_ON; IC1_SEG044 = IC_SEG_ON;
} }
else else
{ {
IC1_SEG066 = IC_SEG_OFF; IC1_SEG044 = IC_SEG_OFF;
} }
if (Bit_Is_Set(m8, 5)) if (Bit_Is_Set(m8, 5))
{ {
IC1_SEG065 = IC_SEG_ON; IC1_SEG043 = IC_SEG_ON;
} }
else else
{ {
IC1_SEG065 = IC_SEG_OFF; IC1_SEG043 = IC_SEG_OFF;
} }
if (Bit_Is_Set(m8, 6)) if (Bit_Is_Set(m8, 6))
{ {
IC1_SEG062 = IC_SEG_ON; IC1_SEG040 = IC_SEG_ON;
} }
else else
{ {
IC1_SEG062 = IC_SEG_OFF; IC1_SEG040 = IC_SEG_OFF;
} }
} }
/**@brief 指示灯显示函数 /**@brief 指示灯显示函数
...@@ -309,7 +309,7 @@ void SEG_SET_LED_STS(uint8_t LED_NUM, uint8_t m_Flag) ...@@ -309,7 +309,7 @@ void SEG_SET_LED_STS(uint8_t LED_NUM, uint8_t m_Flag)
IC1_SEG119 = Flag; IC1_SEG119 = Flag;
break; break;
case em_SEG_Tire_Pressure_Alarm: case em_SEG_Tire_Pressure_Alarm:
IC1_SEG127 = Flag; IC2_SEG127 = Flag;
break; break;
case em_SEG_Turn_Left: case em_SEG_Turn_Left:
IC2_SEG053 = Flag; IC2_SEG053 = Flag;
...@@ -385,7 +385,7 @@ void SEG_SET_FuelDial(uint8_t m_Flag, uint8_t m_SEG) ...@@ -385,7 +385,7 @@ void SEG_SET_FuelDial(uint8_t m_Flag, uint8_t m_SEG)
IC2_SEG100 = IC_SEG_GREY; IC2_SEG100 = IC_SEG_GREY;
} }
} }
else if (Get_CurFuelSetp() == 1) if ((Get_CurFuelSetp() == 1) && (ClearODO_Flag != 1) && (Common_GetIgnOnTime() >= 3000))
{ {
IC2_SEG108 = IC_SEG_ON; IC2_SEG108 = IC_SEG_ON;
IC2_SEG100 = IC_SEG_ON; IC2_SEG100 = IC_SEG_ON;
...@@ -1093,8 +1093,9 @@ void SEG_SET_Voltage_NUM(uint8_t m_Flag, uint16_t m_NUM) ...@@ -1093,8 +1093,9 @@ void SEG_SET_Voltage_NUM(uint8_t m_Flag, uint16_t m_NUM)
IC1_SEG079 = IC_SEG_ON; IC1_SEG079 = IC_SEG_ON;
IC1_SEG086 = IC_SEG_ON; IC1_SEG086 = IC_SEG_ON;
Num = m_NUM / 100;
m8 = SEG_UNDISPLAY_NUMBER0[Num]; m8 = SEG_UNDISPLAY_NUMBER0[Num];
Num = m_NUM % 100;
if (Bit_Is_Set(m8, 0)) if (Bit_Is_Set(m8, 0))
{ {
IC1_SEG096 = IC_SEG_ON; IC1_SEG096 = IC_SEG_ON;
...@@ -1319,16 +1320,16 @@ void SEG_SET_TPMS_NUM(uint8_t m_Flag, uint16_t m_NUM1, uint16_t m_NUM2, uint8_t ...@@ -1319,16 +1320,16 @@ void SEG_SET_TPMS_NUM(uint8_t m_Flag, uint16_t m_NUM1, uint16_t m_NUM2, uint8_t
IC2_SEG109 = IC_SEG_OFF; IC2_SEG109 = IC_SEG_OFF;
IC2_SEG110 = IC_SEG_ON; IC2_SEG110 = IC_SEG_ON;
IC2_SEG118 = IC_SEG_OFF; IC2_SEG118 = IC_SEG_ON;
IC2_SEG138 = IC_SEG_OFF; IC2_SEG138 = IC_SEG_ON;
} }
else else
{ {
IC2_SEG109 = IC_SEG_ON; IC2_SEG109 = IC_SEG_ON;
IC2_SEG110 = IC_SEG_OFF; IC2_SEG110 = IC_SEG_OFF;
IC2_SEG118 = IC_SEG_ON; IC2_SEG118 = IC_SEG_OFF;
IC2_SEG138 = IC_SEG_ON; IC2_SEG138 = IC_SEG_OFF;
} }
} }
...@@ -1719,13 +1720,19 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint ...@@ -1719,13 +1720,19 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint
} }
else else
{ {
IC1_SEG072 = IC_SEG_OFF; ;
IC1_SEG045 = IC_SEG_OFF;
IC1_SEG046 = IC_SEG_OFF;
LED_Driver_Channel_Set(LampChannel_0, LampCh0_35_ODO, LED_OFF);
LED_Driver_Channel_Set(LampChannel_0, LampCh0_34_TRIP, LED_OFF);
} }
} }
else
{
IC1_SEG036 = IC_SEG_OFF;
IC1_SEG037 = IC_SEG_OFF;
IC1_SEG072 = IC_SEG_OFF;
IC1_SEG045 = IC_SEG_OFF;
IC1_SEG046 = IC_SEG_OFF;
LED_Driver_Channel_Set(LampChannel_0, LampCh0_35_ODO, LED_OFF);
LED_Driver_Channel_Set(LampChannel_0, LampCh0_34_TRIP, LED_OFF);
}
} }
...@@ -2016,59 +2023,59 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint ...@@ -2016,59 +2023,59 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint
if (Bit_Is_Set(m8, 0)) if (Bit_Is_Set(m8, 0))
{ {
IC1_SEG064 = IC_SEG_ON; IC1_SEG042 = IC_SEG_ON;
} }
else else
{ {
IC1_SEG064 = IC_SEG_OFF; IC1_SEG042 = IC_SEG_OFF;
} }
if (Bit_Is_Set(m8, 1)) if (Bit_Is_Set(m8, 1))
{ {
IC1_SEG063 = IC_SEG_ON; IC1_SEG041 = IC_SEG_ON;
} }
else else
{ {
IC1_SEG063 = IC_SEG_OFF; IC1_SEG041 = IC_SEG_OFF;
} }
if (Bit_Is_Set(m8, 2)) if (Bit_Is_Set(m8, 2))
{ {
IC1_SEG061 = IC_SEG_ON; IC1_SEG039 = IC_SEG_ON;
} }
else else
{ {
IC1_SEG061 = IC_SEG_OFF; IC1_SEG039 = IC_SEG_OFF;
} }
if (Bit_Is_Set(m8, 3)) if (Bit_Is_Set(m8, 3))
{ {
IC1_SEG067 = IC_SEG_ON; IC1_SEG038 = IC_SEG_ON;
} }
else else
{ {
IC1_SEG067 = IC_SEG_OFF; IC1_SEG038 = IC_SEG_OFF;
} }
if (Bit_Is_Set(m8, 4)) if (Bit_Is_Set(m8, 4))
{ {
IC1_SEG066 = IC_SEG_ON; IC1_SEG044 = IC_SEG_ON;
} }
else else
{ {
IC1_SEG066 = IC_SEG_OFF; IC1_SEG044 = IC_SEG_OFF;
} }
if (Bit_Is_Set(m8, 5)) if (Bit_Is_Set(m8, 5))
{ {
IC1_SEG065 = IC_SEG_ON; IC1_SEG043 = IC_SEG_ON;
} }
else else
{ {
IC1_SEG065 = IC_SEG_OFF; IC1_SEG043 = IC_SEG_OFF;
} }
if (Bit_Is_Set(m8, 6)) if (Bit_Is_Set(m8, 6))
{ {
IC1_SEG062 = IC_SEG_ON; IC1_SEG040 = IC_SEG_ON;
} }
else else
{ {
IC1_SEG062 = IC_SEG_OFF; IC1_SEG040 = IC_SEG_OFF;
} }
} }
else if (Get_Current_PageType() == Page_Trip) else if (Get_Current_PageType() == Page_Trip)
...@@ -2082,7 +2089,7 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint ...@@ -2082,7 +2089,7 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint
IC1_SEG073 = IC_SEG_OFF; IC1_SEG073 = IC_SEG_OFF;
IC1_SEG069 = IC_SEG_OFF; IC1_SEG069 = IC_SEG_OFF;
Num = m_NUM_TRIP % 1000; Num = m_NUM_TRIP / 1000;
m8 = SEG_UNDISPLAY_NUMBER0[Num]; m8 = SEG_UNDISPLAY_NUMBER0[Num];
if (Bit_Is_Set(m8, 0)) if (Bit_Is_Set(m8, 0))
...@@ -2276,59 +2283,59 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint ...@@ -2276,59 +2283,59 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint
if (Bit_Is_Set(m8, 0)) if (Bit_Is_Set(m8, 0))
{ {
IC1_SEG064 = IC_SEG_ON; IC1_SEG042 = IC_SEG_ON;
} }
else else
{ {
IC1_SEG064 = IC_SEG_OFF; IC1_SEG042 = IC_SEG_OFF;
} }
if (Bit_Is_Set(m8, 1)) if (Bit_Is_Set(m8, 1))
{ {
IC1_SEG063 = IC_SEG_ON; IC1_SEG041 = IC_SEG_ON;
} }
else else
{ {
IC1_SEG063 = IC_SEG_OFF; IC1_SEG041 = IC_SEG_OFF;
} }
if (Bit_Is_Set(m8, 2)) if (Bit_Is_Set(m8, 2))
{ {
IC1_SEG061 = IC_SEG_ON; IC1_SEG039 = IC_SEG_ON;
} }
else else
{ {
IC1_SEG061 = IC_SEG_OFF; IC1_SEG039 = IC_SEG_OFF;
} }
if (Bit_Is_Set(m8, 3)) if (Bit_Is_Set(m8, 3))
{ {
IC1_SEG067 = IC_SEG_ON; IC1_SEG038 = IC_SEG_ON;
} }
else else
{ {
IC1_SEG067 = IC_SEG_OFF; IC1_SEG038 = IC_SEG_OFF;
} }
if (Bit_Is_Set(m8, 4)) if (Bit_Is_Set(m8, 4))
{ {
IC1_SEG066 = IC_SEG_ON; IC1_SEG044 = IC_SEG_ON;
} }
else else
{ {
IC1_SEG066 = IC_SEG_OFF; IC1_SEG044 = IC_SEG_OFF;
} }
if (Bit_Is_Set(m8, 5)) if (Bit_Is_Set(m8, 5))
{ {
IC1_SEG065 = IC_SEG_ON; IC1_SEG043 = IC_SEG_ON;
} }
else else
{ {
IC1_SEG065 = IC_SEG_OFF; IC1_SEG043 = IC_SEG_OFF;
} }
if (Bit_Is_Set(m8, 6)) if (Bit_Is_Set(m8, 6))
{ {
IC1_SEG062 = IC_SEG_ON; IC1_SEG040 = IC_SEG_ON;
} }
else else
{ {
IC1_SEG062 = IC_SEG_OFF; IC1_SEG040 = IC_SEG_OFF;
} }
} }
else if (Get_Current_PageType() == Page_DTC) else if (Get_Current_PageType() == Page_DTC)
...@@ -2336,7 +2343,7 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint ...@@ -2336,7 +2343,7 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint
IC1_SEG076 = IC_SEG_OFF; IC1_SEG076 = IC_SEG_OFF;
if(CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CAN_0x402_Msg_Count) == CAN_SIG_LOST) if(CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CAN_0x402_Msg_Count) == CAN_SIG_LOST)
{ {
SEG_SET_DTC_NUM(0xBBBB); SEG_SET_DTC_NUM(0x0B0B0B0B);
IC1_SEG071 = IC_SEG_OFF; IC1_SEG071 = IC_SEG_OFF;
IC1_SEG070 = IC_SEG_OFF; IC1_SEG070 = IC_SEG_OFF;
IC1_SEG068 = IC_SEG_OFF; IC1_SEG068 = IC_SEG_OFF;
...@@ -2409,13 +2416,13 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint ...@@ -2409,13 +2416,13 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint
IC1_SEG065 = IC_SEG_OFF; IC1_SEG065 = IC_SEG_OFF;
IC1_SEG062 = IC_SEG_OFF; IC1_SEG062 = IC_SEG_OFF;
IC1_SEG057 = IC_SEG_OFF; IC1_SEG057 = IC_SEG_ON;
IC1_SEG056 = IC_SEG_OFF; IC1_SEG056 = IC_SEG_ON;
IC1_SEG054 = IC_SEG_OFF; IC1_SEG054 = IC_SEG_ON;
IC1_SEG060 = IC_SEG_OFF; IC1_SEG060 = IC_SEG_ON;
IC1_SEG059 = IC_SEG_OFF; IC1_SEG059 = IC_SEG_ON;
IC1_SEG058 = IC_SEG_OFF; IC1_SEG058 = IC_SEG_ON;
IC1_SEG055 = IC_SEG_ON; IC1_SEG055 = IC_SEG_OFF;
...@@ -2833,16 +2840,23 @@ void Checkself_SEG_Display(void) ...@@ -2833,16 +2840,23 @@ void Checkself_SEG_Display(void)
uint16_t hour = 0; uint16_t hour = 0;
uint16_t min = 0; uint16_t min = 0;
uint32_t ODO = 0; uint32_t ODO = 0;
//uint32_t i = 0;
//for(i = 0; i < BU98R10_DDRAM_SIZE; i ++)
//{
// BU98R10Chip0DDRAM.Byte[i] = 1;
// BU98R10Chip1DDRAM.Byte[i] = 1;
//}
Fuel = Checkself_SEG_step / 5u; Fuel = Checkself_SEG_step / 5u;
SEG_SET_FuelDial(1, Fuel); SEG_SET_FuelDial(1, Fuel);
collant = 100 + ((Checkself_SEG_step / 3) * 11); collant = 100 + ((Checkself_SEG_step / 3) * 11);
SEG_SET_CoolantDial(1, Fuel, collant, 1); SEG_SET_CoolantDial(1, Fuel, collant, 1);
Espeed = (Checkself_SEG_step * 4 / 5) * 500; Espeed = (Checkself_SEG_step * 5 / 6) * 500;
SEG_SET_EspeedDial(1, Espeed / 500); SEG_SET_EspeedDial(1, Espeed / 500);
Vspeed = (Checkself_SEG_step / 3) + 100; Vspeed = ((Checkself_SEG_step / 3) * 11) + 100;
SEG_SET_VSpeed_NUM(1, Vspeed, 0); SEG_SET_VSpeed_NUM(1, Vspeed, 0);
ODO = ((Checkself_SEG_step / 3) * 11111) + 100000; ODO = ((Checkself_SEG_step / 3) * 11111) + 100000;
...@@ -2867,7 +2881,7 @@ void Checkself_SEG_Display(void) ...@@ -2867,7 +2881,7 @@ void Checkself_SEG_Display(void)
Checkself_SEG_step_count = 60; Checkself_SEG_step_count = 60;
} }
if (Checkself_SEG_step_count < 30) if (Checkself_SEG_step_count <= 30)
{ {
Checkself_SEG_step++; Checkself_SEG_step++;
} }
...@@ -2897,7 +2911,7 @@ void TYW_Check_Count(void) ...@@ -2897,7 +2911,7 @@ void TYW_Check_Count(void)
check_SEG_step = 0u; check_SEG_step = 0u;
} }
if (Espeed_check_SEG_step < 239) if (Espeed_check_SEG_step < 249)
{ {
Espeed_check_SEG_step++; Espeed_check_SEG_step++;
} }
......
...@@ -14,7 +14,7 @@ typedef enum ...@@ -14,7 +14,7 @@ typedef enum
em_SEG_Bluetooth, em_SEG_Bluetooth,
em_SEG_TCS, em_SEG_TCS,
em_SEG_Auto_Start_Stop, em_SEG_Auto_Start_Stop,
em_SEG_Keys, //em_SEG_Keys,
em_SEG_Upkeep, em_SEG_Upkeep,
em_SEG_Low_Batt_Vol, em_SEG_Low_Batt_Vol,
em_SEG_Lateral_Strut, em_SEG_Lateral_Strut,
...@@ -31,7 +31,7 @@ typedef enum ...@@ -31,7 +31,7 @@ typedef enum
void SEG_SET_DTC_NUM(uint16_t num); void SEG_SET_DTC_NUM(uint32_t num);
void SEG_SET_LED_STS(uint8_t LED_NUM, uint8_t m_Flag); void SEG_SET_LED_STS(uint8_t LED_NUM, uint8_t m_Flag);
void SEG_SET_FuelDial(uint8_t m_Flag, uint8_t m_SEG); void SEG_SET_FuelDial(uint8_t m_Flag, uint8_t m_SEG);
void SEG_SET_EspeedDial(uint8_t m_Flag, uint8_t m_SEG); void SEG_SET_EspeedDial(uint8_t m_Flag, uint8_t m_SEG);
......
...@@ -158,7 +158,7 @@ void Key_Wakeup_Init_EXample(void) ...@@ -158,7 +158,7 @@ void Key_Wakeup_Init_EXample(void)
void KEY_LEFT_EVENT_NONE_Service(void) void KEY_LEFT_EVENT_NONE_Service(void)
{ {
MenuInfor.Back_Time_Left++; MenuInfor.Back_Time_Left++;
if(MenuInfor.Back_Time_Left > BACK_MENU_TIME) if((MenuInfor.Back_Time_Left > BACK_MENU_TIME) &&(PageType != Page_DTC))
{ {
MenuInfor.Back_Time_Left = BACK_MENU_TIME; MenuInfor.Back_Time_Left = BACK_MENU_TIME;
MenuInfor.Back_Time_Left_Flag = 1; MenuInfor.Back_Time_Left_Flag = 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