Commit 58e1184d authored by 李俭双's avatar 李俭双

🐞 fix:规范菜单逻辑变更,相应更改软件

parent 8d3802ea
......@@ -875,6 +875,23 @@ void SEG_SET_VSpeed_NUM(uint8_t m_Flag, uint16_t m_NUM, uint8_t m_Unit)
if (m_Flag == 1)
{
if (m_NUM > 99)
{
RTE_GPIO_Set_Level(VSpeed_Tens, 1);
RTE_GPIO_Set_Level(VSpeed_Hundreds, 1);
}
else if (m_NUM > 9)
{
RTE_GPIO_Set_Level(VSpeed_Tens, 1);
RTE_GPIO_Set_Level(VSpeed_Hundreds, 0);
}
else
{
RTE_GPIO_Set_Level(VSpeed_Tens, 0);
RTE_GPIO_Set_Level(VSpeed_Hundreds, 0);
}
if ((ClearODO_Flag != 1) && (Common_GetIgnOnTime() >= 3000))
{
if (Get_Current_PageType() == Page_Km_Unit)
......@@ -1672,6 +1689,8 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint
uint32_t Num;
uint8_t m8;
RTE_GPIO_Set_Level(ODO_TenThousand, 1);
RTE_GPIO_Set_Level(ODO_Thousand, 1);
if ((ClearODO_Flag != 1) && (Common_GetIgnOnTime() >= 3000))
{
if (Get_Current_PageType() == Page_Km_Unit)
......@@ -1689,7 +1708,7 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint
}
else
{
if((Get_Current_PageType() == Page_Odo) || (Get_Current_PageType() == Page_Trip))
if((Get_Current_PageMenu() == Page_Odo) || (Get_Current_PageMenu() == Page_Trip))
{
if (m_Uint == 0)
{
......@@ -1702,7 +1721,7 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint
IC1_SEG037 = IC_SEG_OFF;
}
if(Get_Current_PageType() == Page_Odo)
if(Get_Current_PageMenu() == Page_Odo)
{
IC1_SEG072 = IC_SEG_ON;
IC1_SEG045 = IC_SEG_OFF;
......@@ -1710,7 +1729,7 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint
LED_Driver_Channel_Set(LampChannel_0, LampCh0_35_ODO, LED_ON);
LED_Driver_Channel_Set(LampChannel_0, LampCh0_34_TRIP, LED_OFF);
}
else if (Get_Current_PageType() == Page_Trip)
else if (Get_Current_PageMenu() == Page_Trip)
{
IC1_SEG072 = IC_SEG_OFF;
IC1_SEG045 = IC_SEG_ON;
......@@ -1748,7 +1767,7 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint
LED_Driver_Channel_Set(LampChannel_0, LampCh0_34_TRIP, LED_ON);
}
if((Get_Current_PageType() == Page_Odo) || (ClearODO_Flag == 1) || (Common_GetIgnOnTime() < 3000))
if((Get_Current_PageMenu() == Page_Odo) || (ClearODO_Flag == 1) || (Common_GetIgnOnTime() < 3000))
{
if(m_NUM_ODO > 99999)
{
......@@ -2078,7 +2097,7 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint
IC1_SEG040 = IC_SEG_OFF;
}
}
else if (Get_Current_PageType() == Page_Trip)
else if (Get_Current_PageMenu() == Page_Trip)
{
IC1_SEG076 = IC_SEG_OFF;
IC1_SEG071 = IC_SEG_OFF;
......@@ -2338,7 +2357,7 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint
IC1_SEG040 = IC_SEG_OFF;
}
}
else if (Get_Current_PageType() == Page_DTC)
else if (Get_Current_PageMenu() == Page_DTC)
{
IC1_SEG076 = IC_SEG_OFF;
if(CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CAN_0x402_Msg_Count) == CAN_SIG_LOST)
......@@ -2396,7 +2415,7 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint
}
}
}
else if (Get_Current_PageType() == Page_TCS)
else if (Get_Current_PageMenu() == Page_TCS)
{
IC1_SEG076 = IC_SEG_OFF;
......
......@@ -8,6 +8,7 @@ __align(4)
_Menu_Infor MenuInfor;
_Menu_Data MenuData;
uint8_t PageType = 0;
uint8_t PageMenu = 0;
RTC_TimeTypeDef RTC_TimeStruct;
RTC_DateTypeDef RTC_DateStruct;
......@@ -31,6 +32,24 @@ void Key_Operation_Left(Key_Event_en_t enKeyEvent)//Mode
break;
case KEY_EVENT_LONG_PRESS_4: //10s
Maintain_Reset_Service();
if((PageMenu == Page_TCS) && (PageType == Page_Menu))
{
if(Get_Dis_Tcs_Val() == 0)
{
MenuData.Tcs_Val = 1;//on
}
else
{
MenuData.Tcs_Val = 0;//off
}
}
if((PageMenu == Page_Trip) && (PageType == Page_Menu))
{
Data_Clear_Trip_All();
}
TYW_RESET_ODO();
break;
case KEY_EVENT_OFF_TO_ON:
......@@ -132,9 +151,9 @@ void Key_KL30_Init_EXample(void)
Key_Parameter_Set_Short_Press_1_Time(50U,1000U);
Key_Parameter_Set_Short_Press_2_Time(3000U,9000U);
//Key_Parameter_Set_Long_Press_1_Time(7000U);
//Key_Parameter_Set_Long_Press_2_Time(8000U);
//Key_Parameter_Set_Long_Press_3_Time(9000U);
Key_Parameter_Set_Long_Press_1_Time(9100U);
Key_Parameter_Set_Long_Press_2_Time(9200U);
Key_Parameter_Set_Long_Press_3_Time(9300U);
Key_Parameter_Set_Long_Press_4_Time(10000U);
}
void Key_Wakeup_Init_EXample(void)
......@@ -158,7 +177,7 @@ void Key_Wakeup_Init_EXample(void)
void KEY_LEFT_EVENT_NONE_Service(void)
{
MenuInfor.Back_Time_Left++;
if((MenuInfor.Back_Time_Left > BACK_MENU_TIME) &&(PageType != Page_DTC))
if((MenuInfor.Back_Time_Left > BACK_MENU_TIME) &&(PageType != Page_Menu))
{
MenuInfor.Back_Time_Left = BACK_MENU_TIME;
MenuInfor.Back_Time_Left_Flag = 1;
......@@ -188,23 +207,27 @@ void Key_Left_Short_Press(void)
uint8_t datmin = 0u;
if(PageType == Page_Odo)
if(PageType == Page_Menu)
{
PageType = Page_Trip;
if(PageMenu == Page_Odo)
{
PageMenu = Page_Trip;
}
else if(PageType == Page_Trip)
else if(PageMenu == Page_Trip)
{
PageType = Page_DTC;
PageMenu = Page_DTC;
}
else if(PageType == Page_DTC)
else if(PageMenu == Page_DTC)
{
PageType = Page_TCS;
PageMenu = Page_TCS;
}
else if(PageType == Page_TCS)
else if(PageMenu == Page_TCS)
{
PageType = Page_Odo;
PageMenu = Page_Odo;
}
}
if(PageType == Page_Time_Hour)
{
updataDir = 1;
......@@ -262,14 +285,14 @@ void Key_Auto_Save(void)
{
RTC_SetTime(&counter_val.time);
}
PageType = Page_Odo;
PageType = Page_Menu ;
}
}
void Key_Left_Long_Press(void)
{
if(PageType == Page_Odo)
if((PageType == Page_Menu) )
{
PageType = Page_Time_Hour;
}
......@@ -287,29 +310,14 @@ void Key_Left_Long_Press(void)
}
else if(PageType == Page_Tpms_Unit)
{
PageType = Page_Odo;
PageType = Page_Menu;
}
else
{
;
}
if(PageType == Page_TCS)
{
if(Get_Dis_Tcs_Val() == 0)
{
MenuData.Tcs_Val = 1;//on
}
else
{
MenuData.Tcs_Val = 0;//off
}
}
if(PageType == Page_Trip)
{
Data_Clear_Trip_All();
}
}
......@@ -397,7 +405,7 @@ void TYW_RESET_ODO(void)
void Maintain_Reset_Service(void)
{
if(Get_Data_Maintenace_Interval_Processing() == 0)
if((Get_Data_Maintenace_Interval_Processing() == 0) && (PageMenu == Page_TCS) && (PageType == Page_Menu))
{
Data_Maintenance_Interval_Reset();
}
......@@ -417,6 +425,10 @@ uint8_t Get_Current_PageType(void)
{
return PageType;
}
uint8_t Get_Current_PageMenu(void)
{
return PageMenu;
}
uint8_t Get_Dis_KM_Unit(void)
{
......
......@@ -24,18 +24,24 @@ typedef struct
typedef enum
{
Page_Odo = 0,
Page_Menu = 0,
Page_Time_Hour,
Page_Time_Minute,
Page_Km_Unit,
Page_Tpms_Unit,
Page_Max,
}_Page_Type;
typedef enum
{
Page_Odo = 0,
Page_Trip,
Page_DTC,
Page_TCS,
Page_Max,
}_Page_Type;
Page_Menu_Max,
}_Page_Menu_Type;
extern uint8_t PageType;
......@@ -56,6 +62,7 @@ void Key_Auto_Save(void);
uint8_t Get_Dis_Hour_Time(void);
uint8_t Get_Dis_Minute_Time(void);
uint8_t Get_Current_PageType(void);
uint8_t Get_Current_PageMenu(void);
void TYW_RESET_ODO(void);
uint8_t Get_Dis_KM_Unit(void);
uint8_t Get_Dis_Tpms_Unit(void);
......
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