From 8676dcf16178ac0f947c379d28ec034d17a394e1 Mon Sep 17 00:00:00 2001 From: Grover Yen Date: Thu, 26 Feb 2015 15:12:05 +0800 Subject: 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 Reviewed-on: https://chromium-review.googlesource.com/253987 Reviewed-by: Mohammed Habibulla --- board/cid/led.c | 6 ++++-- 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) -- cgit v1.2.1