summaryrefslogtreecommitdiff
path: root/board/gnawty/led.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/gnawty/led.c')
-rw-r--r--board/gnawty/led.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/board/gnawty/led.c b/board/gnawty/led.c
index e83cea319a..aefdeb9f95 100644
--- a/board/gnawty/led.c
+++ b/board/gnawty/led.c
@@ -12,6 +12,7 @@
#include "led_common.h"
#include "pwm.h"
#include "util.h"
+#include "extpower.h"
const enum ec_led_id supported_led_ids[] = {
EC_LED_ID_BATTERY_LED , EC_LED_ID_POWER_LED};
@@ -146,16 +147,18 @@ static void battery_led(void)
/* If Battery critical Low, blink orange, 50% duty cycle,
* 2 sec period.
*/
- if (batt.state_of_charge <= BATTERY_LEVEL_CRITICAL) {
+ if (!extpower_is_present() && chipset_in_state(CHIPSET_STATE_ON) &&
+ (batt.state_of_charge <= CONFIG_BATTERY_LEVEL_CRITICAL)) {
set_color_battery_led((battery_ticks & 0x4) ?
- LED_ORANGE : LED_OFF);
+ LED_ORANGE : LED_OFF);
return;
}
/* If Battery Low, blink orange, 25% duty cycle, 4 sec period */
- if (batt.state_of_charge <= BATTERY_LEVEL_LOW) {
+ if (!extpower_is_present() && chipset_in_state(CHIPSET_STATE_ON) &&
+ (batt.state_of_charge <= CONFIG_BATTERY_LEVEL_LOW)) {
set_color_battery_led((battery_ticks % 16) < 4 ?
- LED_ORANGE : LED_OFF);
+ LED_ORANGE : LED_OFF);
return;
}