From f4ba3b2fa32a4dd34570c2bc9b5a592727997eae Mon Sep 17 00:00:00 2001 From: Eric Caruso Date: Wed, 12 Aug 2015 10:19:06 -0700 Subject: Trigger lightbar pattern from charger task if necessary If we have a lightbar, but no PD, then plugging the device in will not trigger the battery-level pattern. This allows us to trigger it from the charger task instead if we change AC status and don't have a PD. BRANCH=ToT BUG=None TEST=plug and unplug charger from device, make sure the lightbar plays the right pattern Change-Id: I8f37aaff2ddb9d936e13489cb404caee822418a1 Signed-off-by: Eric Caruso Reviewed-on: https://chromium-review.googlesource.com/292943 Reviewed-by: Bill Richardson --- common/charge_state_v2.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/charge_state_v2.c b/common/charge_state_v2.c index 0ca0974739..7b7687db44 100644 --- a/common/charge_state_v2.c +++ b/common/charge_state_v2.c @@ -16,6 +16,7 @@ #include "gpio.h" #include "hooks.h" #include "host_command.h" +#include "lightbar.h" #include "math_util.h" #include "printf.h" #include "sb_fw_update.h" @@ -608,6 +609,9 @@ void charger_task(void) battery_seems_to_be_dead = 0; prev_ac = curr.ac; } +#if defined(HAS_TASK_LIGHTBAR) && !defined(HAS_TASK_PDCMD) + lightbar_sequence(LIGHTBAR_TAP); +#endif } charger_get_params(&curr.chg); battery_get_params(&curr.batt); -- cgit v1.2.1