diff options
author | Mike Lockwood <lockwood@android.com> | 2011-09-26 13:28:42 -0400 |
---|---|---|
committer | Mike Lockwood <lockwood@android.com> | 2011-09-26 13:28:42 -0400 |
commit | 1119b3109675a59a8dc1c02d28236a37b5b0a8b2 (patch) | |
tree | b464e58404d9bf5cb11a4d5ede09b49cf450a970 /liblight | |
parent | cad0063e4ac9a5f06ad4b045bb847a7763d56aad (diff) | |
download | device_samsung_tuna-1119b3109675a59a8dc1c02d28236a37b5b0a8b2.zip device_samsung_tuna-1119b3109675a59a8dc1c02d28236a37b5b0a8b2.tar.gz device_samsung_tuna-1119b3109675a59a8dc1c02d28236a37b5b0a8b2.tar.bz2 |
liblight: Tune notification LED blink ramping to reduce power consumption
Also tweak white color to reduce purplish tint.
Bug: 5297742
Change-Id: I8cb62758f8ba10a28606695f7f0143dc611fb035
Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'liblight')
-rw-r--r-- | liblight/lights.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/liblight/lights.c b/liblight/lights.c index 843f42a..7c72dce 100644 --- a/liblight/lights.c +++ b/liblight/lights.c @@ -39,6 +39,8 @@ char const *const LED_FILE = "/dev/an30259a_leds"; #define SLOPE_UP_2 (500-SLOPE_UP_1) #define SLOPE_DOWN_1 SLOPE_UP_2 #define SLOPE_DOWN_2 SLOPE_UP_1 +// brightness at mid-slope, on 0 - 127 scale +#define MID_BRIGHTNESS 31 void init_g_lock(void) { @@ -144,12 +146,15 @@ static int set_light_leds(struct light_state_t const *state, int type) case LIGHT_FLASH_HARDWARE: led.state = LED_LIGHT_SLOPE; led.color = state->color & 0x00ffffff; + // tweak to eliminate purplish tint from white color + if (led.color == 0x00ffffff) + led.color = 0x80ff80; // scale slope times based on flashOnMS led.time_slope_up_1 = (SLOPE_UP_1 * state->flashOnMS) / 1000; led.time_slope_up_2 = (SLOPE_UP_2 * state->flashOnMS) / 1000; led.time_slope_down_1 = (SLOPE_DOWN_1 * state->flashOnMS) / 1000; led.time_slope_down_2 = (SLOPE_DOWN_2 * state->flashOnMS) / 1000; - led.mid_brightness = 127; + led.mid_brightness = MID_BRIGHTNESS; led.time_off = state->flashOffMS; break; default: |