Commit a4105297 authored by 王雅楠's avatar 王雅楠

feat:添加光感接口 新增背光自动选项

parent 7341515d
...@@ -6,6 +6,7 @@ uint8_t g_u8Display_Mode = ModeDAY; ...@@ -6,6 +6,7 @@ uint8_t g_u8Display_Mode = ModeDAY;
uint8_t g_u8Display_Mode_select = ModeDAY; uint8_t g_u8Display_Mode_select = ModeDAY;
uint8_t g_u8Language = CH; uint8_t g_u8Language = CH;
uint8_t g_u8Backlight = Backlight_4 ; uint8_t g_u8Backlight = Backlight_4 ;
uint8_t g_u8Backlight_select = Backlight_4 ;
uint8_t g_u8UnitSetting = Metric ; uint8_t g_u8UnitSetting = Metric ;
uint8_t g_u8SelfCheck = 0;/*自检*/ uint8_t g_u8SelfCheck = 0;/*自检*/
...@@ -402,7 +403,7 @@ void AMT630H_GUI_Backlight_Information(void) ...@@ -402,7 +403,7 @@ void AMT630H_GUI_Backlight_Information(void)
SetPagePic(GRAPHICS_PAGE_0, Pic_0122_436_519); SetPagePic(GRAPHICS_PAGE_0, Pic_0122_436_519);
} }
/*背光等级选择*/ /*背光等级选择*/
if(g_u8Backlight == Backlight_5) if(g_u8Backlight_select == Backlight_5)
{ {
SetPagePic(GRAPHICS_PAGE_0, Pic_0059_509_353); SetPagePic(GRAPHICS_PAGE_0, Pic_0059_509_353);
SetPagePic(GRAPHICS_PAGE_0, Pic_0060_504_307); SetPagePic(GRAPHICS_PAGE_0, Pic_0060_504_307);
...@@ -410,7 +411,7 @@ void AMT630H_GUI_Backlight_Information(void) ...@@ -410,7 +411,7 @@ void AMT630H_GUI_Backlight_Information(void)
SetPagePic(GRAPHICS_PAGE_0, Pic_0062_503_219); SetPagePic(GRAPHICS_PAGE_0, Pic_0062_503_219);
SetPagePic(GRAPHICS_PAGE_0, Pic_0063_495_145); SetPagePic(GRAPHICS_PAGE_0, Pic_0063_495_145);
} }
else if(g_u8Backlight == Backlight_4) else if(g_u8Backlight_select == Backlight_4)
{ {
SetPagePic(GRAPHICS_PAGE_0, Pic_0059_509_353); SetPagePic(GRAPHICS_PAGE_0, Pic_0059_509_353);
SetPagePic(GRAPHICS_PAGE_0, Pic_0060_504_307); SetPagePic(GRAPHICS_PAGE_0, Pic_0060_504_307);
...@@ -418,7 +419,7 @@ void AMT630H_GUI_Backlight_Information(void) ...@@ -418,7 +419,7 @@ void AMT630H_GUI_Backlight_Information(void)
SetPagePic(GRAPHICS_PAGE_0, Pic_0064_493_190); SetPagePic(GRAPHICS_PAGE_0, Pic_0064_493_190);
SetPagePic(GRAPHICS_PAGE_0, Pic_0065_504_136); SetPagePic(GRAPHICS_PAGE_0, Pic_0065_504_136);
} }
else if(g_u8Backlight == Backlight_3) else if(g_u8Backlight_select == Backlight_3)
{ {
SetPagePic(GRAPHICS_PAGE_0, Pic_0059_509_353); SetPagePic(GRAPHICS_PAGE_0, Pic_0059_509_353);
SetPagePic(GRAPHICS_PAGE_0, Pic_0060_504_307); SetPagePic(GRAPHICS_PAGE_0, Pic_0060_504_307);
...@@ -426,7 +427,7 @@ void AMT630H_GUI_Backlight_Information(void) ...@@ -426,7 +427,7 @@ void AMT630H_GUI_Backlight_Information(void)
SetPagePic(GRAPHICS_PAGE_0, Pic_0062_503_186); SetPagePic(GRAPHICS_PAGE_0, Pic_0062_503_186);
SetPagePic(GRAPHICS_PAGE_0, Pic_0065_504_136); SetPagePic(GRAPHICS_PAGE_0, Pic_0065_504_136);
} }
else if(g_u8Backlight == Backlight_2) else if(g_u8Backlight_select == Backlight_2)
{ {
SetPagePic(GRAPHICS_PAGE_0, Pic_0059_509_353); SetPagePic(GRAPHICS_PAGE_0, Pic_0059_509_353);
SetPagePic(GRAPHICS_PAGE_0, Pic_0067_495_281); SetPagePic(GRAPHICS_PAGE_0, Pic_0067_495_281);
...@@ -434,7 +435,7 @@ void AMT630H_GUI_Backlight_Information(void) ...@@ -434,7 +435,7 @@ void AMT630H_GUI_Backlight_Information(void)
SetPagePic(GRAPHICS_PAGE_0, Pic_0062_503_186); SetPagePic(GRAPHICS_PAGE_0, Pic_0062_503_186);
SetPagePic(GRAPHICS_PAGE_0, Pic_0065_504_136); SetPagePic(GRAPHICS_PAGE_0, Pic_0065_504_136);
} }
else if(g_u8Backlight == Backlight_1) else if(g_u8Backlight_select == Backlight_1)
{ {
SetPagePic(GRAPHICS_PAGE_0, Pic_0069_506_332); SetPagePic(GRAPHICS_PAGE_0, Pic_0069_506_332);
SetPagePic(GRAPHICS_PAGE_0, Pic_0060_504_286); SetPagePic(GRAPHICS_PAGE_0, Pic_0060_504_286);
...@@ -442,7 +443,7 @@ void AMT630H_GUI_Backlight_Information(void) ...@@ -442,7 +443,7 @@ void AMT630H_GUI_Backlight_Information(void)
SetPagePic(GRAPHICS_PAGE_0, Pic_0062_503_186); SetPagePic(GRAPHICS_PAGE_0, Pic_0062_503_186);
SetPagePic(GRAPHICS_PAGE_0, Pic_0065_504_136); SetPagePic(GRAPHICS_PAGE_0, Pic_0065_504_136);
} }
else if(g_u8Backlight == Backlight_ATUO) else if(g_u8Backlight_select == Backlight_ATUO)
{ {
SetPagePic(GRAPHICS_PAGE_0, Pic_0059_509_286); SetPagePic(GRAPHICS_PAGE_0, Pic_0059_509_286);
SetPagePic(GRAPHICS_PAGE_0, Pic_0060_504_236); SetPagePic(GRAPHICS_PAGE_0, Pic_0060_504_236);
...@@ -477,7 +478,7 @@ void AMT630H_GUI_Backlight_Information(void) ...@@ -477,7 +478,7 @@ void AMT630H_GUI_Backlight_Information(void)
SetPagePic(GRAPHICS_PAGE_0, Pic_0310_436_519); SetPagePic(GRAPHICS_PAGE_0, Pic_0310_436_519);
} }
/*背光等级选择*/ /*背光等级选择*/
if(g_u8Backlight == Backlight_5) if(g_u8Backlight_select == Backlight_5)
{ {
SetPagePic(GRAPHICS_PAGE_0, Pic_0245_509_353); SetPagePic(GRAPHICS_PAGE_0, Pic_0245_509_353);
SetPagePic(GRAPHICS_PAGE_0, Pic_0246_504_307); SetPagePic(GRAPHICS_PAGE_0, Pic_0246_504_307);
...@@ -485,7 +486,7 @@ void AMT630H_GUI_Backlight_Information(void) ...@@ -485,7 +486,7 @@ void AMT630H_GUI_Backlight_Information(void)
SetPagePic(GRAPHICS_PAGE_0, Pic_0248_503_219); SetPagePic(GRAPHICS_PAGE_0, Pic_0248_503_219);
SetPagePic(GRAPHICS_PAGE_0, Pic_0249_495_145); SetPagePic(GRAPHICS_PAGE_0, Pic_0249_495_145);
} }
else if(g_u8Backlight == Backlight_4) else if(g_u8Backlight_select == Backlight_4)
{ {
SetPagePic(GRAPHICS_PAGE_0, Pic_0245_509_353); SetPagePic(GRAPHICS_PAGE_0, Pic_0245_509_353);
SetPagePic(GRAPHICS_PAGE_0, Pic_0246_504_307); SetPagePic(GRAPHICS_PAGE_0, Pic_0246_504_307);
...@@ -493,7 +494,7 @@ void AMT630H_GUI_Backlight_Information(void) ...@@ -493,7 +494,7 @@ void AMT630H_GUI_Backlight_Information(void)
SetPagePic(GRAPHICS_PAGE_0, Pic_0250_493_190); SetPagePic(GRAPHICS_PAGE_0, Pic_0250_493_190);
SetPagePic(GRAPHICS_PAGE_0, Pic_0251_504_136); SetPagePic(GRAPHICS_PAGE_0, Pic_0251_504_136);
} }
else if(g_u8Backlight == Backlight_3) else if(g_u8Backlight_select == Backlight_3)
{ {
SetPagePic(GRAPHICS_PAGE_0, Pic_0245_509_353); SetPagePic(GRAPHICS_PAGE_0, Pic_0245_509_353);
SetPagePic(GRAPHICS_PAGE_0, Pic_0246_504_307); SetPagePic(GRAPHICS_PAGE_0, Pic_0246_504_307);
...@@ -501,7 +502,7 @@ void AMT630H_GUI_Backlight_Information(void) ...@@ -501,7 +502,7 @@ void AMT630H_GUI_Backlight_Information(void)
SetPagePic(GRAPHICS_PAGE_0, Pic_0248_503_186); SetPagePic(GRAPHICS_PAGE_0, Pic_0248_503_186);
SetPagePic(GRAPHICS_PAGE_0, Pic_0251_504_136); SetPagePic(GRAPHICS_PAGE_0, Pic_0251_504_136);
} }
else if(g_u8Backlight == Backlight_2) else if(g_u8Backlight_select == Backlight_2)
{ {
SetPagePic(GRAPHICS_PAGE_0, Pic_0245_509_353); SetPagePic(GRAPHICS_PAGE_0, Pic_0245_509_353);
SetPagePic(GRAPHICS_PAGE_0, Pic_0253_495_281); SetPagePic(GRAPHICS_PAGE_0, Pic_0253_495_281);
...@@ -509,7 +510,7 @@ void AMT630H_GUI_Backlight_Information(void) ...@@ -509,7 +510,7 @@ void AMT630H_GUI_Backlight_Information(void)
SetPagePic(GRAPHICS_PAGE_0, Pic_0248_503_186); SetPagePic(GRAPHICS_PAGE_0, Pic_0248_503_186);
SetPagePic(GRAPHICS_PAGE_0, Pic_0251_504_136); SetPagePic(GRAPHICS_PAGE_0, Pic_0251_504_136);
} }
else if(g_u8Backlight == Backlight_1) else if(g_u8Backlight_select == Backlight_1)
{ {
SetPagePic(GRAPHICS_PAGE_0, Pic_0255_506_332); SetPagePic(GRAPHICS_PAGE_0, Pic_0255_506_332);
SetPagePic(GRAPHICS_PAGE_0, Pic_0246_504_286); SetPagePic(GRAPHICS_PAGE_0, Pic_0246_504_286);
...@@ -517,7 +518,7 @@ void AMT630H_GUI_Backlight_Information(void) ...@@ -517,7 +518,7 @@ void AMT630H_GUI_Backlight_Information(void)
SetPagePic(GRAPHICS_PAGE_0, Pic_0248_503_186); SetPagePic(GRAPHICS_PAGE_0, Pic_0248_503_186);
SetPagePic(GRAPHICS_PAGE_0, Pic_0251_504_136); SetPagePic(GRAPHICS_PAGE_0, Pic_0251_504_136);
} }
else if(g_u8Backlight == Backlight_ATUO) else if(g_u8Backlight_select == Backlight_ATUO)
{ {
SetPagePic(GRAPHICS_PAGE_0, Pic_0245_509_286); SetPagePic(GRAPHICS_PAGE_0, Pic_0245_509_286);
SetPagePic(GRAPHICS_PAGE_0, Pic_0246_504_236); SetPagePic(GRAPHICS_PAGE_0, Pic_0246_504_236);
...@@ -1681,13 +1682,6 @@ void AMT630H_GUI_Display_Mode_Setting(Menu_Item_en_t display_mode) /*图 显示 ...@@ -1681,13 +1682,6 @@ void AMT630H_GUI_Display_Mode_Setting(Menu_Item_en_t display_mode) /*图 显示
*/ */
void AMT630H_GUI_Backlight_Setting(Menu_Item_en_t back_mode) /*图 背光*/ void AMT630H_GUI_Backlight_Setting(Menu_Item_en_t back_mode) /*图 背光*/
{ {
/*case 0 自动*/
/*case 1 选中1*/
/*case 2 选中2*/
/*case 3 选中3*/
/*case 4 选中4*/
/*case 5 选中5*/
if(g_u8Display_Mode == ModeDAY)/*日间模式*/ if(g_u8Display_Mode == ModeDAY)/*日间模式*/
{ {
if(g_u8Language == CH) if(g_u8Language == CH)
...@@ -1713,6 +1707,7 @@ void AMT630H_GUI_Backlight_Setting(Menu_Item_en_t back_mode) /*图 背光*/ ...@@ -1713,6 +1707,7 @@ void AMT630H_GUI_Backlight_Setting(Menu_Item_en_t back_mode) /*图 背光*/
if(Menu_Item_Select_Get(MENU_ITEM_BACKLIGHT_5)) if(Menu_Item_Select_Get(MENU_ITEM_BACKLIGHT_5))
{ {
g_u8Backlight = Backlight_5 ; g_u8Backlight = Backlight_5 ;
g_u8Backlight_select =Backlight_5 ;
} }
else else
{ {
...@@ -1731,6 +1726,7 @@ void AMT630H_GUI_Backlight_Setting(Menu_Item_en_t back_mode) /*图 背光*/ ...@@ -1731,6 +1726,7 @@ void AMT630H_GUI_Backlight_Setting(Menu_Item_en_t back_mode) /*图 背光*/
if(Menu_Item_Select_Get(MENU_ITEM_BACKLIGHT_4)) if(Menu_Item_Select_Get(MENU_ITEM_BACKLIGHT_4))
{ {
g_u8Backlight = Backlight_4 ; g_u8Backlight = Backlight_4 ;
g_u8Backlight_select =Backlight_4 ;
} }
else else
{ {
...@@ -1749,6 +1745,7 @@ void AMT630H_GUI_Backlight_Setting(Menu_Item_en_t back_mode) /*图 背光*/ ...@@ -1749,6 +1745,7 @@ void AMT630H_GUI_Backlight_Setting(Menu_Item_en_t back_mode) /*图 背光*/
if(Menu_Item_Select_Get(MENU_ITEM_BACKLIGHT_3)) if(Menu_Item_Select_Get(MENU_ITEM_BACKLIGHT_3))
{ {
g_u8Backlight = Backlight_3 ; g_u8Backlight = Backlight_3 ;
g_u8Backlight_select =Backlight_3 ;
} }
else else
{ {
...@@ -1767,6 +1764,7 @@ void AMT630H_GUI_Backlight_Setting(Menu_Item_en_t back_mode) /*图 背光*/ ...@@ -1767,6 +1764,7 @@ void AMT630H_GUI_Backlight_Setting(Menu_Item_en_t back_mode) /*图 背光*/
if(Menu_Item_Select_Get(MENU_ITEM_BACKLIGHT_2)) if(Menu_Item_Select_Get(MENU_ITEM_BACKLIGHT_2))
{ {
g_u8Backlight = Backlight_2 ; g_u8Backlight = Backlight_2 ;
g_u8Backlight_select =Backlight_2 ;
} }
else else
{ {
...@@ -1785,6 +1783,7 @@ void AMT630H_GUI_Backlight_Setting(Menu_Item_en_t back_mode) /*图 背光*/ ...@@ -1785,6 +1783,7 @@ void AMT630H_GUI_Backlight_Setting(Menu_Item_en_t back_mode) /*图 背光*/
if(Menu_Item_Select_Get(MENU_ITEM_BACKLIGHT_1)) if(Menu_Item_Select_Get(MENU_ITEM_BACKLIGHT_1))
{ {
g_u8Backlight = Backlight_1 ; g_u8Backlight = Backlight_1 ;
g_u8Backlight_select =Backlight_1 ;
} }
else else
{ {
...@@ -1809,7 +1808,31 @@ void AMT630H_GUI_Backlight_Setting(Menu_Item_en_t back_mode) /*图 背光*/ ...@@ -1809,7 +1808,31 @@ void AMT630H_GUI_Backlight_Setting(Menu_Item_en_t back_mode) /*图 背光*/
/*记忆选择*/ /*记忆选择*/
if(Menu_Item_Select_Get(MENU_ITEM_BACKLIGHT_AUTO)) if(Menu_Item_Select_Get(MENU_ITEM_BACKLIGHT_AUTO))
{ {
g_u8Backlight = Backlight_ATUO ; g_u8Backlight_select = Backlight_ATUO ;
if(Backlight_SetPwmLevel() == 5)
{
g_u8Backlight = Backlight_5;
}
else if(Backlight_SetPwmLevel() == 4)
{
g_u8Backlight = Backlight_4;
}
else if(Backlight_SetPwmLevel() == 3)
{
g_u8Backlight = Backlight_3;
}
else if(Backlight_SetPwmLevel() == 2)
{
g_u8Backlight = Backlight_2;
}
else if(Backlight_SetPwmLevel() == 1)
{
g_u8Backlight = Backlight_1;
}
else
{
;
}
} }
else else
{ {
...@@ -1845,6 +1868,7 @@ void AMT630H_GUI_Backlight_Setting(Menu_Item_en_t back_mode) /*图 背光*/ ...@@ -1845,6 +1868,7 @@ void AMT630H_GUI_Backlight_Setting(Menu_Item_en_t back_mode) /*图 背光*/
if(Menu_Item_Select_Get(MENU_ITEM_BACKLIGHT_5)) if(Menu_Item_Select_Get(MENU_ITEM_BACKLIGHT_5))
{ {
g_u8Backlight = Backlight_5 ; g_u8Backlight = Backlight_5 ;
g_u8Backlight_select = Backlight_5 ;
} }
else else
{ {
...@@ -1863,6 +1887,7 @@ void AMT630H_GUI_Backlight_Setting(Menu_Item_en_t back_mode) /*图 背光*/ ...@@ -1863,6 +1887,7 @@ void AMT630H_GUI_Backlight_Setting(Menu_Item_en_t back_mode) /*图 背光*/
if(Menu_Item_Select_Get(MENU_ITEM_BACKLIGHT_4)) if(Menu_Item_Select_Get(MENU_ITEM_BACKLIGHT_4))
{ {
g_u8Backlight = Backlight_4 ; g_u8Backlight = Backlight_4 ;
g_u8Backlight_select = Backlight_4 ;
} }
else else
{ {
...@@ -1881,6 +1906,7 @@ void AMT630H_GUI_Backlight_Setting(Menu_Item_en_t back_mode) /*图 背光*/ ...@@ -1881,6 +1906,7 @@ void AMT630H_GUI_Backlight_Setting(Menu_Item_en_t back_mode) /*图 背光*/
if(Menu_Item_Select_Get(MENU_ITEM_BACKLIGHT_3)) if(Menu_Item_Select_Get(MENU_ITEM_BACKLIGHT_3))
{ {
g_u8Backlight = Backlight_3 ; g_u8Backlight = Backlight_3 ;
g_u8Backlight_select = Backlight_3 ;
} }
else else
{ {
...@@ -1899,6 +1925,7 @@ void AMT630H_GUI_Backlight_Setting(Menu_Item_en_t back_mode) /*图 背光*/ ...@@ -1899,6 +1925,7 @@ void AMT630H_GUI_Backlight_Setting(Menu_Item_en_t back_mode) /*图 背光*/
if(Menu_Item_Select_Get(MENU_ITEM_BACKLIGHT_2)) if(Menu_Item_Select_Get(MENU_ITEM_BACKLIGHT_2))
{ {
g_u8Backlight = Backlight_2 ; g_u8Backlight = Backlight_2 ;
g_u8Backlight_select = Backlight_2 ;
} }
else else
{ {
...@@ -1917,6 +1944,7 @@ void AMT630H_GUI_Backlight_Setting(Menu_Item_en_t back_mode) /*图 背光*/ ...@@ -1917,6 +1944,7 @@ void AMT630H_GUI_Backlight_Setting(Menu_Item_en_t back_mode) /*图 背光*/
if(Menu_Item_Select_Get(MENU_ITEM_BACKLIGHT_1)) if(Menu_Item_Select_Get(MENU_ITEM_BACKLIGHT_1))
{ {
g_u8Backlight = Backlight_1 ; g_u8Backlight = Backlight_1 ;
g_u8Backlight_select = Backlight_1 ;
} }
else else
{ {
...@@ -1941,7 +1969,31 @@ void AMT630H_GUI_Backlight_Setting(Menu_Item_en_t back_mode) /*图 背光*/ ...@@ -1941,7 +1969,31 @@ void AMT630H_GUI_Backlight_Setting(Menu_Item_en_t back_mode) /*图 背光*/
/*记忆选择*/ /*记忆选择*/
if(Menu_Item_Select_Get(MENU_ITEM_BACKLIGHT_AUTO)) if(Menu_Item_Select_Get(MENU_ITEM_BACKLIGHT_AUTO))
{ {
g_u8Backlight = Backlight_ATUO ; g_u8Backlight_select = Backlight_ATUO ;
if(Backlight_SetPwmLevel() == 5)
{
g_u8Backlight = Backlight_5;
}
else if(Backlight_SetPwmLevel() == 4)
{
g_u8Backlight = Backlight_4;
}
else if(Backlight_SetPwmLevel() == 3)
{
g_u8Backlight = Backlight_3;
}
else if(Backlight_SetPwmLevel() == 2)
{
g_u8Backlight = Backlight_2;
}
else if(Backlight_SetPwmLevel() == 1)
{
g_u8Backlight = Backlight_1;
}
else
{
;
}
} }
else else
{ {
......
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