From 5c87a98b97b9ab6bd9647bb0bb8d00f58d5f179b Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Wed, 2 Apr 2008 22:16:14 +0000 Subject: Greyscale library: * Implement linearisation curve flipping for 1st/2nd Gen iPods (LCD is inverted when backlight is on, so the curve is also inverted). This needs a slight extension of is_backlight_on() functionality in the core. * Thorough recalibration of all reachable greyscale targets, and #ifdef cleanup. * Reduce on-target gamma a bit, because the displayable contrast range of a monochrome/greyscale isn't that high. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16936 a1c6a512-1295-4272-9138-f99709370657 --- firmware/backlight.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'firmware/backlight.c') diff --git a/firmware/backlight.c b/firmware/backlight.c index 0f66fbf..19e6933 100644 --- a/firmware/backlight.c +++ b/firmware/backlight.c @@ -631,13 +631,13 @@ void backlight_off(void) queue_post(&backlight_queue, BACKLIGHT_OFF, 0); } -/* returns true when the backlight is on OR when it's set to always off */ -bool is_backlight_on(void) +/* returns true when the backlight is on, + * and optionally when it's set to always off. */ +bool is_backlight_on(bool ignore_always_off) { - if (backlight_timer || backlight_timeout <= 0) - return true; - else - return false; + return (backlight_timer > 0) /* countdown */ + || (backlight_timeout == 0) /* always on */ + || ((backlight_timeout < 0) && !ignore_always_off); } /* return value in ticks; 0 means always on, <0 means always off */ @@ -752,13 +752,13 @@ int remote_backlight_get_current_timeout(void) return remote_backlight_timeout; } -/* returns true when the backlight is on OR when it's set to always off */ -bool is_remote_backlight_on(void) +/* returns true when the backlight is on, and + * optionally when it's set to always off */ +bool is_remote_backlight_on(bool ignore_always_off) { - if (remote_backlight_timer != 0 || remote_backlight_timeout <= 0) - return true; - else - return false; + return (remote_backlight_timer > 0) /* countdown */ + || (remote_backlight_timeout == 0) /* always on */ + || ((remote_backlight_timeout < 0) && !ignore_always_off); } #endif /* HAVE_REMOTE_LCD */ -- cgit v1.1