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