Commit 7882467d authored by 李俭双's avatar 李俭双

🐞 fix:规范变更,取消远光灯控制背光策略,增加位置信号控制背光

parent aa8f3c5a
......@@ -3,23 +3,51 @@
#include "Components.h"
#include "Application.h"
#include "TrmerM\TrmerM.h"
#include "Line_In\Line_In_user.h"
#define BACK_LIGHT_DAY 600
#define BACK_LIGHT_NIGHT 420
_Light g_Light;
//_Light g_Light;
uint8_t LED_Turnoff = 0;
uint8_t LED_Turnon = 0;
void BackLight_Init(void)
{
g_Light.Light_Day = 0XFFFF;
g_Light.Light_Night = 0XFFFF;
//g_Light.Light_Day = 0XFFFF;
//g_Light.Light_Night = 0XFFFF;
LED_Turnoff = 0;
LED_Turnon = 0;
}
void BackLight_Process(void)
{
if (SYS_OPR_STAT_IGN_ON)
{
if ( HighBeam_Timer.LED_Turnon == 10 )
if (Line_In_Get_Status(LINE_IN_Little_Lamp))
{
if(LED_Turnon < 5)
{
LED_Turnon ++ ;
}
else
{
LED_Turnon = 5;
LED_Turnoff = 0;
}
}
else
{
if(LED_Turnoff < 5)
{
LED_Turnoff ++ ;
}
else
{
LED_Turnoff = 5;
LED_Turnon = 0;
}
}
if ( LED_Turnon == 5 )
{
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_NIGHT);
}
......@@ -31,8 +59,8 @@ void BackLight_Process(void)
}
else
{
g_Light.Light_Day = 0;
g_Light.Light_Night = 0;
//g_Light.Light_Day = 0;
//g_Light.Light_Night = 0;
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, 0);
}
}
#ifndef _BACKLIGHT_H_
#define _BACKLIGHT_H_
#include "common.h"
#include "Application.h"
typedef struct
{
uint8_t Duty;
......
......@@ -13,9 +13,22 @@ const Line_In_Attribute_st g_stLineInAttribute[LINE_IN_MAX] =
{LEVEL_HIGH, LEVEL_LOW, LINE_IN_IG_ON, 100U, 20U, Get_LINE_IN_Fault_ABS, },
{LEVEL_HIGH, LEVEL_LOW, LINE_IN_IG_ON, 500U, 20U, Get_LINE_IN_Oil_Pressure, },
{LEVEL_HIGH, LEVEL_LOW, LINE_IN_IG_ON, 100U, 20U, Get_LINE_IN_Auto_Start_Stop, },
{LEVEL_LOW, LEVEL_HIGH, LINE_IN_IG_ON, 100U, 20U, Get_LINE_IN_Little_Lamp, },
};
Linelib_uint8_t Get_LINE_IN_Little_Lamp(void)
{
Linelib_uint8_t ret = 0U;
if (RTE_GPIO_Get_Level(PositionBeam_P_IN))
{
ret = 1u;
}
else
{
ret = 0UL;
}
return ret;
}
Linelib_uint8_t Get_LINE_IN_TurnLeft(void)
{
Linelib_uint8_t ret = 0U;
......
......@@ -12,7 +12,7 @@ typedef enum
LINE_IN_Fault_ABS,
LINE_IN_Oil_Pressure,
LINE_IN_Auto_Start_Stop,
LINE_IN_Little_Lamp,
LINE_IN_MAX,
} LINE_IN_Enum_t;
......@@ -25,5 +25,6 @@ Linelib_uint8_t Get_LINE_IN_FAULT_ELECTROSPRAY(void);
Linelib_uint8_t Get_LINE_IN_Fault_ABS(void);
Linelib_uint8_t Get_LINE_IN_Oil_Pressure(void);
Linelib_uint8_t Get_LINE_IN_Auto_Start_Stop(void);
Linelib_uint8_t Get_LINE_IN_Little_Lamp(void);
#endif
......@@ -90,29 +90,29 @@ static Tellib_uint16_t LED_High_Beam_Judgement(void)
if (Line_In_Get_Status(LINE_IN_HighBeam))
{
LED_STATE = 1;
if(HighBeam_Timer.LED_Turnon < 10 )
{
HighBeam_Timer.LED_Turnon ++;
}
else
{
HighBeam_Timer.LED_Turnon = 10;
HighBeam_Timer.LED_Turnoff = 0;
}
//if(HighBeam_Timer.LED_Turnon < 10 )
//{
// HighBeam_Timer.LED_Turnon ++;
//}
//else
//{
// HighBeam_Timer.LED_Turnon = 10;
// HighBeam_Timer.LED_Turnoff = 0;
//}
}
else
{
LED_STATE = 0;
if(HighBeam_Timer.LED_Turnoff < 10 )
{
HighBeam_Timer.LED_Turnoff ++;
}
else
{
HighBeam_Timer.LED_Turnoff = 10;
HighBeam_Timer.LED_Turnon = 0;
}
//if(HighBeam_Timer.LED_Turnoff < 10 )
//{
// HighBeam_Timer.LED_Turnoff ++;
//}
//else
//{
// HighBeam_Timer.LED_Turnoff = 10;
// HighBeam_Timer.LED_Turnon = 0;
//}
}
return LED_STATE;
......
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