summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgit-CarryBK_Chen.compal.com <CarryBK_Chen@compal.com>2014-04-29 17:12:01 +0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-05-06 16:31:28 +0000
commit2279c445358f90ee7df9f0688c35837260684546 (patch)
tree0dab309020331aaa1e0c5993ece2ad4b7aabdefd
parent0e1f0e7a355344568e810db1ec0ffd597ad68557 (diff)
downloadchrome-ec-2279c445358f90ee7df9f0688c35837260684546.tar.gz
Clapper: Modify battery LED's behavior
Base on customer's request, change LED behavior BRANCH=clapper BUG=none TEST=Use battfake to verify each case Signed-off-by: Carry Chen <CarryBK_Chen@compal.com> Change-Id: Icecd40d54ec28cdd242129cb862510914ef7616a Reviewed-on: https://chromium-review.googlesource.com/197486 Reviewed-by: Antonie Cheng <Antonie_Cheng@compal.com> Commit-Queue: Antonie Cheng <Antonie_Cheng@compal.com> Tested-by: Antonie Cheng <Antonie_Cheng@compal.com> Reviewed-by: Dave Parker <dparker@chromium.org>
-rw-r--r--board/clapper/led.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/board/clapper/led.c b/board/clapper/led.c
index 31f955e053..53a66dcd3d 100644
--- a/board/clapper/led.c
+++ b/board/clapper/led.c
@@ -126,11 +126,11 @@ static void battery_led_update(void)
case PWR_STATE_CHARGE:
case PWR_STATE_CHARGE_NEAR_FULL: /* with AC */
case PWR_STATE_IDLE: /* with AC */
- /* 80% ~ */
- if (battery >= 80)
+ /* OS display 80% ~ 100% */
+ if (battery >= 78)
set_color_battery(LED_WHITE);
- /* 20% ~ 79% */
- else if (battery >= 20 && battery < 80) {
+ /* OS display 20% ~ 79% */
+ else if (battery >= 23 && battery < 78) {
/* 5000 ms on */
if (timer%51 < 50)
set_color_battery(LED_WHITE);
@@ -138,8 +138,8 @@ static void battery_led_update(void)
else
set_color_battery(LED_OFF);
}
- /* 5% ~ 19% */
- else if (battery >= 5 && battery < 20) {
+ /* OS display 5% ~ 19% */
+ else if (battery >= 9 && battery < 23) {
/* 3200 ms on */
if (timer%33 < 32)
set_color_battery(LED_AMBER);
@@ -147,7 +147,7 @@ static void battery_led_update(void)
else
set_color_battery(LED_OFF);
}
- /* 0% ~ 4% */
+ /* OS display 0% ~ 4% */
else {
/* 1000 ms on */
if (timer%15 < 10)
@@ -161,13 +161,13 @@ static void battery_led_update(void)
/* not S0 */
if (!chipset_in_state(CHIPSET_STATE_ON))
set_color_battery(LED_OFF);
- /* 20% ~ */
- else if (battery >= 20)
+ /* OS display 20% ~ 100% */
+ else if (battery >= 23)
set_color_battery(LED_WHITE);
- /* 5% ~ 19% */
- else if (battery >= 5 && battery < 20)
+ /* OS display 5% ~ 19% */
+ else if (battery >= 9 && battery < 23)
set_color_battery(LED_AMBER);
- /* 1% ~ 4% */
+ /* OS display 0% ~ 4% */
else {
/* 1000 ms on */
if (timer%15 < 10)