From 0b30eb79b1fa7586225bff539b19c65e447d70ee Mon Sep 17 00:00:00 2001 From: Rob Purchase Date: Mon, 23 Nov 2009 23:30:55 +0000 Subject: [PATCH] Fix FS#10362 (flickering backlight when removing hold) by preventing multiple SYS_TIMEOUT events being posted the backlight thread. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23730 a1c6a512-1295-4272-9138-f99709370657 --- firmware/backlight.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/firmware/backlight.c b/firmware/backlight.c index 8eded957f7..27bc8a453f 100644 --- a/firmware/backlight.c +++ b/firmware/backlight.c @@ -481,10 +481,11 @@ static void backlight_update_state(void) if (UNLIKELY(timeout < 0)) { do_backlight_off(); -#if (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_SW_SETTING) \ +#if (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_SW_SETTING) \ || (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_SW_HW_REG) - /* necessary step to issue fading down when the setting is selected */ - queue_post(&backlight_queue, SYS_TIMEOUT, 0); + /* necessary step to issue fading down when the setting is selected */ + if (queue_empty(&backlight_queue)) + queue_post(&backlight_queue, SYS_TIMEOUT, 0); #endif } else