diff options
Diffstat (limited to 'firmware/powermgmt.c')
-rw-r--r-- | firmware/powermgmt.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c index a093fe2ac8..6a72a2c613 100644 --- a/firmware/powermgmt.c +++ b/firmware/powermgmt.c | |||
@@ -84,12 +84,12 @@ int battery_level_cached = -1; /* battery level of this minute, updated once | |||
84 | per minute */ | 84 | per minute */ |
85 | static bool car_adapter_mode_enabled = false; | 85 | static bool car_adapter_mode_enabled = false; |
86 | 86 | ||
87 | static int poweroff_idle_timeout_value[15] = | 87 | static const int poweroff_idle_timeout_value[15] = |
88 | { | 88 | { |
89 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 30, 45, 60 | 89 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 30, 45, 60 |
90 | }; | 90 | }; |
91 | 91 | ||
92 | static int percent_to_volt_decharge[11] = | 92 | static const int percent_to_volt_decharge[11] = |
93 | /* voltages (centivolt) of 0%, 10%, ... 100% when charging disabled */ | 93 | /* voltages (centivolt) of 0%, 10%, ... 100% when charging disabled */ |
94 | { | 94 | { |
95 | #ifdef HAVE_LIION | 95 | #ifdef HAVE_LIION |
@@ -133,8 +133,8 @@ int trickle_sec = 0; /* how many seconds should the | |||
133 | charger be enabled per | 133 | charger be enabled per |
134 | minute for trickle | 134 | minute for trickle |
135 | charging? */ | 135 | charging? */ |
136 | static int percent_to_volt_charge[11] = /* voltages (centivolt) of 0%, 10%, | 136 | static const int percent_to_volt_charge[11] = |
137 | ... 100% when charging enabled */ | 137 | /* voltages (centivolt) of 0%, 10%, ... 100% when charging enabled */ |
138 | { | 138 | { |
139 | /* values guessed, see | 139 | /* values guessed, see |
140 | http://www.seattlerobotics.org/encoder/200210/LiIon2.pdf until someone | 140 | http://www.seattlerobotics.org/encoder/200210/LiIon2.pdf until someone |
@@ -149,7 +149,7 @@ void enable_trickle_charge(bool on) | |||
149 | #endif /* HAVE_CHARGE_CTRL */ | 149 | #endif /* HAVE_CHARGE_CTRL */ |
150 | 150 | ||
151 | static char power_stack[DEFAULT_STACK_SIZE]; | 151 | static char power_stack[DEFAULT_STACK_SIZE]; |
152 | static char power_thread_name[] = "power"; | 152 | static const char power_thread_name[] = "power"; |
153 | 153 | ||
154 | static int poweroff_timeout = 0; | 154 | static int poweroff_timeout = 0; |
155 | static long last_charge_time = 0; | 155 | static long last_charge_time = 0; |
@@ -167,7 +167,7 @@ int battery_time(void) | |||
167 | 167 | ||
168 | /* look into the percent_to_volt_* table and get a realistic battery level | 168 | /* look into the percent_to_volt_* table and get a realistic battery level |
169 | percentage */ | 169 | percentage */ |
170 | int voltage_to_percent(int voltage, int* table) | 170 | int voltage_to_percent(int voltage, const int* table) |
171 | { | 171 | { |
172 | if (voltage <= table[0]) | 172 | if (voltage <= table[0]) |
173 | return 0; | 173 | return 0; |