From 75dfeaf12802b925f05c231087784c6e52b0d3a8 Mon Sep 17 00:00:00 2001 From: anod <182859762@qq.com> Date: Mon, 17 Oct 2022 12:30:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E4=B8=8A=E8=B0=83=E6=95=B4=E4=BA=AE?= =?UTF-8?q?=E5=BA=A6=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/arm11/open_agb_firm.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/source/arm11/open_agb_firm.c b/source/arm11/open_agb_firm.c index ffaf1d1..f717ce4 100644 --- a/source/arm11/open_agb_firm.c +++ b/source/arm11/open_agb_firm.c @@ -131,7 +131,7 @@ static atp_error_t config_item( atp_callerdata_t data, atp_counter_t index, atp_ ee_snprintf(buf, sizeof(buf), "%d", g_oafConfig.backlight); cfg->text = "屏幕亮度"; cfg->extra_text = buf; - if( g_oafConfig.backlight == LIGHT_MIN || g_oafConfig == LIGHT_MAX ) + if( g_oafConfig.backlight == LIGHT_MIN || g_oafConfig.backlight == LIGHT_MAX ) cfg->extra_text_color = ATP_COLOR_RED; } else if( index == 1 ) @@ -157,7 +157,7 @@ static atp_pageopt_t config_adjust( atp_callerdata_t data, atp_counter_t index, { if( index == 0 ) { - u8 light = g_oafConfig.brightness; + u8 light = g_oafConfig.backlight; if( l ) { light -= 10; @@ -170,14 +170,19 @@ static atp_pageopt_t config_adjust( atp_callerdata_t data, atp_counter_t index, } if( light > LIGHT_MAX ) light = LIGHT_MAX; else if( light < LIGHT_MIN ) light = LIGHT_MIN; - g_oafConfig.brightness = light; + g_oafConfig.backlight = light; } return ATP_PAGE_UPDATE; } void oaf_config_page() { + u8 light = g_oafConfig.backlight; atp_select( "参数配置", 4, config_item, config_adjust, NULL, 0, 0, NULL ); + + if( light != g_oafConfig.backlight ) + GFX_setBrightness(g_oafConfig.backlight, g_oafConfig.backlight); + } static u32 fixRomPadding(u32 romFileSize)