Commit 3018a863 authored by 时昊's avatar 时昊

feat:修改背光调节

parent e89a14b5
#include "Backlight.h" #include "Backlight.h"
#include "Components.h" #include "Components.h"
#define BACK_LIGHT_Val_1 100
#define BACK_LIGHT_Val_2 300
#define BACK_LIGHT_Val_3 500
#define BACK_LIGHT_Val_4 700
#define BACK_LIGHT_Val_5 900
typedef struct typedef struct
{ {
Light_uint16_t Temperature; /* 温度 */ Light_uint16_t Temperature; /* 温度 */
...@@ -377,4 +383,32 @@ void BackLight_Service(void) ...@@ -377,4 +383,32 @@ void BackLight_Service(void)
{ {
Backlight_Operate.SetPwmCbk(0); Backlight_Operate.SetPwmCbk(0);
} }
} }
\ No newline at end of file
void BackLight_Process(void)
{
if(Menu_Item_Select_Get(MENU_ITEM_BACKLIGHT_5) == 1)
{
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_Val_5);
}
else if(Menu_Item_Select_Get(MENU_ITEM_BACKLIGHT_4) == 1)
{
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_Val_4);
}
else if(Menu_Item_Select_Get(MENU_ITEM_BACKLIGHT_3) == 1)
{
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_Val_3);
}
else if(Menu_Item_Select_Get(MENU_ITEM_BACKLIGHT_2) == 1)
{
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_Val_2);
}
else if(Menu_Item_Select_Get(MENU_ITEM_BACKLIGHT_1) == 1)
{
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_Val_1);
}
else
{
;
}
}
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#endif /* NULL */ #endif /* NULL */
void Backlight_KL30_Wakeup_Init(void); void Backlight_KL30_Wakeup_Init(void);
void BackLight_Process(void);
......
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