Commit fc5ea08f authored by 高士达's avatar 高士达

Merge branch 'shihao' into 'develop'

 feat:增加开启远光灯延迟2s进入夜间模式

See merge request !34
parents dadb3a9c c7cde5c9
......@@ -535,7 +535,7 @@ void Can_Set_Buff_18D00017(canlib_uint8_t CopyData [])
p18D00017 = ( CANMsg18D00017Union * )CopyData;
if ( p18D00017 != ( void * )0 )
{
if((Get_TelltalesLedSts(m_LED_Park_Lamp) == 1) || (Get_TelltalesLedSts(m_LED_High_Lamp) == 1))
if((Get_TelltalesLedSts(m_LED_Park_Lamp) == 1) || (Get_Enter_night_mode_sta() == 1))
{
if(g_nightLight.Duty == 100)
{
......
......@@ -1196,6 +1196,35 @@ void GUI_Light_Init(void)
g_nightLight.Duty = 100;
}
DataEnternightmode nightmode;
/*开启远光灯延迟2s进入夜间模式*/
void Enter_night_mode(void)
{
if( (Get_TelltalesLedSts(m_LED_High_Lamp) == 1))
{
if(nightmode.night_mode_time < 40)
{
nightmode.night_mode_time++;
}
else
{
nightmode.night_mode_sta = 1;
}
}
else
{
nightmode.night_mode_sta = 0;
nightmode.night_mode_time = 0;
}
}
/*获取夜间模式状态 1进入 0不进入*/
uint32_t Get_Enter_night_mode_sta(void)
{
return nightmode.night_mode_sta;
}
void GUI_nightLightWeakup_Init(void)
{
g_nightLight.Duty = 100;
......@@ -1261,7 +1290,7 @@ void Gui_LightProc(void)
}
else
{
if((Get_TelltalesLedSts(m_LED_Park_Lamp) == 1) || (Get_TelltalesLedSts(m_LED_High_Lamp) == 1))
if((Get_TelltalesLedSts(m_LED_Park_Lamp) == 1) || (Get_Enter_night_mode_sta() == 1))
{
PWM_Channel_Set_Duty(1, g_nightLight.Duty);//表盘
PWM_Channel_Set_Duty(3, g_nightLight.Duty);//指针
......@@ -1288,7 +1317,7 @@ void Gui_LightProc(void)
{
if((Pop_Alarm_Get_Current() == POP_ALARM_POSITION_LIGHT)||(Pop_Alarm_Get_Current() == POP_ALARM_KEY))
{
if((Get_TelltalesLedSts(m_LED_Park_Lamp) == 1) || (Get_TelltalesLedSts(m_LED_High_Lamp) == 1))
if((Get_TelltalesLedSts(m_LED_Park_Lamp) == 1) || (Get_Enter_night_mode_sta() == 1))
{
PWM_Channel_Set_Duty(5, g_nightLight.Duty);//3.5
}
......@@ -1306,7 +1335,7 @@ void Gui_LightProc(void)
}
else
{
if((Get_TelltalesLedSts(m_LED_Park_Lamp) == 1) || (Get_TelltalesLedSts(m_LED_High_Lamp) == 1))
if((Get_TelltalesLedSts(m_LED_Park_Lamp) == 1) || (Get_Enter_night_mode_sta() == 1))
{
PWM_Channel_Set_Duty(5, g_nightLight.Duty);//3.5
}
......
......@@ -408,6 +408,12 @@ typedef struct
uint8_t Wheel_ID_Time_Lost;
}_TPMS_Display_Infor;
typedef struct
{
uint32_t night_mode_time; //夜间模式延时时间
uint8_t night_mode_sta; //夜间模式状态
}DataEnternightmode;
extern _TPMS_Display_Infor Left_Front_Display;
extern _TPMS_Display_Infor Left_Rear_Display;
extern _TPMS_Display_Infor Left_Rear_Inside_Display;
......@@ -566,4 +572,7 @@ void TPMS_Tyre_Lost(void);
void CAN_Time_Lost(void);
INT8U Get_Mcu_Abnormal_Reset(void);
uint16_t Get_ActualEngineSpeed(void);
extern void Enter_night_mode(void);
extern uint32_t Get_Enter_night_mode_sta(void);
#endif
......@@ -4067,7 +4067,7 @@ void Gui_Backlight(INT8U Backlight)
{
Draw_Image_Local(( uint8_t * )Set_icon_01_X103_Y76, 103, 76);
Draw_Image_Local(( uint8_t * )Set_CN_01_X85_Y128, 85, 128);
if((Get_TelltalesLedSts(m_LED_Park_Lamp) == 1) || (Get_TelltalesLedSts(m_LED_High_Lamp) == 1))
if((Get_TelltalesLedSts(m_LED_Park_Lamp) == 1) || (Get_Enter_night_mode_sta() == 1))
{
if ((g_nightLight.Duty == 0))
{
......
......@@ -305,7 +305,7 @@ void Menu_Logic_Operation_SET_Backlight(Menu_Key_en_t enKeyType)
updataDir = 1;
datmax = 500u;
datmin = 100u;
if((Get_TelltalesLedSts(m_LED_Park_Lamp) == 1) || (Get_TelltalesLedSts(m_LED_High_Lamp) == 1))
if((Get_TelltalesLedSts(m_LED_Park_Lamp) == 1) || (Get_Enter_night_mode_sta() == 1))
{
if(g_nightLight.Duty == 100u)
{
......
......@@ -151,7 +151,7 @@ void Sys_Run_Mode_50ms_Tasks_Group(void)
Gauges_Management_Service();
Telltales_Management();
LED_Driver_Scan_Refresh();
Enter_night_mode();
}
......
......@@ -13,7 +13,7 @@ const uint8_t DID_22_F193[8] = {'V','1','.','0',0x20,0x20,0x20,0x20};
/*ECUHardwareVersionNumberDataIdentifier(软件号)*/
const uint8_t DID_22_F194[16] = {'5','8','0','3','3','1','0','8','1','7',0x20,0x20,0x20,0x20,0x20,0x20};
/*ECUSoftwareVersionNumberDataIdentifier(软件版本号)*/
const uint8_t DID_22_F195[8] = {'V','1','.','2',0x20,0x20,0x20,0x20};
const uint8_t DID_22_F195[8] = {'V','1','.','3',0x20,0x20,0x20,0x20};
/*SystemNameDataIdentifier(ECU名称)*/
const uint8_t DID_22_F197[10] = {'I','C','-','N','S','2','0','8','-','2'};
/*EOLProgrammingDate*/
......
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