summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/debug_menu.c21
-rw-r--r--apps/gui/statusbar.c4
-rw-r--r--apps/gui/statusbar.h2
-rw-r--r--apps/lang/deutsch.lang14
-rw-r--r--apps/lang/english.lang14
-rw-r--r--apps/settings.h6
-rw-r--r--apps/settings_list.c6
-rw-r--r--apps/settings_menu.c27
8 files changed, 90 insertions, 4 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index c5240d0de8..99c00fa1eb 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -78,6 +78,9 @@
78#include "spdif.h" 78#include "spdif.h"
79#endif 79#endif
80#endif 80#endif
81#ifdef IRIVER_H300_SERIES
82#include "pcf50606.h" /* for pcf50606_read */
83#endif
81 84
82#ifdef IAUDIO_X5 85#ifdef IAUDIO_X5
83#include "lcd-remote-target.h" 86#include "lcd-remote-target.h"
@@ -1059,6 +1062,16 @@ bool dbg_ports(void)
1059 lcd_puts(0, line++, buf); 1062 lcd_puts(0, line++, buf);
1060 snprintf(buf, sizeof(buf), "GPIO1_ENABLE: %08x", gpio1_enable); 1063 snprintf(buf, sizeof(buf), "GPIO1_ENABLE: %08x", gpio1_enable);
1061 lcd_puts(0, line++, buf); 1064 lcd_puts(0, line++, buf);
1065#if defined(IRIVER_H300_SERIES)
1066 snprintf(buf, sizeof(buf), "GPOOD0: %08x", (unsigned int)pcf50606_read(0x37));
1067 lcd_puts(0, line++, buf);
1068 snprintf(buf, sizeof(buf), "GPOOD1: %08x", (unsigned int)pcf50606_read(0x38));
1069 lcd_puts(0, line++, buf);
1070 snprintf(buf, sizeof(buf), "GPOOD2: %08x", (unsigned int)pcf50606_read(0x39));
1071 lcd_puts(0, line++, buf);
1072 snprintf(buf, sizeof(buf), "GPOOD3: %08x", (unsigned int)pcf50606_read(0x3A));
1073 lcd_puts(0, line++, buf);
1074#endif
1062 1075
1063 adc_buttons = adc_read(ADC_BUTTONS); 1076 adc_buttons = adc_read(ADC_BUTTONS);
1064 adc_remote = adc_read(ADC_REMOTE); 1077 adc_remote = adc_read(ADC_REMOTE);
@@ -1422,6 +1435,14 @@ static bool view_battery(void)
1422 snprintf(buf, 30, "long delta: %d", long_delta); 1435 snprintf(buf, 30, "long delta: %d", long_delta);
1423 lcd_puts(0, 6, buf); 1436 lcd_puts(0, 6, buf);
1424 lcd_puts(0, 7, power_message); 1437 lcd_puts(0, 7, power_message);
1438 snprintf(buf, 30, "USB Inserted: %s",
1439 usb_inserted() ? "yes" : "no");
1440 lcd_puts(0, 8, buf);
1441#if defined IRIVER_H300_SERIES
1442 snprintf(buf, 30, "USB Charging Enabled: %s",
1443 usb_charging_enabled() ? "yes" : "no");
1444 lcd_puts(0, 9, buf);
1445#endif
1425#else /* CONFIG_CHARGING != CHARGING_CONTROL */ 1446#else /* CONFIG_CHARGING != CHARGING_CONTROL */
1426#if defined IPOD_NANO || defined IPOD_VIDEO 1447#if defined IPOD_NANO || defined IPOD_VIDEO
1427 int usb_pwr = (GPIOL_INPUT_VAL & 0x10)?true:false; 1448 int usb_pwr = (GPIOL_INPUT_VAL & 0x10)?true:false;
diff --git a/apps/gui/statusbar.c b/apps/gui/statusbar.c
index ae8bba0538..2f6dfafc81 100644
--- a/apps/gui/statusbar.c
+++ b/apps/gui/statusbar.c
@@ -143,7 +143,7 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
143 143
144 bar->info.battlevel = battery_level(); 144 bar->info.battlevel = battery_level();
145#ifdef HAVE_USB_POWER 145#ifdef HAVE_USB_POWER
146 bar->info.usb_power = usb_powered(); 146 bar->info.usb_inserted = usb_inserted();
147#endif 147#endif
148#ifdef CONFIG_CHARGING 148#ifdef CONFIG_CHARGING
149 bar->info.inserted = (charger_input_state == CHARGER); 149 bar->info.inserted = (charger_input_state == CHARGER);
@@ -238,7 +238,7 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
238 gui_statusbar_icon_battery(display, bar->info.battlevel, 238 gui_statusbar_icon_battery(display, bar->info.battlevel,
239 bar->info.batt_charge_step); 239 bar->info.batt_charge_step);
240#ifdef HAVE_USB_POWER 240#ifdef HAVE_USB_POWER
241 if (bar->info.usb_power) 241 if (bar->info.usb_inserted)
242 display->mono_bitmap(bitmap_icons_7x8[Icon_USBPlug], 242 display->mono_bitmap(bitmap_icons_7x8[Icon_USBPlug],
243 STATUSBAR_PLUG_X_POS, 243 STATUSBAR_PLUG_X_POS,
244 STATUSBAR_Y_POS, STATUSBAR_PLUG_WIDTH, 244 STATUSBAR_Y_POS, STATUSBAR_PLUG_WIDTH,
diff --git a/apps/gui/statusbar.h b/apps/gui/statusbar.h
index 5ab97d09ea..516598dd00 100644
--- a/apps/gui/statusbar.h
+++ b/apps/gui/statusbar.h
@@ -44,7 +44,7 @@ struct status_info {
44 bool inserted; 44 bool inserted;
45#endif 45#endif
46#ifdef HAVE_USB_POWER 46#ifdef HAVE_USB_POWER
47 bool usb_power; 47 bool usb_inserted;
48#endif 48#endif
49 bool battery_state; 49 bool battery_state;
50 bool shuffle; 50 bool shuffle;
diff --git a/apps/lang/deutsch.lang b/apps/lang/deutsch.lang
index d9481b9dca..4ae438f64d 100644
--- a/apps/lang/deutsch.lang
+++ b/apps/lang/deutsch.lang
@@ -3570,6 +3570,20 @@
3570 </voice> 3570 </voice>
3571</phrase> 3571</phrase>
3572<phrase> 3572<phrase>
3573 id: LANG_USB_CHARGING
3574 desc: in Battery menu
3575 user:
3576 <source>
3577 *: "Charge During USB Connection"
3578 </source>
3579 <dest>
3580 *: "Laden bei USB-Verbindung"
3581 </dest>
3582 <voice>
3583 *: "Laden bei U S B Verbindung"
3584 </voice>
3585</phrase>
3586<phrase>
3573 id: LANG_DISPLAY_GRAPHIC 3587 id: LANG_DISPLAY_GRAPHIC
3574 desc: Label for type of icon display 3588 desc: Label for type of icon display
3575 user: 3589 user:
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index 3f1fb11b35..e9c9f4c50c 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -3611,6 +3611,20 @@
3611 </voice> 3611 </voice>
3612</phrase> 3612</phrase>
3613<phrase> 3613<phrase>
3614 id: LANG_USB_CHARGING
3615 desc: in Battery menu
3616 user:
3617 <source>
3618 *: "Charge During USB Connection"
3619 </source>
3620 <dest>
3621 *: "Charge During USB Connection"
3622 </dest>
3623 <voice>
3624 *: "Charge During U S B Connection"
3625 </voice>
3626</phrase>
3627<phrase>
3614 id: LANG_DISPLAY_GRAPHIC 3628 id: LANG_DISPLAY_GRAPHIC
3615 desc: Label for type of icon display 3629 desc: Label for type of icon display
3616 user: 3630 user:
diff --git a/apps/settings.h b/apps/settings.h
index 7b7f91abe0..e8db3289a1 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -611,6 +611,12 @@ struct user_settings
611 unsigned char kbd_file[MAX_FILENAME+1]; /* last keyboard */ 611 unsigned char kbd_file[MAX_FILENAME+1]; /* last keyboard */
612#endif 612#endif
613 613
614#ifdef HAVE_USB_POWER
615#ifdef CONFIG_CHARGING
616 bool usb_charging;
617#endif
618#endif
619
614#ifdef HAVE_WM8758 620#ifdef HAVE_WM8758
615 bool eq_hw_enabled; /* Enable hardware equalizer */ 621 bool eq_hw_enabled; /* Enable hardware equalizer */
616 622
diff --git a/apps/settings_list.c b/apps/settings_list.c
index a0651be4f3..6243607264 100644
--- a/apps/settings_list.c
+++ b/apps/settings_list.c
@@ -690,7 +690,11 @@ const struct settings_list settings[] = {
690#ifdef HAVE_LCD_BITMAP 690#ifdef HAVE_LCD_BITMAP
691 FILENAME_SETTING(0,kbd_file,"kbd","",ROCKBOX_DIR "/",".kbd",MAX_FILENAME+1), 691 FILENAME_SETTING(0,kbd_file,"kbd","",ROCKBOX_DIR "/",".kbd",MAX_FILENAME+1),
692#endif 692#endif
693 693#ifdef HAVE_USB_POWER
694#ifdef CONFIG_CHARGING
695 OFFON_SETTING(0,usb_charging,LANG_USB_CHARGING,false,"usb charging",NULL),
696#endif
697#endif
694}; 698};
695 699
696const int nb_settings = sizeof(settings)/sizeof(*settings); 700const int nb_settings = sizeof(settings)/sizeof(*settings);
diff --git a/apps/settings_menu.c b/apps/settings_menu.c
index 0b599ca0c6..b1204e2c1a 100644
--- a/apps/settings_menu.c
+++ b/apps/settings_menu.c
@@ -405,6 +405,12 @@ static bool clear_main_backdrop(void)
405} 405}
406#endif 406#endif
407 407
408#ifdef HAVE_USB_POWER
409#ifdef CONFIG_CHARGING
410#include "usb.h"
411#endif
412#endif
413
408#ifdef HAVE_LCD_COLOR 414#ifdef HAVE_LCD_COLOR
409/** 415/**
410 * Menu for fore/back colors 416 * Menu for fore/back colors
@@ -444,6 +450,22 @@ static bool reset_color(void)
444} 450}
445#endif 451#endif
446 452
453#ifdef HAVE_USB_POWER
454#ifdef CONFIG_CHARGING
455/**
456 * Menu to switch the USB charging on or off
457 */
458static bool usb_charging(void)
459{
460 bool rc = set_bool(str(LANG_USB_CHARGING),
461 &global_settings.usb_charging);
462 /* if (usb_charging_enabled() != global_settings.usb_charging) */
463 usb_charging_enable(global_settings.usb_charging);
464 return rc;
465}
466#endif
467#endif
468
447/** 469/**
448 * Menu to configure the battery display on status bar 470 * Menu to configure the battery display on status bar
449 */ 471 */
@@ -2083,6 +2105,11 @@ static bool battery_settings_menu(void)
2083#if BATTERY_TYPES_COUNT > 1 2105#if BATTERY_TYPES_COUNT > 1
2084 { ID2P(LANG_BATTERY_TYPE), battery_type }, 2106 { ID2P(LANG_BATTERY_TYPE), battery_type },
2085#endif 2107#endif
2108#ifdef HAVE_USB_POWER
2109#ifdef CONFIG_CHARGING
2110 { ID2P(LANG_USB_CHARGING), usb_charging },
2111#endif
2112#endif
2086#else 2113#else
2087 { "Dummy", NULL }, /* to have an entry at all, in the simulator */ 2114 { "Dummy", NULL }, /* to have an entry at all, in the simulator */
2088#endif 2115#endif