From 8fe9304ae24d736698f8c7d02b299b8c815de91f Mon Sep 17 00:00:00 2001 From: Alec Berg Date: Fri, 27 Feb 2015 13:36:53 -0800 Subject: samus: don't unwedge charging when purposely discharging on AC For factory testing, when purposely discharging on AC, don't automatically detect and unwedged charge circuit. BUG=chrome-os-partner:37171 BRANCH=samus TEST=plug in AC and run: "ectool chargecontrol discharge". check on ec console that battery is discharging. let sit for 3 minutes and make sure charge circuit unwedge code never runs. run "ectool chargecontrol normal" and make sure battery starts charging again. Also force discharge with "ectool chargecontrol discharge" and then unplug and replug AC, make sure battery is not charging nor discharging, then set mode back to normal and make sure we start charging again. Tested without this CL and everytime you force discharge the charge unwedge is activated and messes everything up. Change-Id: Icc7a504c148e1e08777e7aafce64ff4cc38a32c5 Signed-off-by: Alec Berg Reviewed-on: https://chromium-review.googlesource.com/254722 Reviewed-by: Duncan Laurie --- board/samus/extpower.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'board/samus/extpower.c') diff --git a/board/samus/extpower.c b/board/samus/extpower.c index 8a73c91a56..b842f7d3ea 100644 --- a/board/samus/extpower.c +++ b/board/samus/extpower.c @@ -398,8 +398,12 @@ void extpower_task(void) while (1) { if (task_wait_event(CHARGE_WEDGE_CHECK_INTERVAL) == TASK_EVENT_TIMER) { - /* Periodically check if charge circuit is wedged */ - check_charge_wedged(); + /* + * If we are NOT purposely discharging on AC, then + * periodically check if charge circuit is wedged. + */ + if (!board_is_discharging_on_ac()) + check_charge_wedged(); } else { /* Must have received power change interrupt */ extpower = extpower_is_present(); -- cgit v1.2.1