summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@chromium.org>2015-06-11 15:38:24 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-06-12 18:23:28 +0000
commit35fbc972e9dae2fb85cce6837868352ad39aa981 (patch)
tree3aaedb5a90ecbc30e31cd7dbd7368387646cb777 /test
parent3062442361cb1765224a237043db37e6d8ebb762 (diff)
downloadchrome-ec-35fbc972e9dae2fb85cce6837868352ad39aa981.tar.gz
charge_manager: Don't cutoff charger when no battery is attached
We normally do not charge from non-dedicated chargers. The process of determining whether a charger is dedicated or not involves PD protocol communication, so it can take some time to reach a determination. If no battery is attached, the charger is likely our only source of power, so don't cut it off. BUG=chrome-os-partner:41258 TEST=Attach donette to glados system with no battery, verify that glados boots to EC console and doesn't reset or panic. BRANCH=None Change-Id: I7c9cfcbd37b37ef16010cf1f246d8fddba6f6283 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/277074 Reviewed-by: Alec Berg <alecaberg@chromium.org>
Diffstat (limited to 'test')
-rw-r--r--test/charge_manager.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/charge_manager.c b/test/charge_manager.c
index 87ae1c7ede..8bfa8e2646 100644
--- a/test/charge_manager.c
+++ b/test/charge_manager.c
@@ -5,6 +5,7 @@
* Test charge manager module.
*/
+#include "battery.h"
#include "charge_manager.h"
#include "common.h"
#include "ec_commands.h"
@@ -66,6 +67,11 @@ void pd_set_new_power_request(int port)
new_power_request[port] = 1;
}
+enum battery_present battery_is_present(void)
+{
+ return BP_YES;
+}
+
static void clear_new_power_requests(void)
{
int i;