diff options
author | Bill Richardson <wfrichar@chromium.org> | 2014-04-09 14:02:55 -0700 |
---|---|---|
committer | Bill Richardson <wfrichar@chromium.org> | 2014-04-11 15:37:38 +0000 |
commit | 5019551e1d63bdd95e8b358a409e923c16e604fd (patch) | |
tree | adfaecb5b6c4e3f0ebb39019e8c818f02e506705 /include | |
parent | 39194d5fc584199fad690939b362e61b1aa4a12d (diff) | |
download | chrome-ec-5019551e1d63bdd95e8b358a409e923c16e604fd.tar.gz |
Move common charge_state time constants to a common header
We had duplicate values in both v1 and v2 headers. Let's consolidate them in
one place, and prefix the constants with "CHARGE_", so people don't use them
randomly.
BUG=chrome-os-partner:20881
BRANCH=ToT
TEST=make buildall -j
No functionality changes, refactor/rename only.
Change-Id: I0ee599a2e3bf0835c2c0a7e57872ad9015701a4b
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/193876
Diffstat (limited to 'include')
-rw-r--r-- | include/charge_state.h | 15 | ||||
-rw-r--r-- | include/charge_state_v1.h | 8 |
2 files changed, 15 insertions, 8 deletions
diff --git a/include/charge_state.h b/include/charge_state.h index 581acfd285..35c2041d45 100644 --- a/include/charge_state.h +++ b/include/charge_state.h @@ -6,8 +6,23 @@ #define __CROS_EC_CHARGE_STATE_H #include "common.h" +#include "timer.h" /* Stuff that's common to all charger implementations can go here. */ + +/* Seconds after AP battery shutdown warning before we kill the AP */ +#define LOW_BATTERY_SHUTDOWN_TIMEOUT 30 +/* Seconds to spend trying to wake a non-responsive battery */ +#define PRECHARGE_TIMEOUT 30 + +/* Power state task polling periods in usec */ +#define CHARGE_POLL_PERIOD_VERY_LONG MINUTE +#define CHARGE_POLL_PERIOD_LONG (MSEC * 500) +#define CHARGE_POLL_PERIOD_CHARGE (MSEC * 250) +#define CHARGE_POLL_PERIOD_SHORT (MSEC * 100) +#define CHARGE_MIN_SLEEP_USEC (MSEC * 50) +#define CHARGE_MAX_SLEEP_USEC SECOND + /* Power states */ enum charge_state { /* Meta-state; unchanged from previous time through task loop */ diff --git a/include/charge_state_v1.h b/include/charge_state_v1.h index d0637a2d21..8d0afe32a0 100644 --- a/include/charge_state_v1.h +++ b/include/charge_state_v1.h @@ -12,14 +12,6 @@ /* Update period to prevent charger watchdog timeout */ #define CHARGER_UPDATE_PERIOD (SECOND * 10) -/* Power state task polling periods in usec */ -#define POLL_PERIOD_VERY_LONG MINUTE -#define POLL_PERIOD_LONG (MSEC * 500) -#define POLL_PERIOD_CHARGE (MSEC * 250) -#define POLL_PERIOD_SHORT (MSEC * 100) -#define MIN_SLEEP_USEC (MSEC * 50) -#define MAX_SLEEP_USEC SECOND - /* Power state error flags */ #define F_CHARGER_INIT (1 << 0) /* Charger initialization */ #define F_CHARGER_VOLTAGE (1 << 1) /* Charger maximum output voltage */ |