Commit 135bbb3b authored by 时昊's avatar 时昊

feat:修改按键时钟设置

parent ad7950f2
......@@ -334,12 +334,15 @@ 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);
// }
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;
MenuData.Dis_Hour_Bit = counter_val.time.RTC_Hours % 10;
MenuData.Dis_Minute_Tenb = counter_val.time.RTC_Minutes / 10;
MenuData.Dis_Minute_Bit = counter_val.time.RTC_Minutes % 10;
}
void Menu_Logic_Operation_Clock_Hour_Bit(Menu_Key_en_t enKeyType)
......@@ -379,11 +382,7 @@ 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)
{
......
......@@ -5,6 +5,7 @@
#include "RTE.h"
#include "UDS_ISO14229_Server.h"
#include "FaultCode.h"
extern _Menu_Data MenuData;
void Sys_Pseudo_Real_Time_Tasks(void)
{
......@@ -53,17 +54,17 @@ void Sys_50ms_Tasks(void)
g_u8Cursor_Posittion = Menu_Get_Current_Cursor_Information();
// if((MenuData.Dis_Hour_Tenb*10 + MenuData.Dis_Hour_Bit) > 23)
// {
// MenuData.Dis_Hour_Tenb = 2;
// MenuData.Dis_Hour_Bit = 3;
// }
if((MenuData.Dis_Hour_Tenb*10 + MenuData.Dis_Hour_Bit) > 23)
{
MenuData.Dis_Hour_Tenb = 2;
MenuData.Dis_Hour_Bit = 3;
}
// if((MenuData.Dis_Minute_Tenb*10 + MenuData.Dis_Minute_Bit) > 59)
// {
// MenuData.Dis_Minute_Tenb = 5;
// MenuData.Dis_Minute_Bit = 9;
// }
if((MenuData.Dis_Minute_Tenb*10 + MenuData.Dis_Minute_Bit) > 59)
{
MenuData.Dis_Minute_Tenb = 5;
MenuData.Dis_Minute_Bit = 9;
}
}
uint32_t ODOtest = 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