Commit 72efb25c authored by 张金硕's avatar 张金硕

Merge branch 'wjl_devlop' into 'dev'

合并请求-修改禅道bug-240823

See merge request !59
parents daf8ac08 f5222f90
......@@ -138,64 +138,71 @@ void Data_Light_Res_service(Light_uint8_t deltaTime)//获取光感阻值,并
}
}
timeCount += deltaTime;
if(Menu_Item_Select_Get(MENU_ITEM_SELECT_AUTO))
if(SYS_OPR_STAT_IGN_ON)
{
if(LightADCompleteFlg)
if(Menu_Item_Select_Get(MENU_ITEM_SELECT_AUTO))
{
if(LightR <= 800)
if(LightADCompleteFlg)
{
LightR_Status_Count++;
if(LightR_Status_Count>=150)
if(LightR <= 800)
{
LightR_Status_Count++;
if(LightR_Status_Count>=150)
{
LightR_Status_Count = 0;
LightR_Status = 0;
}
}
else if(LightR > 800)
{
LightR_Status_Count++;
if(LightR_Status_Count>=150)
{
LightR_Status_Count = 0;
LightR_Status = 1;
}
}
if(LightR_Status == 0)
{
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_Val_2);
}
else
{
LightR_Status_Count = 0;
LightR_Status = 0;
}
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_Val_5);
}
}
else if(LightR > 800)
}
else if(Menu_Item_Select_Get(MENU_ITEM_BACKLIGHT_AUTO))
{
if(Backlight_SetPwmLevel() == 1U)
{
LightR_Status_Count++;
if(LightR_Status_Count>=150)
{
LightR_Status_Count = 0;
LightR_Status = 1;
}
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_Val_1);
}
if(LightR_Status == 0)
else if(Backlight_SetPwmLevel() == 2U)
{
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_Val_2);
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_Val_2);
}
else
else if(Backlight_SetPwmLevel() == 3U)
{
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_Val_5);
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_Val_3);
}
else if(Backlight_SetPwmLevel() == 4U)
{
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_Val_4);
}
else if(Backlight_SetPwmLevel() == 5U)
{
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_Val_5);
}
}
}
else if(Menu_Item_Select_Get(MENU_ITEM_BACKLIGHT_AUTO))
{
if(Backlight_SetPwmLevel() == 1U)
{
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_Val_1);
}
else if(Backlight_SetPwmLevel() == 2U)
{
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_Val_2);
}
else if(Backlight_SetPwmLevel() == 3U)
{
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_Val_3);
}
else if(Backlight_SetPwmLevel() == 4U)
{
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_Val_4);
}
else if(Backlight_SetPwmLevel() == 5U)
else
{
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_Val_5);
BackLight_Process();
}
}
else
{
BackLight_Process();
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, 0);
}
}
......
......@@ -50,6 +50,18 @@ void Key_Operation_Right(Key_Event_en_t enKeyEvent)//确认
switch (enKeyEvent)
{
case KEY_EVENT_SHORT_PRESS_1:
/* 在数字闪烁界面的时候,按确认键保存时间 */
if ((Menu_Get_Current_Cursor_Information() == MENU_ITEM_CLOCK_HOUR_TENB_SET) ||
(Menu_Get_Current_Cursor_Information() == MENU_ITEM_CLOCK_HOUR_BIT_SET ) ||
(Menu_Get_Current_Cursor_Information() == MENU_ITEM_CLOCK_MIN_TENB_SET ) ||
(Menu_Get_Current_Cursor_Information() == MENU_ITEM_CLOCK_MIN_BIT_SET ) )
{
// Menu_Logic_Operation_Clock_Hour_Tenb_Set(MENU_KEY_CONFIRM_SHORT);
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);
counter_val.time.RTC_Seconds = 0U;
RTC_SetTime(&counter_val.time);
}
Key_Event_Short_Press_Right();
break;
case KEY_EVENT_SHORT_PRESS_2:
......@@ -347,23 +359,32 @@ void TYW_RESET_ODO(void)
void Get_DisTime_Service(void)
{
if(1)
{
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);
}
if ((Menu_Get_Current_Cursor_Information() == MENU_ITEM_CLOCK_HOUR_TENB_SET) ||
(Menu_Get_Current_Cursor_Information() == MENU_ITEM_CLOCK_HOUR_BIT_SET ) ||
(Menu_Get_Current_Cursor_Information() == MENU_ITEM_CLOCK_MIN_TENB_SET ) ||
(Menu_Get_Current_Cursor_Information() == MENU_ITEM_CLOCK_MIN_BIT_SET ) )
{
}
else
{
/* 由于需要不保存时间,需要另外一套计时的方式 */
RTE_RTC_Get_CounterValue(&counter_val);
counter_val.time.RTC_Hours = RTC_Bcd2ToByte(counter_val.time.RTC_Hours);
MenuData.u8Dis_Hour = counter_val.time.RTC_Hours;
counter_val.time.RTC_Minutes = RTC_Bcd2ToByte(counter_val.time.RTC_Minutes);
MenuData.u8Dis_Minute = counter_val.time.RTC_Minutes;
}
}
uint8_t Get_Dis_Hour_Time(void)
{
return counter_val.time.RTC_Hours;
return MenuData.u8Dis_Hour;
}
uint8_t Get_Dis_Minute_Time(void)
{
return counter_val.time.RTC_Minutes;
return MenuData.u8Dis_Minute;
}
uint8_t Get_Dis_Unit(void)
......
......@@ -45,6 +45,8 @@ typedef struct
uint8_t OdoAndTrip;
uint8_t Bluetooth_Open_Close;
uint8_t Clock_Flash;
uint8_t u8Dis_Hour;
uint8_t u8Dis_Minute;
}_Menu_Data;
extern uint8_t OTA_Update_Flag;
......
......@@ -395,13 +395,15 @@ void Menu_Logic_Operation_Clock_Hour_Tenb_Set(Menu_Key_en_t enKeyType)
datmax = 2u;
datmin = 0u;
Menu_u8Data_Updata_Process(updataDir, datmax, datmin, 1u, (uint8_t*)&(MenuData.Dis_Hour_Tenb));
MenuData.u8Dis_Hour = (MenuData.Dis_Hour_Tenb*10 + MenuData.Dis_Hour_Bit);
MenuData.u8Dis_Minute = (MenuData.Dis_Minute_Tenb*10 + 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);
// 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)
......@@ -412,16 +414,25 @@ void Menu_Logic_Operation_Clock_Hour_Bit_Set(Menu_Key_en_t enKeyType)
if(enKeyType == MENU_KEY_DOWN_SHORT)
{
updataDir = 1;
datmax = 9u;
if(MenuData.Dis_Hour_Tenb == 2)
{
datmax = 3u;
}
else
{
datmax = 9u;
}
datmin = 0u;
Menu_u8Data_Updata_Process(updataDir, datmax, datmin, 1u, (uint8_t*)&(MenuData.Dis_Hour_Bit));
MenuData.u8Dis_Hour = (MenuData.Dis_Hour_Tenb*10 + MenuData.Dis_Hour_Bit);
MenuData.u8Dis_Minute = (MenuData.Dis_Minute_Tenb*10 + 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);
// MenuData.Dis_Hour = (MenuData.Dis_Hour_Tenb*10 + MenuData.Dis_Hour_Bit);
// MenuData.Dis_Minute = (MenuData.Dis_Minute_Tenb*10 + MenuData.Dis_Minute_Bit);
//RTC_SetTime(&counter_val.time);
}
}
......@@ -436,13 +447,15 @@ void Menu_Logic_Operation_Clock_Min_Tenb_Set(Menu_Key_en_t enKeyType)
datmax = 5u;
datmin = 0u;
Menu_u8Data_Updata_Process(updataDir, datmax, datmin, 1u, (uint8_t*)&(MenuData.Dis_Minute_Tenb));
MenuData.u8Dis_Hour = (MenuData.Dis_Hour_Tenb*10 + MenuData.Dis_Hour_Bit);
MenuData.u8Dis_Minute = (MenuData.Dis_Minute_Tenb*10 + 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);
// 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);
}
}
......@@ -457,13 +470,15 @@ void Menu_Logic_Operation_Clock_Min_Bit_Set(Menu_Key_en_t enKeyType)
datmax = 9u;
datmin = 0u;
Menu_u8Data_Updata_Process(updataDir, datmax, datmin, 1u, (uint8_t*)&(MenuData.Dis_Minute_Bit));
MenuData.u8Dis_Hour = (MenuData.Dis_Hour_Tenb*10 + MenuData.Dis_Hour_Bit);
MenuData.u8Dis_Minute = (MenuData.Dis_Minute_Tenb*10 + 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);
// 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);
}
}
......
......@@ -62,7 +62,7 @@ void Sys_50ms_Tasks(void)
if((MenuData.Dis_Hour_Tenb*10 + MenuData.Dis_Hour_Bit) > 23)
{
MenuData.Dis_Hour_Tenb = 2;
MenuData.Dis_Hour_Bit = 3;
MenuData.Dis_Hour_Bit = 0;
}
if((MenuData.Dis_Minute_Tenb*10 + MenuData.Dis_Minute_Bit) > 59)
......
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