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

🐞 fix:44686 【天鹰TY100】【时间设置】时间设置有问题,修改不设置秒针不归零,设置时间则秒针归零的问题

parent f10d7cfb
......@@ -9,7 +9,8 @@ _Menu_Infor MenuInfor;
_Menu_Data MenuData;
uint8_t PageType = 0;
uint8_t PageMenu = 0;
uint8_t Hour_Set = 0;
uint8_t Minute_Set = 0;
RTC_TimeTypeDef RTC_TimeStruct;
RTC_DateTypeDef RTC_DateStruct;
......@@ -247,6 +248,7 @@ void Key_Left_Short_Press(void)
datmax = 23u;
datmin = 0u;
Menu_u8Data_Updata_Process(updataDir, datmax, datmin, 1u, (uint8_t*)&(counter_val.time.RTC_Hours));
Hour_Set = 1;
//RTC_SetTime(&counter_val.time);
}
else if(PageType == Page_Time_Minute)
......@@ -256,7 +258,7 @@ void Key_Left_Short_Press(void)
datmin = 0u;
Menu_u8Data_Updata_Process(updataDir, datmax, datmin, 1u, (uint8_t*)&(counter_val.time.RTC_Minutes));
//RTC_SetTime(&counter_val.time);
Minute_Set = 1;
}
else if(PageType == Page_Km_Unit)
{
......@@ -295,12 +297,23 @@ void Key_Auto_Save(void)
{
if(PageType == Page_Time_Hour)
{
RTC_SetTime(&counter_val.time);
if (Hour_Set == 1)
{
counter_val.time.RTC_Seconds = 0;
RTC_SetTime(&counter_val.time);
Hour_Set = 0;
}
}
if(PageType == Page_Time_Minute)
{
RTC_SetTime(&counter_val.time);
if(Minute_Set == 1)
{
counter_val.time.RTC_Seconds = 0;
RTC_SetTime(&counter_val.time);
Minute_Set = 0;
}
}
PageType = Page_Menu ;
}
......@@ -315,12 +328,22 @@ void Key_Left_Long_Press(void)
}
else if(PageType == Page_Time_Hour)
{
RTC_SetTime(&counter_val.time);
if (Hour_Set == 1)
{
counter_val.time.RTC_Seconds = 0;
RTC_SetTime(&counter_val.time);
Hour_Set = 0;
}
PageType = Page_Time_Minute;
}
else if(PageType == Page_Time_Minute)
{
RTC_SetTime(&counter_val.time);
if (Minute_Set == 1)
{
counter_val.time.RTC_Seconds = 0;
RTC_SetTime(&counter_val.time);
Minute_Set = 0;
}
PageType = Page_Km_Unit;
}
else if(PageType == Page_Km_Unit)
......@@ -396,6 +419,8 @@ void MenuData_TCS_Init(void)
{
MenuData.Tcs_Val = 1;
PageType = Page_Menu;
Hour_Set = 0;
Minute_Set = 0;
}
uint8_t ClearODO_Flag = 0;
......
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