summaryrefslogtreecommitdiff
path: root/board/homestar/led.c
diff options
context:
space:
mode:
authortongjian <tongjian@huaqin.corp-partner.google.com>2021-06-16 15:00:56 +0800
committerCommit Bot <commit-bot@chromium.org>2021-06-23 04:09:14 +0000
commit66ce39de648e93c6659c72ca96e73c7047462ab4 (patch)
tree431cb35b7e60210e0ae6c11439f1e05a30f62859 /board/homestar/led.c
parent26026cc84a42eae453c59d9b4432a665e0c73f87 (diff)
downloadchrome-ec-66ce39de648e93c6659c72ca96e73c7047462ab4.tar.gz
Homestar:LED:Use display SoC to control charge LED
Currently, Homestar uses the state of charge provided from the battery. This isn't the same as the SoC shown on the screen because Powerd compensates it based on the full factor and the low battery shutdown threshold. This change makes Homestar use the display SoC for the charge LED module so that the charge LED and the display SoC synchronously work. BUG=b:187539586 TEST=make -j BOARD=homestar Verify build on EVT board BRANCH=Trogdo Signed-off-by: tongjian <tongjian@huaqin.corp-partner.google.com> Change-Id: I953aca48d18b32655d82fbd9a8c315534a8326bf Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2965815 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Wai-Hong Tam <waihong@google.com>
Diffstat (limited to 'board/homestar/led.c')
-rw-r--r--board/homestar/led.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/board/homestar/led.c b/board/homestar/led.c
index 7d7d9b28e5..bf1bb51fa6 100644
--- a/board/homestar/led.c
+++ b/board/homestar/led.c
@@ -77,7 +77,7 @@ static void board_led_set_battery(void)
static int battery_ticks;
int color = LED_OFF;
int period = 0;
- int percent = charge_get_percent();
+ int percent = DIV_ROUND_NEAREST(charge_get_display_charge(), 10);
uint32_t chflags = charge_get_flags();
battery_ticks++;