summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Collyer <scollyer@google.com>2017-07-06 13:55:44 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-07-11 17:48:02 -0700
commitdccb0ed867c7409e06faf7b9b353ddb235c43ee0 (patch)
tree4d55c7765d4673874d1c8955e545ca01e10c2a2a
parented5290019ce657b8b937b4f2d1f128234105b5e3 (diff)
downloadchrome-ec-dccb0ed867c7409e06faf7b9b353ddb235c43ee0.tar.gz
eve: Minor changes to LED patterns
The LED pattern for lowest battery level is supposed to indicate that there isn't enough battery present to boot the AP. The pattern_tbl array had this value set to 2. However, it's better to tie this to the constant defined in board.h so that it's consistent with when the AP will be allowed to boot. In addition, adjusted the battery level ranges to work correctly with the <= check. BUG=b:35584895 BRANCH=eve TEST=Used 'battfake' console command to verify that the patterns changed at the expected battery charge levels. Change-Id: Ie85a448ad4803be7e612c382b8e60fa42356d257 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/562542 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Todd Broch <tbroch@chromium.org>
-rw-r--r--board/eve/led.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/board/eve/led.c b/board/eve/led.c
index f6bc548310..1295dc8cc9 100644
--- a/board/eve/led.c
+++ b/board/eve/led.c
@@ -21,7 +21,6 @@
#define CPRINTS(format, args...) cprints(CC_PWM, format, ## args)
#define LED_TICKS_PER_BEAT 2
-#define LED_BEATS_PER_PHASE 2
#define NUM_PHASE 2
#define DOUBLE_TAP_TICK_LEN (LED_TICKS_PER_BEAT * 8)
@@ -123,14 +122,17 @@ struct range_map {
uint8_t pattern;
};
+#if (CONFIG_USB_PD_TRY_SRC_MIN_BATT_SOC >= 3)
+#error "LED: PULSE_RED_2 battery level <= BLINK_RED level"
+#endif
static const struct range_map pattern_tbl[] = {
- {2, BLINK_RED},
- {4, PULSE_RED_2},
- {10, PULSE_RED_1},
- {15, SOLID_RED},
- {30, WHITE_RED},
- {90, SOLID_WHITE},
- {98, WHITE_GREEN},
+ {CONFIG_USB_PD_TRY_SRC_MIN_BATT_SOC - 1, BLINK_RED},
+ {3, PULSE_RED_2},
+ {9, PULSE_RED_1},
+ {14, SOLID_RED},
+ {29, WHITE_RED},
+ {89, SOLID_WHITE},
+ {97, WHITE_GREEN},
{100, SOLID_GREEN},
};