From c1e908fcac8a91872ff5ec40120bbe65fa41851c Mon Sep 17 00:00:00 2001 From: Alec Berg Date: Tue, 14 Oct 2014 13:28:39 -0700 Subject: [PATCH] samus: display battery status on lightbar on AC change Display battery percentage on the lightbar whenever AC status changes. BUG=chrome-os-partner:32894 BRANCH=samus TEST=Plug and unplug AC in S0 and in G3 and make sure that lightbar displays battery percentage each time Change-Id: I281c9242d185da06b0c778de12e4f6340779a840 Signed-off-by: Alec Berg Reviewed-on: https://chromium-review.googlesource.com/223362 Reviewed-by: Bill Richardson --- board/samus/board.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/board/samus/board.c b/board/samus/board.c index ff443b96f8..5580f5d658 100644 --- a/board/samus/board.c +++ b/board/samus/board.c @@ -26,6 +26,7 @@ #include "jtag.h" #include "keyboard_scan.h" #include "lid_switch.h" +#include "lightbar.h" #include "motion_sense.h" #include "peci.h" #include "power.h" @@ -235,6 +236,15 @@ enum battery_present battery_is_present(void) } #endif +/** + * Show battery status on lightbar when AC status changes + */ +void show_battery_status(void) +{ + lightbar_sequence(LIGHTBAR_TAP); +} +DECLARE_HOOK(HOOK_AC_CHANGE, show_battery_status, HOOK_PRIO_DEFAULT); + /** * Discharge battery when on AC power for factory test. */