summaryrefslogtreecommitdiff
path: root/firmware/powermgmt.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/powermgmt.c')
-rw-r--r--firmware/powermgmt.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c
index ae8b7445a8..2e08f0a6ff 100644
--- a/firmware/powermgmt.c
+++ b/firmware/powermgmt.c
@@ -381,14 +381,20 @@ static void power_thread(void)
381 /* LED always on or LED on when charger connected */ 381 /* LED always on or LED on when charger connected */
382 current += CURRENT_BACKLIGHT; 382 current += CURRENT_BACKLIGHT;
383 powermgmt_est_runningtime_min = battery_level() * battery_capacity / 100 * 60 / current; 383 powermgmt_est_runningtime_min = battery_level() * battery_capacity / 100 * 60 / current;
384#if MEM == 8 /* assuming 192 kbps, the running time is 22% longer with 8MB */
385 powermgmt_est_runningtime_min = powermgmt_est_runningtime_min * 122 / 100;
386#endif /* MEM == 8 */
384 } 387 }
385#else 388#else
386 current = usb_inserted() ? CURRENT_USB : CURRENT_NORMAL; 389 current = usb_inserted() ? CURRENT_USB : CURRENT_NORMAL;
387 if (backlight_get_timeout() == 1) /* LED always on */ 390 if (backlight_get_timeout() == 1) /* LED always on */
388 current += CURRENT_BACKLIGHT; 391 current += CURRENT_BACKLIGHT;
389 powermgmt_est_runningtime_min = battery_level() * battery_capacity / 100 * 60 / current; 392 powermgmt_est_runningtime_min = battery_level() * battery_capacity / 100 * 60 / current;
390#endif 393#if MEM == 8 /* assuming 192 kbps, the running time is 22% longer with 8MB */
391 394 powermgmt_est_runningtime_min = powermgmt_est_runningtime_min * 122 / 100;
395#endif /* MEM == 8 */
396#endif /* HAVE_CHARGE_CONTROL */
397
392#ifdef HAVE_CHARGE_CTRL 398#ifdef HAVE_CHARGE_CTRL
393 399
394 if (charge_pause > 0) 400 if (charge_pause > 0)
@@ -587,6 +593,9 @@ void power_init(void)
587 battery_level_update(); 593 battery_level_update();
588 /* calculate the remaining time to that the info screen displays something useful */ 594 /* calculate the remaining time to that the info screen displays something useful */
589 powermgmt_est_runningtime_min = battery_level() * battery_capacity / 100 * 60 / CURRENT_NORMAL; 595 powermgmt_est_runningtime_min = battery_level() * battery_capacity / 100 * 60 / CURRENT_NORMAL;
596#if MEM == 8 /* assuming 192 kbps, the running time is 22% longer with 8MB */
597 powermgmt_est_runningtime_min = powermgmt_est_runningtime_min * 122 / 100;
598#endif
590 599
591#ifdef HAVE_CHARGE_CTRL 600#ifdef HAVE_CHARGE_CTRL
592 snprintf(power_message, POWER_MESSAGE_LEN, "Powermgmt started"); 601 snprintf(power_message, POWER_MESSAGE_LEN, "Powermgmt started");