summaryrefslogtreecommitdiff
path: root/common/lb_common.c
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2014-08-19 19:01:29 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-08-20 22:42:15 +0000
commitf883354bbad138390142fdeaa554f55ee51551ef (patch)
tree22fcffeda103aae6bd5b81163baa5acf8fffd6cd /common/lb_common.c
parent1b52de3e3c73886784ea1216b34305919449bd24 (diff)
downloadchrome-ec-f883354bbad138390142fdeaa554f55ee51551ef.tar.gz
lightbar: correctly revert to the S0/S3/S5 patterns
This CL ensures that temporary "one-shot" sequences such as KONAMI, TEST, TAP, etc. will revert to the previous "normal" sequences even when interrupted by other one-shot sequences. This also adds a test for those cases. BUG=chrome-os-partner:29873 BRANCH=ToT TEST=manual make runtests Change-Id: Ie83908731acdf2f7c9108568a1ba047943175d26 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/213230
Diffstat (limited to 'common/lb_common.c')
-rw-r--r--common/lb_common.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/common/lb_common.c b/common/lb_common.c
index 289421d3bd..8803608328 100644
--- a/common/lb_common.c
+++ b/common/lb_common.c
@@ -68,6 +68,12 @@ static inline uint8_t controller_read(int ctrl_num, uint8_t reg)
#define MAX_GREEN 0x55
#define MAX_BLUE 0x67
#endif
+#ifdef BOARD_HOST
+/* For testing only */
+#define MAX_RED 0xff
+#define MAX_GREEN 0xff
+#define MAX_BLUE 0xff
+#endif
/* How we'd like to see the driver chips initialized. The controllers have some
* auto-cycling capability, but it's not much use for our purposes. For now,
@@ -114,6 +120,10 @@ static const uint8_t led_to_isc[] = { 0x18, 0x15, 0x18, 0x15 };
#ifdef BOARD_SAMUS
static const uint8_t led_to_isc[] = { 0x15, 0x18, 0x15, 0x18 };
#endif
+#ifdef BOARD_HOST
+/* For testing only */
+static const uint8_t led_to_isc[] = { 0x15, 0x18, 0x15, 0x18 };
+#endif
/* Scale 0-255 into max value */
static inline uint8_t scale_abs(int val, int max)