Commit f035c196 authored by 时昊's avatar 时昊

feat:修改时间菜单设置

parent 669c991c
......@@ -5,6 +5,8 @@
/*-------------------Logic_Operation Call Back---------------------*/
uint8_t g_u8Cursor_Posittion;
extern _Menu_Data MenuData;
extern RTC_CounterTypeDef counter_val;
void Menu_Logic_Operation_MAIN_ITEM(Menu_Key_en_t enKeyType);
void Menu_Logic_Operation_Display_Mode(Menu_Key_en_t enKeyType);
......@@ -324,21 +326,38 @@ void Menu_Logic_Operation_Bluetooth_Back(Menu_Key_en_t enKeyType)
void Menu_Logic_Operation_Clock_Hour_Tenb(Menu_Key_en_t enKeyType)
{
// counter_val.time.RTC_Hours = (MenuData.Dis_Hour_Tenb*10 + MenuData.Dis_Hour_Bit);
// counter_val.time.RTC_Minutes = (MenuData.Dis_Minute_Tenb*10 + MenuData.Dis_Minute_Bit);
// if(MENU_KEY_CONFIRM_SHORT == enKeyType)
// {
// RTC_SetTime(&counter_val.time);
// }
}
void Menu_Logic_Operation_Clock_Hour_Bit(Menu_Key_en_t enKeyType)
{
// counter_val.time.RTC_Hours = (MenuData.Dis_Hour_Tenb*10 + MenuData.Dis_Hour_Bit);
// counter_val.time.RTC_Minutes = (MenuData.Dis_Minute_Tenb*10 + MenuData.Dis_Minute_Bit);
// if(MENU_KEY_CONFIRM_SHORT == enKeyType)
// {
// RTC_SetTime(&counter_val.time);
// }
}
void Menu_Logic_Operation_Clock_Min_Tenb(Menu_Key_en_t enKeyType)
{
// counter_val.time.RTC_Hours = (MenuData.Dis_Hour_Tenb*10 + MenuData.Dis_Hour_Bit);
// counter_val.time.RTC_Minutes = (MenuData.Dis_Minute_Tenb*10 + MenuData.Dis_Minute_Bit);
// if(MENU_KEY_CONFIRM_SHORT == enKeyType)
// {
// RTC_SetTime(&counter_val.time);
// }
}
void Menu_Logic_Operation_Clock_Min_Bit(Menu_Key_en_t enKeyType)
{
// counter_val.time.RTC_Hours = (MenuData.Dis_Hour_Tenb*10 + MenuData.Dis_Hour_Bit);
// counter_val.time.RTC_Minutes = (MenuData.Dis_Minute_Tenb*10 + MenuData.Dis_Minute_Bit);
}
......@@ -352,6 +371,12 @@ void Menu_Logic_Operation_Clock_Hour_Tenb_Set(Menu_Key_en_t enKeyType)
uint8_t updataDir = 0u;
uint8_t datmax = 0u;
uint8_t datmin = 0u;
// RTE_RTC_Get_CounterValue(&counter_val);
// counter_val.time.RTC_Hours = RTC_Bcd2ToByte(counter_val.time.RTC_Hours);
// counter_val.time.RTC_Minutes = RTC_Bcd2ToByte(counter_val.time.RTC_Minutes);
// MenuData.Dis_Hour_Tenb = counter_val.time.RTC_Hours / 10;
if(enKeyType == MENU_KEY_DOWN_SHORT)
{
updataDir = 1;
......@@ -359,6 +384,13 @@ void Menu_Logic_Operation_Clock_Hour_Tenb_Set(Menu_Key_en_t enKeyType)
datmin = 0u;
Menu_u8Data_Updata_Process(updataDir, datmax, datmin, 1u, (uint8_t*)&(MenuData.Dis_Hour_Tenb));
}
if(MENU_KEY_CONFIRM_SHORT == enKeyType)
{
counter_val.time.RTC_Hours = (MenuData.Dis_Hour_Tenb*10 + MenuData.Dis_Hour_Bit);
counter_val.time.RTC_Minutes = (MenuData.Dis_Minute_Tenb*10 + MenuData.Dis_Minute_Bit);
RTC_SetTime(&counter_val.time);
}
}
void Menu_Logic_Operation_Clock_Hour_Bit_Set(Menu_Key_en_t enKeyType)
{
......@@ -372,6 +404,13 @@ void Menu_Logic_Operation_Clock_Hour_Bit_Set(Menu_Key_en_t enKeyType)
datmin = 0u;
Menu_u8Data_Updata_Process(updataDir, datmax, datmin, 1u, (uint8_t*)&(MenuData.Dis_Hour_Bit));
}
if(MENU_KEY_CONFIRM_SHORT == enKeyType)
{
counter_val.time.RTC_Hours = (MenuData.Dis_Hour_Tenb*10 + MenuData.Dis_Hour_Bit);
counter_val.time.RTC_Minutes = (MenuData.Dis_Minute_Tenb*10 + MenuData.Dis_Minute_Bit);
RTC_SetTime(&counter_val.time);
}
}
void Menu_Logic_Operation_Clock_Min_Tenb_Set(Menu_Key_en_t enKeyType)
......@@ -386,6 +425,13 @@ void Menu_Logic_Operation_Clock_Min_Tenb_Set(Menu_Key_en_t enKeyType)
datmin = 0u;
Menu_u8Data_Updata_Process(updataDir, datmax, datmin, 1u, (uint8_t*)&(MenuData.Dis_Minute_Tenb));
}
if(MENU_KEY_CONFIRM_SHORT == enKeyType)
{
counter_val.time.RTC_Hours = (MenuData.Dis_Hour_Tenb*10 + MenuData.Dis_Hour_Bit);
counter_val.time.RTC_Minutes = (MenuData.Dis_Minute_Tenb*10 + MenuData.Dis_Minute_Bit);
RTC_SetTime(&counter_val.time);
}
}
void Menu_Logic_Operation_Clock_Min_Bit_Set(Menu_Key_en_t enKeyType)
......@@ -400,6 +446,13 @@ void Menu_Logic_Operation_Clock_Min_Bit_Set(Menu_Key_en_t enKeyType)
datmin = 0u;
Menu_u8Data_Updata_Process(updataDir, datmax, datmin, 1u, (uint8_t*)&(MenuData.Dis_Minute_Bit));
}
if(MENU_KEY_CONFIRM_SHORT == enKeyType)
{
counter_val.time.RTC_Hours = (MenuData.Dis_Hour_Tenb*10 + MenuData.Dis_Hour_Bit);
counter_val.time.RTC_Minutes = (MenuData.Dis_Minute_Tenb*10 + MenuData.Dis_Minute_Bit);
RTC_SetTime(&counter_val.time);
}
}
void Menu_Logic_Operation_Backlight_Setting(Menu_Key_en_t enKeyType)
......@@ -414,7 +467,9 @@ void Menu_Logic_Operation_Bluetooth_Connect(Menu_Key_en_t enKeyType)
void Menu_Logic_Operation_Clock_Setting(Menu_Key_en_t enKeyType)
{
//RTE_RTC_Get_CounterValue(&counter_val);
// counter_val.time.RTC_Hours = RTC_Bcd2ToByte(counter_val.time.RTC_Hours);
// counter_val.time.RTC_Minutes = RTC_Bcd2ToByte(counter_val.time.RTC_Minutes);
}
void Menu_Logic_Operation_Unit_Setting(Menu_Key_en_t enKeyType)
......
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