diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/debug_menu.c | 34 | ||||
-rw-r--r-- | apps/menus/main_menu.c | 21 | ||||
-rw-r--r-- | apps/screens.c | 8 |
3 files changed, 30 insertions, 33 deletions
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) | |||
1603 | lcd_puts(0, 2, buf); | 1603 | lcd_puts(0, 2, buf); |
1604 | #endif | 1604 | #endif |
1605 | #if CONFIG_CHARGING | 1605 | #if CONFIG_CHARGING |
1606 | #if CONFIG_CHARGING == CHARGING_CONTROL | 1606 | #if defined ARCHOS_RECORDER |
1607 | snprintf(buf, 30, "Chgr: %s %s", | 1607 | snprintf(buf, 30, "Chgr: %s %s", |
1608 | charger_inserted() ? "present" : "absent", | 1608 | charger_inserted() ? "present" : "absent", |
1609 | charger_enabled ? "on" : "off"); | 1609 | charger_enabled() ? "on" : "off"); |
1610 | lcd_puts(0, 3, buf); | 1610 | lcd_puts(0, 3, buf); |
1611 | snprintf(buf, 30, "short delta: %d", short_delta); | 1611 | snprintf(buf, 30, "short delta: %d", short_delta); |
1612 | lcd_puts(0, 5, buf); | 1612 | lcd_puts(0, 5, buf); |
@@ -1616,13 +1616,11 @@ static bool view_battery(void) | |||
1616 | snprintf(buf, 30, "USB Inserted: %s", | 1616 | snprintf(buf, 30, "USB Inserted: %s", |
1617 | usb_inserted() ? "yes" : "no"); | 1617 | usb_inserted() ? "yes" : "no"); |
1618 | lcd_puts(0, 8, buf); | 1618 | lcd_puts(0, 8, buf); |
1619 | #if defined IRIVER_H300_SERIES | 1619 | #elif defined IRIVER_H300_SERIES |
1620 | snprintf(buf, 30, "USB Charging Enabled: %s", | 1620 | snprintf(buf, 30, "USB Charging Enabled: %s", |
1621 | usb_charging_enabled() ? "yes" : "no"); | 1621 | usb_charging_enabled() ? "yes" : "no"); |
1622 | lcd_puts(0, 9, buf); | 1622 | lcd_puts(0, 9, buf); |
1623 | #endif | 1623 | #elif defined IPOD_NANO || defined IPOD_VIDEO |
1624 | #else /* CONFIG_CHARGING != CHARGING_CONTROL */ | ||
1625 | #if defined IPOD_NANO || defined IPOD_VIDEO | ||
1626 | int usb_pwr = (GPIOL_INPUT_VAL & 0x10)?true:false; | 1624 | int usb_pwr = (GPIOL_INPUT_VAL & 0x10)?true:false; |
1627 | int ext_pwr = (GPIOL_INPUT_VAL & 0x08)?false:true; | 1625 | int ext_pwr = (GPIOL_INPUT_VAL & 0x08)?false:true; |
1628 | int dock = (GPIOA_INPUT_VAL & 0x10)?true:false; | 1626 | int dock = (GPIOA_INPUT_VAL & 0x10)?true:false; |
@@ -1644,12 +1642,8 @@ static bool view_battery(void) | |||
1644 | snprintf(buf, 30, "Headphone: %s", | 1642 | snprintf(buf, 30, "Headphone: %s", |
1645 | headphone ? "connected" : "disconnected"); | 1643 | headphone ? "connected" : "disconnected"); |
1646 | lcd_puts(0, 7, buf); | 1644 | lcd_puts(0, 7, buf); |
1647 | #else | 1645 | #elif defined TOSHIBA_GIGABEAT_S |
1648 | snprintf(buf, 30, "Charger: %s", | 1646 | int line = 3; |
1649 | charger_inserted() ? "present" : "absent"); | ||
1650 | lcd_puts(0, 3, buf); | ||
1651 | #if defined TOSHIBA_GIGABEAT_S | ||
1652 | int line = 4; | ||
1653 | unsigned int st; | 1647 | unsigned int st; |
1654 | 1648 | ||
1655 | static const unsigned char * const chrgstate_strings[] = | 1649 | static const unsigned char * const chrgstate_strings[] = |
@@ -1663,6 +1657,10 @@ static bool view_battery(void) | |||
1663 | "<unknown>", | 1657 | "<unknown>", |
1664 | }; | 1658 | }; |
1665 | 1659 | ||
1660 | snprintf(buf, 30, "Charger: %s", | ||
1661 | charger_inserted() ? "present" : "absent"); | ||
1662 | lcd_puts(0, line++, buf); | ||
1663 | |||
1666 | st = power_input_status() & | 1664 | st = power_input_status() & |
1667 | (POWER_INPUT_CHARGER | POWER_INPUT_BATTERY); | 1665 | (POWER_INPUT_CHARGER | POWER_INPUT_BATTERY); |
1668 | snprintf(buf, 30, "%s%s", | 1666 | snprintf(buf, 30, "%s%s", |
@@ -1730,9 +1728,11 @@ static bool view_battery(void) | |||
1730 | } | 1728 | } |
1731 | 1729 | ||
1732 | lcd_puts(0, line++, buf); | 1730 | lcd_puts(0, line++, buf); |
1733 | #endif /* defined TOSHIBA_GIGABEAT_S */ | 1731 | #else |
1734 | #endif /* defined IPOD_NANO || defined IPOD_VIDEO */ | 1732 | snprintf(buf, 30, "Charger: %s", |
1735 | #endif /* CONFIG_CHARGING != CHARGING_CONTROL */ | 1733 | charger_inserted() ? "present" : "absent"); |
1734 | lcd_puts(0, 3, buf); | ||
1735 | #endif /* target type */ | ||
1736 | #endif /* CONFIG_CHARGING */ | 1736 | #endif /* CONFIG_CHARGING */ |
1737 | break; | 1737 | break; |
1738 | 1738 | ||
@@ -1750,7 +1750,7 @@ static bool view_battery(void) | |||
1750 | 1750 | ||
1751 | case 3: /* remaining time estimation: */ | 1751 | case 3: /* remaining time estimation: */ |
1752 | 1752 | ||
1753 | #if CONFIG_CHARGING == CHARGING_CONTROL | 1753 | #ifdef ARCHOS_RECORDER |
1754 | snprintf(buf, 30, "charge_state: %d", charge_state); | 1754 | snprintf(buf, 30, "charge_state: %d", charge_state); |
1755 | lcd_puts(0, 0, buf); | 1755 | lcd_puts(0, 0, buf); |
1756 | 1756 | ||
@@ -1765,7 +1765,7 @@ static bool view_battery(void) | |||
1765 | 1765 | ||
1766 | snprintf(buf, 30, "Trickle sec: %d/60", trickle_sec); | 1766 | snprintf(buf, 30, "Trickle sec: %d/60", trickle_sec); |
1767 | lcd_puts(0, 4, buf); | 1767 | lcd_puts(0, 4, buf); |
1768 | #endif /* CONFIG_CHARGING == CHARGING_CONTROL */ | 1768 | #endif /* ARCHOS_RECORDER */ |
1769 | 1769 | ||
1770 | snprintf(buf, 30, "Last PwrHist: %d.%03dV", | 1770 | snprintf(buf, 30, "Last PwrHist: %d.%03dV", |
1771 | power_history[0] / 1000, | 1771 | power_history[0] / 1000, |
diff --git a/apps/menus/main_menu.c b/apps/menus/main_menu.c index 4c15b1de4b..b22824d8bd 100644 --- a/apps/menus/main_menu.c +++ b/apps/menus/main_menu.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include "lang.h" | 27 | #include "lang.h" |
28 | #include "action.h" | 28 | #include "action.h" |
29 | #include "settings.h" | 29 | #include "settings.h" |
30 | #include "power.h" | ||
30 | #include "powermgmt.h" | 31 | #include "powermgmt.h" |
31 | #include "menu.h" | 32 | #include "menu.h" |
32 | #include "misc.h" | 33 | #include "misc.h" |
@@ -199,15 +200,14 @@ static char* info_getname(int selected_item, void *data, | |||
199 | if (charge_state == CHARGING) | 200 | if (charge_state == CHARGING) |
200 | return (char *)str(LANG_BATTERY_CHARGE); | 201 | return (char *)str(LANG_BATTERY_CHARGE); |
201 | else | 202 | else |
202 | #if CONFIG_CHARGING == CHARGING_CONTROL | 203 | #ifdef ARCHOS_RECORDER |
203 | if (charge_state == TOPOFF) | 204 | if (charge_state == TOPOFF) |
204 | return (char *)str(LANG_BATTERY_TOPOFF_CHARGE); | 205 | return (char *)str(LANG_BATTERY_TOPOFF_CHARGE); |
205 | else | 206 | else if (charge_state == TRICKLE) |
206 | #endif | ||
207 | if (charge_state == TRICKLE) | ||
208 | return (char *)str(LANG_BATTERY_TRICKLE_CHARGE); | 207 | return (char *)str(LANG_BATTERY_TRICKLE_CHARGE); |
209 | else | 208 | else |
210 | #endif | 209 | #endif /* ARCHOS_RECORDER */ |
210 | #endif /* CONFIG_CHARGING = */ | ||
211 | if (battery_level() >= 0) | 211 | if (battery_level() >= 0) |
212 | snprintf(buffer, buffer_len, (char *)str(LANG_BATTERY_TIME), | 212 | snprintf(buffer, buffer_len, (char *)str(LANG_BATTERY_TIME), |
213 | battery_level(), battery_time() / 60, battery_time() % 60); | 213 | battery_level(), battery_time() / 60, battery_time() % 60); |
@@ -282,22 +282,21 @@ static int info_speak_item(int selected_item, void * data) | |||
282 | } | 282 | } |
283 | case INFO_BATTERY: /* battery */ | 283 | case INFO_BATTERY: /* battery */ |
284 | #if CONFIG_CHARGING == CHARGING_SIMPLE | 284 | #if CONFIG_CHARGING == CHARGING_SIMPLE |
285 | if (charger_input_state == CHARGER) | 285 | if (charger_inserted()) |
286 | talk_id(LANG_BATTERY_CHARGE, true); | 286 | talk_id(LANG_BATTERY_CHARGE, true); |
287 | else | 287 | else |
288 | #elif CONFIG_CHARGING >= CHARGING_MONITOR | 288 | #elif CONFIG_CHARGING >= CHARGING_MONITOR |
289 | if (charge_state == CHARGING) | 289 | if (charge_state == CHARGING) |
290 | talk_id(LANG_BATTERY_CHARGE, true); | 290 | talk_id(LANG_BATTERY_CHARGE, true); |
291 | else | 291 | else |
292 | #if CONFIG_CHARGING == CHARGING_CONTROL | 292 | #ifdef ARCHOS_RECORDER |
293 | if (charge_state == TOPOFF) | 293 | if (charge_state == TOPOFF) |
294 | talk_id(LANG_BATTERY_TOPOFF_CHARGE, true); | 294 | talk_id(LANG_BATTERY_TOPOFF_CHARGE, true); |
295 | else | 295 | else if (charge_state == TRICKLE) |
296 | #endif | ||
297 | if (charge_state == TRICKLE) | ||
298 | talk_id(LANG_BATTERY_TRICKLE_CHARGE, true); | 296 | talk_id(LANG_BATTERY_TRICKLE_CHARGE, true); |
299 | else | 297 | else |
300 | #endif | 298 | #endif /* ARCHOS_RECORDER */ |
299 | #endif /* CONFIG_CHARGING = */ | ||
301 | if (battery_level() >= 0) | 300 | if (battery_level() >= 0) |
302 | { | 301 | { |
303 | talk_id(LANG_BATTERY_TIME, false); | 302 | talk_id(LANG_BATTERY_TIME, false); |
diff --git a/apps/screens.c b/apps/screens.c index 992c740460..230e9ae53c 100644 --- a/apps/screens.c +++ b/apps/screens.c | |||
@@ -209,8 +209,7 @@ static void charging_display_info(bool animate) | |||
209 | lcd_puts(0, 7, buf); | 209 | lcd_puts(0, 7, buf); |
210 | } | 210 | } |
211 | 211 | ||
212 | #if CONFIG_CHARGING == CHARGING_CONTROL | 212 | #ifdef ARCHOS_RECORER |
213 | |||
214 | snprintf(buf, 32, "Charge mode:"); | 213 | snprintf(buf, 32, "Charge mode:"); |
215 | lcd_puts(0, 2, buf); | 214 | lcd_puts(0, 2, buf); |
216 | 215 | ||
@@ -224,10 +223,9 @@ static void charging_display_info(bool animate) | |||
224 | snprintf(buf, 32, "not charging"); | 223 | snprintf(buf, 32, "not charging"); |
225 | 224 | ||
226 | lcd_puts(0, 3, buf); | 225 | lcd_puts(0, 3, buf); |
227 | if (!charger_enabled) | 226 | if (!charger_enabled()) |
228 | animate = false; | 227 | animate = false; |
229 | #endif /* CONFIG_CHARGING == CHARGING_CONTROL */ | 228 | #endif /* ARCHOS_RECORER */ |
230 | |||
231 | 229 | ||
232 | /* middle part */ | 230 | /* middle part */ |
233 | memset(charging_logo+3, 0x00, 32); | 231 | memset(charging_logo+3, 0x00, 32); |