diff options
author | Uwe Freese <thebreaker@rockbox.org> | 2003-01-09 20:16:37 +0000 |
---|---|---|
committer | Uwe Freese <thebreaker@rockbox.org> | 2003-01-09 20:16:37 +0000 |
commit | 430a354dfe1e1391530ce29e586d7217f8fd1aa2 (patch) | |
tree | 636362c1af1e133b6cc632285ddc8cd76609b23e /firmware | |
parent | aef1b24be9983953bc048fefb62467e3676ddd5d (diff) | |
download | rockbox-430a354dfe1e1391530ce29e586d7217f8fd1aa2.tar.gz rockbox-430a354dfe1e1391530ce29e586d7217f8fd1aa2.zip |
better estimated running time for usb mode
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3047 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/powermgmt.c | 4 | ||||
-rw-r--r-- | firmware/powermgmt.h | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c index 59d1a2fe7b..e640fdde06 100644 --- a/firmware/powermgmt.c +++ b/firmware/powermgmt.c | |||
@@ -368,14 +368,14 @@ static void power_thread(void) | |||
368 | if (charge_state == 1) | 368 | if (charge_state == 1) |
369 | powermgmt_est_runningtime_min = (100 - battery_level()) * battery_capacity / 100 * 60 / CURRENT_CHARGING; | 369 | powermgmt_est_runningtime_min = (100 - battery_level()) * battery_capacity / 100 * 60 / CURRENT_CHARGING; |
370 | else { | 370 | else { |
371 | current = CURRENT_NORMAL; | 371 | current = usb_inserted() ? CURRENT_USB : CURRENT_NORMAL; |
372 | if ((backlight_get_timeout() == 1) || (charger_inserted() && backlight_get_on_when_charging())) | 372 | if ((backlight_get_timeout() == 1) || (charger_inserted() && backlight_get_on_when_charging())) |
373 | /* LED always on or LED on when charger connected */ | 373 | /* LED always on or LED on when charger connected */ |
374 | current += CURRENT_BACKLIGHT; | 374 | current += CURRENT_BACKLIGHT; |
375 | powermgmt_est_runningtime_min = battery_level() * battery_capacity / 100 * 60 / current; | 375 | powermgmt_est_runningtime_min = battery_level() * battery_capacity / 100 * 60 / current; |
376 | } | 376 | } |
377 | #else | 377 | #else |
378 | current = CURRENT_NORMAL; | 378 | current = usb_inserted() ? CURRENT_USB : CURRENT_NORMAL; |
379 | if (backlight_get_timeout() == 1) /* LED always on */ | 379 | if (backlight_get_timeout() == 1) /* LED always on */ |
380 | current += CURRENT_BACKLIGHT; | 380 | current += CURRENT_BACKLIGHT; |
381 | powermgmt_est_runningtime_min = battery_level() * battery_capacity / 100 * 60 / current; | 381 | powermgmt_est_runningtime_min = battery_level() * battery_capacity / 100 * 60 / current; |
diff --git a/firmware/powermgmt.h b/firmware/powermgmt.h index b9686119c0..f4c772e221 100644 --- a/firmware/powermgmt.h +++ b/firmware/powermgmt.h | |||
@@ -66,6 +66,7 @@ extern int charge_state; /* tells what the charger is doing (for info di | |||
66 | #endif /* HAVE_CHARGE_CTRL */ | 66 | #endif /* HAVE_CHARGE_CTRL */ |
67 | 67 | ||
68 | #define CURRENT_NORMAL 145 /* usual current in mA when using the AJB including some disk/backlight/... activity */ | 68 | #define CURRENT_NORMAL 145 /* usual current in mA when using the AJB including some disk/backlight/... activity */ |
69 | #define CURRENT_USB 500 /* usual current in mA in USB mode */ | ||
69 | #define CURRENT_BACKLIGHT 30 /* additional current when backlight is always on */ | 70 | #define CURRENT_BACKLIGHT 30 /* additional current when backlight is always on */ |
70 | #define CURRENT_CHARGING 300 /* charging current */ | 71 | #define CURRENT_CHARGING 300 /* charging current */ |
71 | 72 | ||