Skip to content

Commit

Permalink
liblight: turn off the LED when fail to set it blink
Browse files Browse the repository at this point in the history
For those platforms which do not support blink, solid RED
LED keeps on after unplugging USB with capacity < 15.
Turn off the LED when fail to set it blink, so as to fix
this limitation.

Change-Id: I70ac9f6d645579a71caae852e6afbd9fb176c84b
  • Loading branch information
Mao Li authored and Simon Wilson committed Jan 9, 2015
1 parent 000cb84 commit cbf0d5f
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions msm8226/liblight/lights.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,18 @@ set_speaker_light_locked(struct light_device_t* dev,
}

if (blink) {
if (red)
write_int(RED_BLINK_FILE, blink);
if (green)
write_int(GREEN_BLINK_FILE, blink);
if (blue)
write_int(BLUE_BLINK_FILE, blink);
if (red) {
if (write_int(RED_BLINK_FILE, blink))
write_int(RED_LED_FILE, 0);
}
if (green) {
if (write_int(GREEN_BLINK_FILE, blink))
write_int(GREEN_LED_FILE, 0);
}
if (blue) {
if (write_int(BLUE_BLINK_FILE, blink))
write_int(BLUE_LED_FILE, 0);
}
} else {
write_int(RED_LED_FILE, red);
write_int(GREEN_LED_FILE, green);
Expand Down

0 comments on commit cbf0d5f

Please sign in to comment.