summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/charge_state_v2.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/common/charge_state_v2.c b/common/charge_state_v2.c
index 2527d7f92a..36addbe332 100644
--- a/common/charge_state_v2.c
+++ b/common/charge_state_v2.c
@@ -617,16 +617,21 @@ wait_for_it:
curr.requested_current =
charger_closest_current(curr.requested_current);
- /*
- * As a safety feature, some chargers will stop charging if
- * we don't communicate with it frequently enough. In manual
- * mode, we'll just tell it what it already knows
- */
- if (manual_mode) {
- charge_request(curr.chg.voltage, curr.chg.current);
- } else {
- charge_request(curr.requested_voltage,
- curr.requested_current);
+ /* Charger only accpets request when AC is on. */
+ if (curr.ac) {
+ /*
+ * As a safety feature, some chargers will stop
+ * charging if we don't communicate with it frequently
+ * enough. In manual mode, we'll just tell it what it
+ * knows.
+ */
+ if (manual_mode) {
+ charge_request(curr.chg.voltage,
+ curr.chg.current);
+ } else {
+ charge_request(curr.requested_voltage,
+ curr.requested_current);
+ }
}
/* How long to sleep? */