diff options
| author | Jonathan Gordon <rockbox@jdgordon.info> | 2007-02-18 05:32:06 +0000 |
|---|---|---|
| committer | Jonathan Gordon <rockbox@jdgordon.info> | 2007-02-18 05:32:06 +0000 |
| commit | 9a6f419775270340ee154c55dbe52e99682fb77a (patch) | |
| tree | 188fa4854d2ac5529f701de1bbba29a3241495bc /apps/plugins | |
| parent | bd47d48c21ddcdd56b3654db78613d93739b8ce7 (diff) | |
| download | rockbox-9a6f419775270340ee154c55dbe52e99682fb77a.zip rockbox-9a6f419775270340ee154c55dbe52e99682fb77a.tar.gz rockbox-9a6f419775270340ee154c55dbe52e99682fb77a.tar.bz2 rockbox-9a6f419775270340ee154c55dbe52e99682fb77a.tar.xz | |
CONFIG_CHARGING
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12384 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins')
| -rw-r--r-- | apps/plugins/battery_bench.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/apps/plugins/battery_bench.c b/apps/plugins/battery_bench.c index 4f1016b..fff3c2f 100644 --- a/apps/plugins/battery_bench.c +++ b/apps/plugins/battery_bench.c @@ -156,11 +156,11 @@ bool exit_tsr(bool reenter) /* use long for aligning */ unsigned long thread_stack[THREAD_STACK_SIZE/sizeof(long)]; -#if defined(CONFIG_CHARGING) || defined(HAVE_USB_POWER) +#if CONFIG_CHARGING || defined(HAVE_USB_POWER) unsigned int charge_state(void) { unsigned int ret = 0; -#ifdef CONFIG_CHARGING +#if CONFIG_CHARGING if(rb->charger_inserted()) ret = BIT_CHARGER; #if CONFIG_CHARGING == CHARGING_MONITOR @@ -182,7 +182,7 @@ void thread(void) int fd, buffelements, tick = 1, i = 0, skipped = 0, exit = 0; int fst = 0, lst = 0; /* first and last skipped tick */ unsigned int last_voltage = 0; -#if defined(CONFIG_CHARGING) || defined(HAVE_USB_POWER) +#if CONFIG_CHARGING || defined(HAVE_USB_POWER) unsigned int last_state = 0; #endif long sleep_time; @@ -230,7 +230,7 @@ void thread(void) rb->fdprintf(fd, "%02d:%02d:%02d, %05d, %03d%%, " "%02d:%02d, %04d, %04d" -#ifdef CONFIG_CHARGING +#if CONFIG_CHARGING ", %c" #if CONFIG_CHARGING == CHARGING_MONITOR ", %c" @@ -243,7 +243,7 @@ void thread(void) HMS(secs), secs, bat[j].level, bat[j].eta / 60, bat[j].eta % 60, -#if defined(CONFIG_CHARGING) || defined(HAVE_USB_POWER) +#if CONFIG_CHARGING || defined(HAVE_USB_POWER) (bat[j].voltage & (~(BIT_CHARGER|BIT_CHARGING|BIT_USB_POWER))) *10, @@ -251,7 +251,7 @@ void thread(void) bat[j].voltage * 10, #endif temp + 1 + (j-i) -#ifdef CONFIG_CHARGING +#if CONFIG_CHARGING ,(bat[j].voltage & BIT_CHARGER)?'A':'-' #if CONFIG_CHARGING == CHARGING_MONITOR ,(bat[j].voltage & BIT_CHARGING)?'C':'-' @@ -288,7 +288,7 @@ void thread(void) timeflag = true; if(last_voltage != (current_voltage=rb->battery_voltage()) -#if defined(CONFIG_CHARGING) || defined(HAVE_USB_POWER) +#if CONFIG_CHARGING || defined(HAVE_USB_POWER) || last_state != charge_state() #endif ) @@ -308,7 +308,7 @@ void thread(void) bat[i].level = rb->battery_level(); bat[i].eta = rb->battery_time(); last_voltage = bat[i].voltage = current_voltage; -#if defined(CONFIG_CHARGING) || defined(HAVE_USB_POWER) +#if CONFIG_CHARGING || defined(HAVE_USB_POWER) bat[i].voltage |= last_state = charge_state(); #endif i++; @@ -448,7 +448,7 @@ int main(void) "Battery type: %d mAh Buffer Entries: %d\n" " Time:, Seconds:, Level:, Time Left:, Voltage[mV]:," " M/DA:" -#ifdef CONFIG_CHARGING +#if CONFIG_CHARGING ", C:" #endif #if CONFIG_CHARGING == CHARGING_MONITOR |