summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorMichael Giacomelli <giac2000@hotmail.com>2011-05-16 20:27:14 +0000
committerMichael Giacomelli <giac2000@hotmail.com>2011-05-16 20:27:14 +0000
commit84b4c46d74d2b757026d425953bf2b033e124016 (patch)
tree84a1cf9411348eeaef21a243d1d07ac258aa0e37 /firmware
parent14cac39d19027723cbb4f83bd97001b9a97c793f (diff)
downloadrockbox-84b4c46d74d2b757026d425953bf2b033e124016.tar.gz
rockbox-84b4c46d74d2b757026d425953bf2b033e124016.tar.bz2
rockbox-84b4c46d74d2b757026d425953bf2b033e124016.zip
Enter USB charging mode on devices that support it if any key is held down during USB insert (except on Archos where certain keys need to be avoided and players like the iRiver H1x0 which do not charge over USB and the iAudios/AMSv2 which do not yet support USB fully). Update the manual to explain the new behavior.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29889 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/export/usb.h45
-rw-r--r--firmware/usb.c6
2 files changed, 4 insertions, 47 deletions
diff --git a/firmware/export/usb.h b/firmware/export/usb.h
index a3425dae2f..72315404e3 100644
--- a/firmware/export/usb.h
+++ b/firmware/export/usb.h
@@ -57,7 +57,6 @@ enum {
USB_HANDLED, /* Bootloader status code */
#endif
};
-
#ifdef HAVE_USB_POWER
#if CONFIG_KEYPAD == RECORDER_PAD
#define USBPOWER_BUTTON BUTTON_F1
@@ -65,48 +64,10 @@ enum {
#elif CONFIG_KEYPAD == ONDIO_PAD
#define USBPOWER_BUTTON BUTTON_MENU
#define USBPOWER_BTN_IGNORE BUTTON_OFF
-#elif (CONFIG_KEYPAD == IPOD_4G_PAD)
-#define USBPOWER_BUTTON BUTTON_MENU
-#define USBPOWER_BTN_IGNORE BUTTON_PLAY
-#elif CONFIG_KEYPAD == IRIVER_H300_PAD
-#define USBPOWER_BUTTON BUTTON_MODE
-#define USBPOWER_BTN_IGNORE BUTTON_ON
-#elif CONFIG_KEYPAD == GIGABEAT_PAD
-#define USBPOWER_BUTTON BUTTON_MENU
-#define USBPOWER_BTN_IGNORE BUTTON_POWER
-#elif (CONFIG_KEYPAD == IRIVER_H10_PAD) || \
- (CONFIG_KEYPAD == MROBE100_PAD)
-#define USBPOWER_BUTTON BUTTON_RIGHT
-#define USBPOWER_BTN_IGNORE BUTTON_POWER
-#elif (CONFIG_KEYPAD == SANSA_E200_PAD) || \
- (CONFIG_KEYPAD == SANSA_C200_PAD) || \
- (CONFIG_KEYPAD == SANSA_CLIP_PAD) || \
- (CONFIG_KEYPAD == SANSA_FUZE_PAD)
-#define USBPOWER_BUTTON BUTTON_SELECT
-#define USBPOWER_BTN_IGNORE BUTTON_POWER
-#elif (CONFIG_KEYPAD == PHILIPS_SA9200_PAD)
-#define USBPOWER_BUTTON BUTTON_PLAY
-#define USBPOWER_BTN_IGNORE BUTTON_POWER
-#elif CONFIG_KEYPAD == PHILIPS_HDD1630_PAD
-#define USBPOWER_BUTTON BUTTON_PLAYLIST
-#define USBPOWER_BTN_IGNORE BUTTON_POWER
-#elif CONFIG_KEYPAD == PHILIPS_HDD6330_PAD
-#define USBPOWER_BUTTON BUTTON_LEFT
-#define USBPOWER_BTN_IGNORE BUTTON_POWER
-#elif CONFIG_KEYPAD == SAMSUNG_YH_PAD
-#define USBPOWER_BUTTON BUTTON_RIGHT
-#define USBPOWER_BTN_IGNORE BUTTON_LEFT
-#elif CONFIG_KEYPAD == COWON_D2_PAD
-#define USBPOWER_BUTTON BUTTON_MENU
-#define USBPOWER_BTN_IGNORE BUTTON_MINUS
-#elif CONFIG_KEYPAD == ONDAVX747_PAD
-#define USBPOWER_BUTTON BUTTON_VOL_UP
-#define USBPOWER_BTN_IGNORE BUTTON_VOL_DOWN
-#elif CONFIG_KEYPAD == PBELL_VIBE500_PAD
-#define USBPOWER_BUTTON BUTTON_REC
-#define USBPOWER_BTN_IGNORE BUTTON_POWER
+#else
+#define USBPOWER_BTN_IGNORE 0
+#endif
#endif
-#endif /* HAVE_USB_POWER */
#ifdef HAVE_USBSTACK
/* USB class drivers */
diff --git a/firmware/usb.c b/firmware/usb.c
index aada27dfd9..b8e2b5298c 100644
--- a/firmware/usb.c
+++ b/firmware/usb.c
@@ -341,11 +341,7 @@ static inline void usb_slave_mode(bool on)
#ifdef HAVE_USB_POWER
static inline bool usb_power_button(void)
{
-#if (defined(IRIVER_H10) || defined (IRIVER_H10_5GB)) && !defined(USE_ROCKBOX_USB)
- return (button_status() & ~USBPOWER_BTN_IGNORE) != USBPOWER_BUTTON;
-#else
- return (button_status() & ~USBPOWER_BTN_IGNORE) == USBPOWER_BUTTON;
-#endif
+ return (button_status() & ~USBPOWER_BTN_IGNORE);
}
#ifdef USB_FIREWIRE_HANDLING