diff options
| author | Boris Gjenero <dreamlayers@rockbox.org> | 2009-04-21 21:49:29 +0000 |
|---|---|---|
| committer | Boris Gjenero <dreamlayers@rockbox.org> | 2009-04-21 21:49:29 +0000 |
| commit | d50d1df81797954d6970714ef97d63dc6c184e67 (patch) | |
| tree | 4ad2663f2b5047ba8ca7f055402c3530696740be | |
| parent | 29dbd8f3175ae1d2c4bd291eadbe00b910f152b9 (diff) | |
| download | rockbox-d50d1df81797954d6970714ef97d63dc6c184e67.zip rockbox-d50d1df81797954d6970714ef97d63dc6c184e67.tar.gz rockbox-d50d1df81797954d6970714ef97d63dc6c184e67.tar.bz2 rockbox-d50d1df81797954d6970714ef97d63dc6c184e67.tar.xz | |
FS#10129 - Start LCD sleep timer after PWM fadeout is complete
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20774 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | firmware/backlight.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/firmware/backlight.c b/firmware/backlight.c index 588867f..05bf007 100644 --- a/firmware/backlight.c +++ b/firmware/backlight.c @@ -205,7 +205,7 @@ static int lcd_sleep_timeout = 10*HZ; static const int lcd_sleep_timeout = LCD_SLEEP_TIMEOUT; #endif -static int lcd_sleep_timer = 0; +static int lcd_sleep_timer SHAREDDATA_ATTR = 0; void backlight_lcd_sleep_countdown(bool start) { @@ -220,7 +220,12 @@ void backlight_lcd_sleep_countdown(bool start) if (lcd_sleep_timeout < 0) { lcd_sleep_timer = 0; /* Setting == Always */ +#if (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_PWM) + /* Ensure lcd_sleep() is called from backlight_thread() */ + queue_post(&backlight_queue, LCD_SLEEP, 0); +#else lcd_sleep(); +#endif } else { @@ -304,6 +309,11 @@ static void backlight_isr(void) #endif timer_unregister(); bl_timer_active = false; + +#ifdef HAVE_LCD_SLEEP + if (bl_dim_current == 0) + backlight_lcd_sleep_countdown(true); +#endif } else timer_set_period(timer_period); @@ -320,6 +330,10 @@ static void backlight_switch(void) { _backlight_off_normal(); bl_dim_fraction = 0; + +#ifdef HAVE_LCD_SLEEP + backlight_lcd_sleep_countdown(true); +#endif } } @@ -388,11 +402,11 @@ static void _backlight_off(void) { bl_dim_target = bl_dim_fraction = 0; _backlight_off_normal(); - } #ifdef HAVE_LCD_SLEEP - backlight_lcd_sleep_countdown(true); + backlight_lcd_sleep_countdown(true); #endif + } } void backlight_set_fade_in(int value) |