summaryrefslogtreecommitdiff
path: root/apps/plugins/battery_bench.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/battery_bench.c')
-rw-r--r--apps/plugins/battery_bench.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/apps/plugins/battery_bench.c b/apps/plugins/battery_bench.c
index 4f1016b7eb..fff3c2fa57 100644
--- a/apps/plugins/battery_bench.c
+++ b/apps/plugins/battery_bench.c
@@ -156,11 +156,11 @@ bool exit_tsr(bool reenter)
156/* use long for aligning */ 156/* use long for aligning */
157unsigned long thread_stack[THREAD_STACK_SIZE/sizeof(long)]; 157unsigned long thread_stack[THREAD_STACK_SIZE/sizeof(long)];
158 158
159#if defined(CONFIG_CHARGING) || defined(HAVE_USB_POWER) 159#if CONFIG_CHARGING || defined(HAVE_USB_POWER)
160unsigned int charge_state(void) 160unsigned int charge_state(void)
161{ 161{
162 unsigned int ret = 0; 162 unsigned int ret = 0;
163#ifdef CONFIG_CHARGING 163#if CONFIG_CHARGING
164 if(rb->charger_inserted()) 164 if(rb->charger_inserted())
165 ret = BIT_CHARGER; 165 ret = BIT_CHARGER;
166#if CONFIG_CHARGING == CHARGING_MONITOR 166#if CONFIG_CHARGING == CHARGING_MONITOR
@@ -182,7 +182,7 @@ void thread(void)
182 int fd, buffelements, tick = 1, i = 0, skipped = 0, exit = 0; 182 int fd, buffelements, tick = 1, i = 0, skipped = 0, exit = 0;
183 int fst = 0, lst = 0; /* first and last skipped tick */ 183 int fst = 0, lst = 0; /* first and last skipped tick */
184 unsigned int last_voltage = 0; 184 unsigned int last_voltage = 0;
185#if defined(CONFIG_CHARGING) || defined(HAVE_USB_POWER) 185#if CONFIG_CHARGING || defined(HAVE_USB_POWER)
186 unsigned int last_state = 0; 186 unsigned int last_state = 0;
187#endif 187#endif
188 long sleep_time; 188 long sleep_time;
@@ -230,7 +230,7 @@ void thread(void)
230 rb->fdprintf(fd, 230 rb->fdprintf(fd,
231 "%02d:%02d:%02d, %05d, %03d%%, " 231 "%02d:%02d:%02d, %05d, %03d%%, "
232 "%02d:%02d, %04d, %04d" 232 "%02d:%02d, %04d, %04d"
233#ifdef CONFIG_CHARGING 233#if CONFIG_CHARGING
234 ", %c" 234 ", %c"
235#if CONFIG_CHARGING == CHARGING_MONITOR 235#if CONFIG_CHARGING == CHARGING_MONITOR
236 ", %c" 236 ", %c"
@@ -243,7 +243,7 @@ void thread(void)
243 243
244 HMS(secs), secs, bat[j].level, 244 HMS(secs), secs, bat[j].level,
245 bat[j].eta / 60, bat[j].eta % 60, 245 bat[j].eta / 60, bat[j].eta % 60,
246#if defined(CONFIG_CHARGING) || defined(HAVE_USB_POWER) 246#if CONFIG_CHARGING || defined(HAVE_USB_POWER)
247 (bat[j].voltage & 247 (bat[j].voltage &
248 (~(BIT_CHARGER|BIT_CHARGING|BIT_USB_POWER))) 248 (~(BIT_CHARGER|BIT_CHARGING|BIT_USB_POWER)))
249 *10, 249 *10,
@@ -251,7 +251,7 @@ void thread(void)
251 bat[j].voltage * 10, 251 bat[j].voltage * 10,
252#endif 252#endif
253 temp + 1 + (j-i) 253 temp + 1 + (j-i)
254#ifdef CONFIG_CHARGING 254#if CONFIG_CHARGING
255 ,(bat[j].voltage & BIT_CHARGER)?'A':'-' 255 ,(bat[j].voltage & BIT_CHARGER)?'A':'-'
256#if CONFIG_CHARGING == CHARGING_MONITOR 256#if CONFIG_CHARGING == CHARGING_MONITOR
257 ,(bat[j].voltage & BIT_CHARGING)?'C':'-' 257 ,(bat[j].voltage & BIT_CHARGING)?'C':'-'
@@ -288,7 +288,7 @@ void thread(void)
288 timeflag = true; 288 timeflag = true;
289 289
290 if(last_voltage != (current_voltage=rb->battery_voltage()) 290 if(last_voltage != (current_voltage=rb->battery_voltage())
291#if defined(CONFIG_CHARGING) || defined(HAVE_USB_POWER) 291#if CONFIG_CHARGING || defined(HAVE_USB_POWER)
292 || last_state != charge_state() 292 || last_state != charge_state()
293#endif 293#endif
294 ) 294 )
@@ -308,7 +308,7 @@ void thread(void)
308 bat[i].level = rb->battery_level(); 308 bat[i].level = rb->battery_level();
309 bat[i].eta = rb->battery_time(); 309 bat[i].eta = rb->battery_time();
310 last_voltage = bat[i].voltage = current_voltage; 310 last_voltage = bat[i].voltage = current_voltage;
311#if defined(CONFIG_CHARGING) || defined(HAVE_USB_POWER) 311#if CONFIG_CHARGING || defined(HAVE_USB_POWER)
312 bat[i].voltage |= last_state = charge_state(); 312 bat[i].voltage |= last_state = charge_state();
313#endif 313#endif
314 i++; 314 i++;
@@ -448,7 +448,7 @@ int main(void)
448 "Battery type: %d mAh Buffer Entries: %d\n" 448 "Battery type: %d mAh Buffer Entries: %d\n"
449 " Time:, Seconds:, Level:, Time Left:, Voltage[mV]:," 449 " Time:, Seconds:, Level:, Time Left:, Voltage[mV]:,"
450 " M/DA:" 450 " M/DA:"
451#ifdef CONFIG_CHARGING 451#if CONFIG_CHARGING
452 ", C:" 452 ", C:"
453#endif 453#endif
454#if CONFIG_CHARGING == CHARGING_MONITOR 454#if CONFIG_CHARGING == CHARGING_MONITOR