From 3157e1395674a930c74e2ef4cc4ce78dffea8569 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Wed, 24 Dec 2008 16:58:41 +0000 Subject: Simplify powermgmt thread loops so it calls functions turn (no more power_thread_sleep). Do other target-friendly simplifications, generic battery switch handling and split sim-specific code. Whoever can, please verify charging on the Archos Recorder (due to change in the charger duty cycle code). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19579 a1c6a512-1295-4272-9138-f99709370657 --- apps/debug_menu.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'apps/debug_menu.c') diff --git a/apps/debug_menu.c b/apps/debug_menu.c index beee39a09b..abb6018a10 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c @@ -1603,10 +1603,10 @@ static bool view_battery(void) lcd_puts(0, 2, buf); #endif #if CONFIG_CHARGING -#if CONFIG_CHARGING == CHARGING_CONTROL +#if defined ARCHOS_RECORDER snprintf(buf, 30, "Chgr: %s %s", charger_inserted() ? "present" : "absent", - charger_enabled ? "on" : "off"); + charger_enabled() ? "on" : "off"); lcd_puts(0, 3, buf); snprintf(buf, 30, "short delta: %d", short_delta); lcd_puts(0, 5, buf); @@ -1616,13 +1616,11 @@ static bool view_battery(void) snprintf(buf, 30, "USB Inserted: %s", usb_inserted() ? "yes" : "no"); lcd_puts(0, 8, buf); -#if defined IRIVER_H300_SERIES +#elif defined IRIVER_H300_SERIES snprintf(buf, 30, "USB Charging Enabled: %s", usb_charging_enabled() ? "yes" : "no"); lcd_puts(0, 9, buf); -#endif -#else /* CONFIG_CHARGING != CHARGING_CONTROL */ -#if defined IPOD_NANO || defined IPOD_VIDEO +#elif defined IPOD_NANO || defined IPOD_VIDEO int usb_pwr = (GPIOL_INPUT_VAL & 0x10)?true:false; int ext_pwr = (GPIOL_INPUT_VAL & 0x08)?false:true; int dock = (GPIOA_INPUT_VAL & 0x10)?true:false; @@ -1644,12 +1642,8 @@ static bool view_battery(void) snprintf(buf, 30, "Headphone: %s", headphone ? "connected" : "disconnected"); lcd_puts(0, 7, buf); -#else - snprintf(buf, 30, "Charger: %s", - charger_inserted() ? "present" : "absent"); - lcd_puts(0, 3, buf); -#if defined TOSHIBA_GIGABEAT_S - int line = 4; +#elif defined TOSHIBA_GIGABEAT_S + int line = 3; unsigned int st; static const unsigned char * const chrgstate_strings[] = @@ -1663,6 +1657,10 @@ static bool view_battery(void) "", }; + snprintf(buf, 30, "Charger: %s", + charger_inserted() ? "present" : "absent"); + lcd_puts(0, line++, buf); + st = power_input_status() & (POWER_INPUT_CHARGER | POWER_INPUT_BATTERY); snprintf(buf, 30, "%s%s", @@ -1730,9 +1728,11 @@ static bool view_battery(void) } lcd_puts(0, line++, buf); -#endif /* defined TOSHIBA_GIGABEAT_S */ -#endif /* defined IPOD_NANO || defined IPOD_VIDEO */ -#endif /* CONFIG_CHARGING != CHARGING_CONTROL */ +#else + snprintf(buf, 30, "Charger: %s", + charger_inserted() ? "present" : "absent"); + lcd_puts(0, 3, buf); +#endif /* target type */ #endif /* CONFIG_CHARGING */ break; @@ -1750,7 +1750,7 @@ static bool view_battery(void) case 3: /* remaining time estimation: */ -#if CONFIG_CHARGING == CHARGING_CONTROL +#ifdef ARCHOS_RECORDER snprintf(buf, 30, "charge_state: %d", charge_state); lcd_puts(0, 0, buf); @@ -1765,7 +1765,7 @@ static bool view_battery(void) snprintf(buf, 30, "Trickle sec: %d/60", trickle_sec); lcd_puts(0, 4, buf); -#endif /* CONFIG_CHARGING == CHARGING_CONTROL */ +#endif /* ARCHOS_RECORDER */ snprintf(buf, 30, "Last PwrHist: %d.%03dV", power_history[0] / 1000, -- cgit v1.2.3