backlight: Fix dimmed display doesn't go to sleep

rockbox-gerrit-noreply--- via rockbox-cvs <[email protected]>
Newsgroups gmane.comp.systems.archos.rockbox.cvs
Message-ID <[email protected]>
commit 246bf4af75bf7c30fc1ea6ca346a050008790d94
Author: Petr Mikhalicin <[email protected]>
Date:   Sat Jan 3 20:16:20 2026 +0500

    backlight: Fix dimmed display doesn't go to sleep
    
    Firmware didn't start sleep countdown if
    1. Display was already dimmed
    2. Fade out timer was set
    
    You can reproduce this by:
    1. Set fade out timer. For example, 500ms
    2. Wait till display will be dimmed and go to sleep
    3. Switch hold ON or plug headphones
    
    Change-Id: I27ca857aa8db4551bd9caad4815cd73a64bf6185

diff --git a/firmware/backlight.c b/firmware/backlight.c
index a00483c070..ee7b147aee 100644
--- a/firmware/backlight.c
+++ b/firmware/backlight.c
@@ -387,7 +387,8 @@ static void backlight_setup_fade_up(void)
 
 static void backlight_setup_fade_down(void)
 {
-    if (bl_fade_out_step > 0)
+    /* Start fading display if it's not dimmed yet */
+    if (bl_fade_out_step > 0 && bl_dim_current > 0)
     {
         backlight_dim(0);
     }
-- 
rockbox-cvs mailing list
[email protected]
https://lists.haxx.se/mailman/listinfo/rockbox-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.