Commit a99874fa authored by 郑萍's avatar 郑萍

Merge branch 'dev' of http://tyw-server.synology.me:12345/shihao/haojin750tft into zhengping

parents a98c02be e81dbe30
......@@ -361,7 +361,7 @@
</VariousControls>
</Aads>
<LDads>
<umfTarg>0</umfTarg>
<umfTarg>1</umfTarg>
<Ropi>0</Ropi>
<Rwpi>0</Rwpi>
<noStLib>0</noStLib>
......@@ -968,16 +968,16 @@
<FileType>5</FileType>
<FilePath>..\..\..\..\Source\Component\AMT630H\PicBin.h</FilePath>
</File>
<File>
<FileName>UartProtocol.h</FileName>
<FileType>5</FileType>
<FilePath>..\..\..\..\Source\Component\AMT630H\UartProtocol.h</FilePath>
</File>
<File>
<FileName>UartProtocol_V1.32_BAT32A239.lib</FileName>
<FileType>4</FileType>
<FilePath>..\..\..\..\Source\Component\AMT630H\UartProtocol_V1.32_BAT32A239.lib</FilePath>
</File>
<File>
<FileName>UartProtocol.h</FileName>
<FileType>5</FileType>
<FilePath>..\..\..\..\Source\Component\AMT630H\UartProtocol.h</FilePath>
</File>
<File>
<FileName>AMT630H_Datas.c</FileName>
<FileType>1</FileType>
......
......@@ -30,7 +30,7 @@ typedef struct
} _st_BacklightLevel;
#define Backlight_Max 10
#define BacklightLevel_Max 10
#define BacklightLevel_Max 5
_st_Backlight BacklightTable[Backlight_Max] =
{
/*温度 阻值 */
......@@ -50,9 +50,9 @@ _st_BacklightLevel BacklightLevelTable[BacklightLevel_Max] =
/*背光等级 背光占空比 */
{1, 100},
{2, 200},
{3, 300},
{4, 400},
{5, 500},
{3, 400},
{4, 600},
{5, 800},
};
......@@ -63,8 +63,6 @@ void Data_Light_Res_service(Light_uint8_t deltaTime)//获取光感阻值,并
uint8_t i, j;
uint32_t temp32;
static uint16_t timeCount = 0;
if(GET_Backlight() == Backlight_ATUO)
{
if (timeCount >= LIGHT_DATA_TIME)
{
timeCount = 0;
......@@ -72,7 +70,6 @@ void Data_Light_Res_service(Light_uint8_t deltaTime)//获取光感阻值,并
{
/*获取光敏电阻*/
LightRes = ADC_Read_Signal(ADC_CH_LIGHT_SENSITIVE); // ADC_Read_Signal(ADC_CH_FUEL1);
/*四舍五入*/
if (LightRes < 32000)
{
......@@ -114,41 +111,61 @@ void Data_Light_Res_service(Light_uint8_t deltaTime)//获取光感阻值,并
}
}
timeCount += deltaTime;
if(LightADCompleteFlg)
if(Menu_Item_Select_Get(MENU_ITEM_SELECT_AUTO))
{
if(LightR_Status == 0)
if(LightADCompleteFlg)
{
if(LightR >20)
if(LightR <= 800)
{
LightR_Status_Count++;
if(LightR_Status_Count>=150)
{
LightR_Status_Count = 0;
LightR_Status = 0;
}
else
}
else if(LightR > 800)
{
LightR_Status_Count = 0 ;
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, 200);
}
else
{
if(LightR <20)
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, 800);
}
}
}
else if(Menu_Item_Select_Get(MENU_ITEM_BACKLIGHT_AUTO))
{
if(Backlight_SetPwmLevel() == 1U)
{
LightR_Status_Count++;
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, 100);
}
else
else if(Backlight_SetPwmLevel() == 2U)
{
LightR_Status_Count = 0 ;
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, 200);
}
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, 800);
else if(Backlight_SetPwmLevel() == 3U)
{
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, 400);
}
if(LightR_Status_Count>=150)
else if(Backlight_SetPwmLevel() == 4U)
{
LightR_Status_Count = 0;
LightR_Status = !LightR_Status;
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, 600);
}
else if(Backlight_SetPwmLevel() == 5U)
{
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, 800);
}
}
else
{
......@@ -214,8 +231,29 @@ Light_uint8_t Backlight_SetPwmEn(void)
/* 背光等级回调函数 */
Light_uint8_t Backlight_SetPwmLevel(void)
{
Light_uint8_t Backlight_PwmLevel;
return 1;
if(LightR > 0 && LightR <= 400)
{
Backlight_PwmLevel = 1U;
}
else if(LightR > 400 && LightR <= 800)
{
Backlight_PwmLevel = 2U;
}
else if(LightR > 800 && LightR <= 1400)
{
Backlight_PwmLevel = 3U;
}
else if(LightR > 1400 && LightR <= 2000)
{
Backlight_PwmLevel = 4U;
}
else if(LightR > 2000 && LightR <= 2600)
{
Backlight_PwmLevel = 5U;
}
return Backlight_PwmLevel;
}
/* 获取电阻值回调函数 */
......
......@@ -21,8 +21,10 @@
#define Backlight_NULL ( void * )0u
#endif /* NULL */
extern Light_uint16_t LightR_Status ;
void Backlight_KL30_Wakeup_Init(void);
void BackLight_Process(void);
Light_uint8_t Backlight_SetPwmLevel(void);
......
......@@ -80,7 +80,7 @@ void Gpio_Init(_GpioUser_Enum InitMode)
RTE_GPIO_Config(RTE_GPIO_PORT14_PIN00, GpioOut_Low); //L_BD433Ctrl_OUT
RTE_GPIO_Config(RTE_GPIO_PORT14_PIN01, RTE_GPIO_DIR_IN); //L_BiasBitSW_燃油_OUT---
RTE_GPIO_Config(RTE_GPIO_PORT14_PIN06, GpioOut_Low);
RTE_GPIO_Config(RTE_GPIO_PORT14_PIN07, GpioOut_Low);
RTE_GPIO_Config(RTE_GPIO_PORT14_PIN07, RTE_GPIO_DIR_IN);
}
else
{
......
......@@ -85,7 +85,7 @@ const __attribute__((aligned(4))) ADC_Ch_Cfg_st_t stADCChCfg[ADC_SIGNAL_CH_NUMBE
{ 3U, 2U, 0U, 2U, 0U, 1U, ADC_Res_Calc_Circuit101,},
{ 4U, 2U, 0U, 2U, 0U, 1U, ADC_Res_Calc_Circuit101,},
{ 5U, 3U, 0U, 5000U, 0U, 10U, ADC_Res_Calc_Circuit201,},
{ 6U, 2U, 0U, 2U, 0U, 1U, ADC_Res_Calc_Circuit101,},
{ 6U, 0U, 0U, 0U, 0U, 1U, ADC_Voltage_Calc_Circuit101,},
};
......@@ -97,7 +97,7 @@ const __attribute__((aligned(4))) ADC_Res_List_st_t stADCResList[ADC_SIGNAL_CH_N
{ 0U, 0U, 500U, 300U,},
{ 0U, 0U, 500U, 0U,},
{ 47000U, 0U, 100000U, 0U,},
{ 0U, 0U, 500U, 0U,},
{ 0U, 100000U, 0U, 0U,},
};
/* Private function prototypes ----------------------------------------------*/
......
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