diff options
author | Aseda Aboagye <aaboagye@google.com> | 2017-11-01 09:59:08 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-11-01 16:47:21 -0700 |
commit | 7bf1696711c37d829b4663fa4dfce5e35b4d237e (patch) | |
tree | ead615c45021e6f986c7d4bcb744e3c4c53beaf4 /common/charge_ramp_sw.c | |
parent | 030e44309461552a18427ef1924e193bfc660106 (diff) | |
download | chrome-ec-7bf1696711c37d829b4663fa4dfce5e35b4d237e.tar.gz |
chg_ramp: Add charge_is_consuming_full_input_current().
Most boards had an identical implementation for this function,
previously known as board_is_consuming_full_charge(). To reduce copy
paste, let's just move it to common code. Boards that charge ramp
without a battery will have to define their own implementation, but
there probably won't be any boards like that in the near future.
BUG=None
BRANCH=None
TEST=make -j buildall
Change-Id: Ic99a378ac26dfd35d7d718bf9376eacfa8609166
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/748919
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'common/charge_ramp_sw.c')
-rw-r--r-- | common/charge_ramp_sw.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/common/charge_ramp_sw.c b/common/charge_ramp_sw.c index cfdfa50c21..d572115043 100644 --- a/common/charge_ramp_sw.c +++ b/common/charge_ramp_sw.c @@ -7,6 +7,7 @@ #include "charge_manager.h" #include "charge_ramp.h" +#include "charge_state.h" #include "common.h" #include "console.h" #include "ec_commands.h" @@ -224,7 +225,7 @@ void chg_ramp_task(void *u) * If we are not drawing full charge, then don't ramp, * just wait in this state, until we are. */ - if (!board_is_consuming_full_charge()) { + if (!charge_is_consuming_full_input_current()) { task_wait_time = CURRENT_DRAW_DELAY; break; } @@ -258,7 +259,7 @@ void chg_ramp_task(void *u) task_wait_time = RAMP_CURR_DELAY; /* Pause ramping if we are not drawing full current */ - if (!board_is_consuming_full_charge()) { + if (!charge_is_consuming_full_input_current()) { task_wait_time = CURRENT_DRAW_DELAY; break; } |