summaryrefslogtreecommitdiff
path: root/firmware/export/powermgmt.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/export/powermgmt.h')
-rw-r--r--firmware/export/powermgmt.h22
1 files changed, 10 insertions, 12 deletions
diff --git a/firmware/export/powermgmt.h b/firmware/export/powermgmt.h
index 6c31aeec52..30fe60c293 100644
--- a/firmware/export/powermgmt.h
+++ b/firmware/export/powermgmt.h
@@ -28,7 +28,7 @@
28 28
29#ifndef SIMULATOR 29#ifndef SIMULATOR
30 30
31#ifdef HAVE_CHARGE_CTRL 31#if CONFIG_CHARGING == CHARGING_CONTROL
32#define START_TOPOFF_CHG 85 /* Battery % to start at top-off */ 32#define START_TOPOFF_CHG 85 /* Battery % to start at top-off */
33#define START_TRICKLE_CHG 95 /* Battery % to start at trickle */ 33#define START_TRICKLE_CHG 95 /* Battery % to start at trickle */
34 34
@@ -59,23 +59,21 @@ extern int pid_p; /* PID proportional term */
59extern int pid_i; /* PID integral term */ 59extern int pid_i; /* PID integral term */
60extern int trickle_sec; /* trickle charge: How many seconds per minute are we charging actually? */ 60extern int trickle_sec; /* trickle charge: How many seconds per minute are we charging actually? */
61 61
62#endif /* HAVE_CHARGE_CTRL */ 62#endif /* CONFIG_CHARGING == CHARGING_CONTROL */
63 63
64#if defined(HAVE_CHARGE_CTRL) || \ 64#if CONFIG_CHARGING >= CHARGING_MONITOR
65 (CONFIG_BATTERY == BATT_LIION2200) || \ 65typedef enum { /* sorted by increasing charging current */
66 defined(HAVE_CHARGE_STATE) 66 DISCHARGING = 0,
67typedef enum { 67 TRICKLE, /* Can occur for CONFIG_CHARGING >= CHARGING_MONITOR */
68 DISCHARGING, 68 TOPOFF, /* Can occur for CONFIG_CHARGING == CHARGING_CONTROL */
69 CHARGING, 69 CHARGING /* Can occur for all CONFIG_CHARGING options */
70 TOPOFF,
71 TRICKLE
72} charge_state_type; 70} charge_state_type;
73 71
74/* tells what the charger is doing */ 72/* tells what the charger is doing */
75extern charge_state_type charge_state; 73extern charge_state_type charge_state;
76#endif /* defined(HAVE_CHARGE_CTRL) || (CONFIG_BATTERY == BATT_LIION2200) */ 74#endif /* CONFIG_CHARGING >= CHARGING_MONITOR */
77 75
78#ifdef HAVE_CHARGING 76#ifdef CONFIG_CHARGING
79/* 77/*
80 * Flag that the charger has been plugged in/removed: this is set for exactly 78 * Flag that the charger has been plugged in/removed: this is set for exactly
81 * one time through the power loop when the charger has been plugged in. 79 * one time through the power loop when the charger has been plugged in.