Commit 767570c5 authored by 李俭双's avatar 李俭双

🐞 fix:代码评审问题:按键无操作超时时,秒清零存储操作由主循环更改放到按键动作里执行

parent ca574cc1
......@@ -216,7 +216,28 @@ void KEY_LEFT_EVENT_NONE_Service(void)
if((MenuInfor.Back_Time_Left > BACK_MENU_TIME) &&(PageType != Page_Menu))
{
MenuInfor.Back_Time_Left = BACK_MENU_TIME;
MenuInfor.Back_Time_Left_Flag = 1;
//MenuInfor.Back_Time_Left_Flag = 1;
if(PageType == Page_Time_Hour)
{
if (Hour_Set == 1)
{
counter_val.time.RTC_Seconds = 0;
RTC_SetTime(&counter_val.time);
Hour_Set = 0;
}
}
if(PageType == Page_Time_Minute)
{
if(Minute_Set == 1)
{
counter_val.time.RTC_Seconds = 0;
RTC_SetTime(&counter_val.time);
Minute_Set = 0;
}
}
PageType = Page_Menu ;
}
}
......@@ -227,7 +248,7 @@ void Key_Clear_Time(void)
//if(Key_Status_Read_Left() == KEY_REALTIME_PRESS)
{
MenuInfor.Back_Time_Left = 0;
MenuInfor.Back_Time_Left_Flag = 0;
//MenuInfor.Back_Time_Left_Flag = 0;
}
}
......@@ -330,30 +351,30 @@ void Key_Left_Short_Press(void)
void Key_Auto_Save(void)
{
if((MenuInfor.Back_Time_Left_Flag == 1))
{
if(PageType == Page_Time_Hour)
{
if (Hour_Set == 1)
{
counter_val.time.RTC_Seconds = 0;
RTC_SetTime(&counter_val.time);
Hour_Set = 0;
}
}
if(PageType == Page_Time_Minute)
{
if(Minute_Set == 1)
{
counter_val.time.RTC_Seconds = 0;
RTC_SetTime(&counter_val.time);
Minute_Set = 0;
}
}
PageType = Page_Menu ;
}
//if((MenuInfor.Back_Time_Left_Flag == 1))
//{
// if(PageType == Page_Time_Hour)
// {
// if (Hour_Set == 1)
// {
// counter_val.time.RTC_Seconds = 0;
// RTC_SetTime(&counter_val.time);
// Hour_Set = 0;
// }
// }
//
// if(PageType == Page_Time_Minute)
// {
// if(Minute_Set == 1)
// {
// counter_val.time.RTC_Seconds = 0;
// RTC_SetTime(&counter_val.time);
// Minute_Set = 0;
// }
//
// }
// PageType = Page_Menu ;
//}
}
......
......@@ -63,7 +63,7 @@ void Sys_10ms_Tasks(void)
void Sys_20ms_Tasks(void)
{
//Key_Clear_Time();
Key_Auto_Save();
//Key_Auto_Save();
Data_Vehicle_Speed_Processing_Service();
Data_Engine_Speed_Processing_Service();
Data_Coolant_Temp_Processing_Service();
......
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