summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/keyboard_8042.c3
-rw-r--r--common/lightbar.c12
-rw-r--r--include/lightbar.h2
3 files changed, 14 insertions, 3 deletions
diff --git a/common/keyboard_8042.c b/common/keyboard_8042.c
index 217bf52339..cf2b5bec94 100644
--- a/common/keyboard_8042.c
+++ b/common/keyboard_8042.c
@@ -876,6 +876,9 @@ static void keyboard_special(uint16_t k)
case 0x0041: /* bright */
demo_brightness(1);
break;
+ case 0x0014: /* T */
+ demo_tap();
+ break;
}
#endif
diff --git a/common/lightbar.c b/common/lightbar.c
index 6684949c8a..e7733bdf4b 100644
--- a/common/lightbar.c
+++ b/common/lightbar.c
@@ -76,13 +76,13 @@ static const struct lightbar_params_v1 default_params = {
.s3_ramp_up = 2500,
.s3_ramp_down = 10000,
.tap_tick_delay = 5000, /* oscillation step time */
- .tap_display_time = 3000000, /* total sequence time */
+ .tap_display_time = 5 * SECOND, /* total sequence time */
.tap_pct_red = 10, /* below this is red */
.tap_pct_green = 97, /* above this is green */
.tap_seg_min_on = 35, /* min intensity (%) for "on" */
.tap_seg_max_on = 100, /* max intensity (%) for "on" */
- .tap_seg_osc = 25, /* amplitude for charging osc */
+ .tap_seg_osc = 50, /* amplitude for charging osc */
.tap_idx = {5, 6, 7}, /* color [red, yellow, green] */
.osc_min = { 0x60, 0x60 }, /* battery, AC */
@@ -269,6 +269,14 @@ void demo_brightness(int inc)
lb_set_brightness(b);
}
+/* T key */
+void demo_tap(void)
+{
+ if (!demo_mode)
+ return;
+ lightbar_sequence(LIGHTBAR_TAP);
+}
+
/******************************************************************************/
/* Helper functions and data. */
/******************************************************************************/
diff --git a/include/lightbar.h b/include/lightbar.h
index 0d143a2e8a..c15604bd87 100644
--- a/include/lightbar.h
+++ b/include/lightbar.h
@@ -30,5 +30,5 @@ void lightbar_sequence(enum lightbar_sequence s);
extern void demo_battery_level(int inc);
extern void demo_is_charging(int ischarge);
extern void demo_brightness(int inc);
-
+extern void demo_tap(void);
#endif /* __CROS_EC_LIGHTBAR_H */