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

Merge branch 'shihao' into 'develop'

修改背光逻辑

See merge request !33
parents d1f5264a 16f84870
......@@ -535,16 +535,56 @@ void Can_Set_Buff_18D00017(canlib_uint8_t CopyData [])
p18D00017 = ( CANMsg18D00017Union * )CopyData;
if ( p18D00017 != ( void * )0 )
{
if(Get_TelltalesLedSts(m_LED_Park_Lamp) == 1)
if((Get_TelltalesLedSts(m_LED_Park_Lamp) == 1) || (Get_TelltalesLedSts(m_LED_High_Lamp) == 1))
{
if(g_Light.Duty == 150)
if(g_nightLight.Duty == 100)
{
IC_ILLUMINATION = 15;
IC_ILLUMINATION = 10;
}
else if(g_Light.Duty == 200)
else if(g_nightLight.Duty == 200)
{
IC_ILLUMINATION = 20;
}
else if(g_nightLight.Duty == 250)
{
IC_ILLUMINATION = 27;
}
else if(g_nightLight.Duty == 300)
{
IC_ILLUMINATION = 35;
}
else if(g_nightLight.Duty == 350)
{
IC_ILLUMINATION = 45;
}
else if(g_nightLight.Duty == 400)
{
IC_ILLUMINATION = 58;
}
else if(g_nightLight.Duty == 450)
{
IC_ILLUMINATION = 73;
}
else if(g_nightLight.Duty == 500)
{
IC_ILLUMINATION = 100;
}
else
{
IC_ILLUMINATION = 0;
}
}
else
{
if(g_Light.Duty == 100)
{
IC_ILLUMINATION = 10;
}
else if(g_Light.Duty == 200)
{
IC_ILLUMINATION = 20;
}
else if(g_Light.Duty == 250)
{
IC_ILLUMINATION = 27;
......@@ -574,10 +614,6 @@ void Can_Set_Buff_18D00017(canlib_uint8_t CopyData [])
IC_ILLUMINATION = 0;
}
}
else
{
IC_ILLUMINATION = 0;
}
p18D00017->Sig.ILLUMINATION = (IC_ILLUMINATION*10)/4;
}
}
......
......@@ -9,6 +9,7 @@ uint8_t DataESpeedValid ;
#pragma ghs section bss = ".myNonInitArea"
_Light g_Light;
_Light g_nightLight;
uint32_t PowerIgnOnTimeLine = 0;
uint32_t PowerIgnOffTimeLine = 0;
#pragma ghs section bss = default
......@@ -1192,8 +1193,13 @@ void GUI_Sound_Init(void)
void GUI_Light_Init(void)
{
g_Light.Duty = 450;
g_nightLight.Duty = 100;
}
void GUI_nightLightWeakup_Init(void)
{
g_nightLight.Duty = 100;
}
void Gui_LightProc(void)
{
if(SYS_OPR_STAT_HALT)
......@@ -1255,25 +1261,26 @@ void Gui_LightProc(void)
}
else
{
if(Get_TelltalesLedSts(m_LED_Park_Lamp) == 1)
if((Get_TelltalesLedSts(m_LED_Park_Lamp) == 1) || (Get_TelltalesLedSts(m_LED_High_Lamp) == 1))
{
PWM_Channel_Set_Duty(1, g_Light.Duty);//表盘
PWM_Channel_Set_Duty(3, g_Light.Duty);//指针
PWM_Channel_Set_Duty(5, 200);//3.5
PWM_Channel_Set_Duty(1, g_nightLight.Duty);//表盘
PWM_Channel_Set_Duty(3, g_nightLight.Duty);//指针
PWM_Channel_Set_Duty(5, g_nightLight.Duty);//3.5
}
else//close lamp
{
PWM_Channel_Set_Duty(5, 500);//3.5
if(Menu_Get_Current_Cursor_Information() == MENU_ITEM_SET_Backlight)
{
PWM_Channel_Set_Duty(1, g_Light.Duty);//表盘
PWM_Channel_Set_Duty(3, g_Light.Duty);//指针
}
else
{
PWM_Channel_Set_Duty(1, 0);//表盘
PWM_Channel_Set_Duty(3, 0);//指针
}
PWM_Channel_Set_Duty(5, g_Light.Duty);//3.5
// if(Menu_Get_Current_Cursor_Information() == MENU_ITEM_SET_Backlight)
// {
PWM_Channel_Set_Duty(1, g_Light.Duty);//表盘
PWM_Channel_Set_Duty(3, g_Light.Duty);//指针
// }
// else
// {
// PWM_Channel_Set_Duty(1, 0);//表盘
// PWM_Channel_Set_Duty(3, 0);//指针
// }
}
}
}
......@@ -1281,7 +1288,15 @@ void Gui_LightProc(void)
{
if((Pop_Alarm_Get_Current() == POP_ALARM_POSITION_LIGHT)||(Pop_Alarm_Get_Current() == POP_ALARM_KEY))
{
PWM_Channel_Set_Duty(5, 500);//3.5
if((Get_TelltalesLedSts(m_LED_Park_Lamp) == 1) || (Get_TelltalesLedSts(m_LED_High_Lamp) == 1))
{
PWM_Channel_Set_Duty(5, g_nightLight.Duty);//3.5
}
else
{
PWM_Channel_Set_Duty(5, g_Light.Duty);//3.5
}
}
else
{
......@@ -1291,7 +1306,15 @@ void Gui_LightProc(void)
}
else
{
PWM_Channel_Set_Duty(5, 500);//3.5
if((Get_TelltalesLedSts(m_LED_Park_Lamp) == 1) || (Get_TelltalesLedSts(m_LED_High_Lamp) == 1))
{
PWM_Channel_Set_Duty(5, g_nightLight.Duty);//3.5
}
else
{
PWM_Channel_Set_Duty(5, g_Light.Duty);//3.5
}
}
}
PWM_Channel_Set_Duty(1, 0);//表盘
......
......@@ -270,6 +270,7 @@ typedef struct
uint8_t LightCn;
} _Light;
extern _Light g_nightLight;
extern _Light g_Light;
typedef struct
......@@ -484,6 +485,7 @@ uint8_t Common_Get_Act_V_Speed_Valid(void);
uint16_t Get_DispVechileSpeed(void);
uint16_t Get_DispEngineSpeed(void);
void GUI_Light_Init(void);
void GUI_nightLightWeakup_Init(void);
void GUI_Sound_Init(void);
void Gui_LightProc(void);
void Data_Clear_Trip(void);
......
......@@ -4067,51 +4067,104 @@ 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 ( g_Light.Duty == 0 )
if((Get_TelltalesLedSts(m_LED_Park_Lamp) == 1) || (Get_TelltalesLedSts(m_LED_High_Lamp) == 1))
{
Draw_Image_Local(( uint8_t * )Set_CN_01_1_X35_Y169, 35, 169);
Draw_Image_Local(( uint8_t * )Number_18_White_0_X0_Y0, 114, 191);
}
else if ( g_Light.Duty == 150 )
{
Draw_Image_Local(( uint8_t * )Set_CN_01_2_X35_Y169, 35, 169);
Draw_Image_Local(( uint8_t * )Number_18_White_1_X0_Y0, 114, 191);
}
else if ( g_Light.Duty == 200 )
{
Draw_Image_Local(( uint8_t * )Set_CN_01_3_X35_Y169, 35, 169);
Draw_Image_Local(( uint8_t * )Number_18_White_2_X0_Y0, 114, 191);
}
else if ( g_Light.Duty == 250 )
{
Draw_Image_Local(( uint8_t * )Set_CN_01_4_X35_Y169, 35, 169);
Draw_Image_Local(( uint8_t * )Number_18_White_3_X0_Y0, 114, 191);
}
else if ( g_Light.Duty == 300 )
{
Draw_Image_Local(( uint8_t * )Set_CN_01_5_X35_Y169, 35, 169);
Draw_Image_Local(( uint8_t * )Number_18_White_4_X0_Y0, 114, 191);
}
else if ( g_Light.Duty == 350 )
{
Draw_Image_Local(( uint8_t * )Set_CN_01_6_X35_Y169, 35, 169);
Draw_Image_Local(( uint8_t * )Number_18_White_5_X0_Y0, 114, 191);
}
else if ( g_Light.Duty == 400 )
{
Draw_Image_Local(( uint8_t * )Set_CN_01_7_X35_Y169, 35, 169);
Draw_Image_Local(( uint8_t * )Number_18_White_6_X0_Y0, 114, 191);
}
else if ( g_Light.Duty == 450 )
{
Draw_Image_Local(( uint8_t * )Set_CN_01_8_X35_Y169, 35, 169);
Draw_Image_Local(( uint8_t * )Number_18_White_7_X0_Y0, 114, 191);
if ((g_nightLight.Duty == 0))
{
Draw_Image_Local(( uint8_t * )Set_CN_01_1_X35_Y169, 35, 169);
Draw_Image_Local(( uint8_t * )Number_18_White_0_X0_Y0, 114, 191);
}
else if ((g_nightLight.Duty == 100) )
{
Draw_Image_Local(( uint8_t * )Set_CN_01_2_X35_Y169, 35, 169);
Draw_Image_Local(( uint8_t * )Number_18_White_1_X0_Y0, 114, 191);
}
else if ((g_nightLight.Duty == 200) )
{
Draw_Image_Local(( uint8_t * )Set_CN_01_3_X35_Y169, 35, 169);
Draw_Image_Local(( uint8_t * )Number_18_White_2_X0_Y0, 114, 191);
}
else if ((g_nightLight.Duty == 250) )
{
Draw_Image_Local(( uint8_t * )Set_CN_01_4_X35_Y169, 35, 169);
Draw_Image_Local(( uint8_t * )Number_18_White_3_X0_Y0, 114, 191);
}
else if ((g_nightLight.Duty == 300) )
{
Draw_Image_Local(( uint8_t * )Set_CN_01_5_X35_Y169, 35, 169);
Draw_Image_Local(( uint8_t * )Number_18_White_4_X0_Y0, 114, 191);
}
else if ((g_nightLight.Duty == 350) )
{
Draw_Image_Local(( uint8_t * )Set_CN_01_6_X35_Y169, 35, 169);
Draw_Image_Local(( uint8_t * )Number_18_White_5_X0_Y0, 114, 191);
}
else if ((g_nightLight.Duty == 400) )
{
Draw_Image_Local(( uint8_t * )Set_CN_01_7_X35_Y169, 35, 169);
Draw_Image_Local(( uint8_t * )Number_18_White_6_X0_Y0, 114, 191);
}
else if ((g_nightLight.Duty == 450) )
{
Draw_Image_Local(( uint8_t * )Set_CN_01_8_X35_Y169, 35, 169);
Draw_Image_Local(( uint8_t * )Number_18_White_7_X0_Y0, 114, 191);
}
else if ((g_nightLight.Duty == 500) )
{
Draw_Image_Local(( uint8_t * )Set_CN_01_9_X35_Y169, 35, 169);
Draw_Image_Local(( uint8_t * )Number_18_White_8_X0_Y0, 114, 191);
}
}
else if ( g_Light.Duty == 500 )
else
{
Draw_Image_Local(( uint8_t * )Set_CN_01_9_X35_Y169, 35, 169);
Draw_Image_Local(( uint8_t * )Number_18_White_8_X0_Y0, 114, 191);
if ( (g_Light.Duty == 0))
{
Draw_Image_Local(( uint8_t * )Set_CN_01_1_X35_Y169, 35, 169);
Draw_Image_Local(( uint8_t * )Number_18_White_0_X0_Y0, 114, 191);
}
else if ( (g_Light.Duty == 100))
{
Draw_Image_Local(( uint8_t * )Set_CN_01_2_X35_Y169, 35, 169);
Draw_Image_Local(( uint8_t * )Number_18_White_1_X0_Y0, 114, 191);
}
else if ( (g_Light.Duty == 200))
{
Draw_Image_Local(( uint8_t * )Set_CN_01_3_X35_Y169, 35, 169);
Draw_Image_Local(( uint8_t * )Number_18_White_2_X0_Y0, 114, 191);
}
else if ( (g_Light.Duty == 250))
{
Draw_Image_Local(( uint8_t * )Set_CN_01_4_X35_Y169, 35, 169);
Draw_Image_Local(( uint8_t * )Number_18_White_3_X0_Y0, 114, 191);
}
else if ( (g_Light.Duty == 300))
{
Draw_Image_Local(( uint8_t * )Set_CN_01_5_X35_Y169, 35, 169);
Draw_Image_Local(( uint8_t * )Number_18_White_4_X0_Y0, 114, 191);
}
else if ( (g_Light.Duty == 350))
{
Draw_Image_Local(( uint8_t * )Set_CN_01_6_X35_Y169, 35, 169);
Draw_Image_Local(( uint8_t * )Number_18_White_5_X0_Y0, 114, 191);
}
else if ( (g_Light.Duty == 400))
{
Draw_Image_Local(( uint8_t * )Set_CN_01_7_X35_Y169, 35, 169);
Draw_Image_Local(( uint8_t * )Number_18_White_6_X0_Y0, 114, 191);
}
else if ( (g_Light.Duty == 450))
{
Draw_Image_Local(( uint8_t * )Set_CN_01_8_X35_Y169, 35, 169);
Draw_Image_Local(( uint8_t * )Number_18_White_7_X0_Y0, 114, 191);
}
else if ( (g_Light.Duty == 500))
{
Draw_Image_Local(( uint8_t * )Set_CN_01_9_X35_Y169, 35, 169);
Draw_Image_Local(( uint8_t * )Number_18_White_8_X0_Y0, 114, 191);
}
}
}
/***********************************************************************************************************/
void Gui_Volume(INT8U Volume)
......
......@@ -304,8 +304,30 @@ void Menu_Logic_Operation_SET_Backlight(Menu_Key_en_t enKeyType)
{
updataDir = 1;
datmax = 500u;
datmin = 150u;
Menu_u16Data_Updata_Process(updataDir, datmax, datmin, 50u, (uint16_t*)&(g_Light.Duty));
datmin = 100u;
if((Get_TelltalesLedSts(m_LED_Park_Lamp) == 1) || (Get_TelltalesLedSts(m_LED_High_Lamp) == 1))
{
if(g_nightLight.Duty == 100u)
{
Menu_u16Data_Updata_Process(updataDir, datmax, datmin, 100u, (uint16_t*)&(g_nightLight.Duty));
}
else
{
Menu_u16Data_Updata_Process(updataDir, datmax, datmin, 50u, (uint16_t*)&(g_nightLight.Duty));
}
}
else
{
if(g_Light.Duty == 100u)
{
Menu_u16Data_Updata_Process(updataDir, datmax, datmin, 100u, (uint16_t*)&(g_Light.Duty));
}
else
{
Menu_u16Data_Updata_Process(updataDir, datmax, datmin, 50u, (uint16_t*)&(g_Light.Duty));
}
}
}
else if(enKeyType == MENU_KEY_TIMEOUT)
{
......
......@@ -159,7 +159,7 @@ void PoMa_Wakeup_Init(void)
WDT_Clear( );
PWM_Init( );
FuelWake( );
GUI_nightLightWeakup_Init();
#ifndef INNER_PIC_ON
BSP_QSPI_Init( );
// Gui_LoadFontInfo();
......
......@@ -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','.','1',0x20,0x20,0x20,0x20};
const uint8_t DID_22_F195[8] = {'V','1','.','2',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