diff options
author | Grover Yen <Grover_Yen@wistron.com> | 2015-02-26 15:12:05 +0800 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-03-03 10:24:38 +0000 |
commit | 8676dcf16178ac0f947c379d28ec034d17a394e1 (patch) | |
tree | 96cf7c73f5f23adbcb2035335b85da2594691a27 | |
parent | 0f74dd091870cc0ba0c3ca45bc1f818e72458412 (diff) | |
download | chrome-ec-8676dcf16178ac0f947c379d28ec034d17a394e1.tar.gz |
lulu, cid : Change battery error LED behavior.
Change battery error LED behavior from "500ms on, 500ms off" to
"1 second on, 3 seconds off"
BUG=chrome-os-partner:35115
BRANCH=none
TEST=Detach battery to simulate battery error
and then confirm LED behavior.
Change-Id: I16d469ca7ebe27a98a9c446951165827845f02c8
Signed-off-by: Grover Yen <Grover_Yen@wistron.com>
Reviewed-on: https://chromium-review.googlesource.com/253987
Reviewed-by: Mohammed Habibulla <moch@chromium.org>
-rw-r--r-- | board/cid/led.c | 6 | ||||
-rw-r--r-- | board/lulu/led.c | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/board/cid/led.c b/board/cid/led.c index 2553b4b390..54f2d0a717 100644 --- a/board/cid/led.c +++ b/board/cid/led.c @@ -15,9 +15,10 @@ #include "led_common.h" #include "util.h" -#define LED_ERROR_FREQ 2 /* LED on 500ms every 1000ms */ #define LED_FORCE_IDLE_FREQ 4 /* LED on 1000ms every 2000ms */ #define LED_BATTERY_LOW_LEVEL 15 /* Battery low level: 15% */ +#define LED_TOTAL_TICKS 16 +#define LED_ON_TICKS 4 enum led_color { LED_OFF = 0, @@ -118,7 +119,8 @@ static void cid_led_set_battery(void) break; case PWR_STATE_ERROR: cid_led_set_color_battery( - (battery_ticks & LED_ERROR_FREQ) ? LED_AMBER : LED_OFF); + (battery_ticks % LED_TOTAL_TICKS < LED_ON_TICKS) ? + LED_AMBER : LED_OFF); break; case PWR_STATE_IDLE: /* External power connected in IDLE. */ if (chflags & CHARGE_FLAG_FORCE_IDLE) diff --git a/board/lulu/led.c b/board/lulu/led.c index 724dfc1b4a..8e12a20671 100644 --- a/board/lulu/led.c +++ b/board/lulu/led.c @@ -15,9 +15,10 @@ #include "led_common.h" #include "util.h" -#define LED_ERROR_FREQ 2 /* LED on 500ms every 1000ms */ #define LED_FORCE_IDLE_FREQ 4 /* LED on 1000ms every 2000ms */ #define LED_BATTERY_LOW_LEVEL 15 /* Battery low level: 15% */ +#define LED_TOTAL_TICKS 16 +#define LED_ON_TICKS 4 enum led_color { LED_OFF = 0, @@ -118,7 +119,8 @@ static void lulu_led_set_battery(void) break; case PWR_STATE_ERROR: lulu_led_set_color_battery( - (battery_ticks & LED_ERROR_FREQ) ? LED_AMBER : LED_OFF); + (battery_ticks % LED_TOTAL_TICKS < LED_ON_TICKS) ? + LED_AMBER : LED_OFF); break; case PWR_STATE_IDLE: /* External power connected in IDLE. */ if (chflags & CHARGE_FLAG_FORCE_IDLE) |