summaryrefslogtreecommitdiff
path: root/common/charge_state_v2.c
diff options
context:
space:
mode:
authorYilun Lin <yllin@chromium.org>2019-08-28 13:44:54 +0800
committerCommit Bot <commit-bot@chromium.org>2019-09-10 10:47:10 +0000
commit96f258f04526d6cf188ffe4fe73ec14ea108d5fd (patch)
treed989540907697e49353ed39dfa9637d77295daa8 /common/charge_state_v2.c
parentc32c1ae24c398679edae807f9c1620eb91377003 (diff)
downloadchrome-ec-96f258f04526d6cf188ffe4fe73ec14ea108d5fd.tar.gz
cutoff: ensure logs are flushed before cut-off
Logs may not appear in the console without flush if battery been cut-off. TEST=See the logs are flushed to console before cutoff BRANCH=None BUG=None Change-Id: I73363856c50dea1ec409b8041d96227d6538bcc3 Signed-off-by: Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1772863 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Diffstat (limited to 'common/charge_state_v2.c')
-rw-r--r--common/charge_state_v2.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/common/charge_state_v2.c b/common/charge_state_v2.c
index a376107ba8..d5a2fb7cef 100644
--- a/common/charge_state_v2.c
+++ b/common/charge_state_v2.c
@@ -1365,6 +1365,8 @@ static int shutdown_on_critical_battery(void)
break;
case CRITICAL_SHUTDOWN_CUTOFF:
CPRINTS("Cutoff due to critical battery");
+ /* Ensure logs are flushed. */
+ cflush();
board_cut_off_battery();
break;
case CRITICAL_SHUTDOWN_IGNORE: