From c8dbe047ff1f78bcf97f62167557da15574a5f86 Mon Sep 17 00:00:00 2001 From: Dave Chapman Date: Tue, 26 Sep 2006 11:15:33 +0000 Subject: [PATCH] Patch #6067 from Robert Keevil - enable headphone detection for the remaining ipods (mini 1g/2g and ipod 3g) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11060 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/button.c | 4 ++++ firmware/export/config-ipod3g.h | 3 +++ firmware/export/config-ipodmini.h | 3 +++ firmware/export/config-ipodmini2g.h | 3 +++ 4 files changed, 13 insertions(+) diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c index 0042d9b8eb..20b725c3d4 100644 --- a/firmware/drivers/button.c +++ b/firmware/drivers/button.c @@ -1351,7 +1351,11 @@ void button_clear_queue(void) #ifdef HAVE_HEADPHONE_DETECTION bool headphones_inserted(void) { +#if (CONFIG_KEYPAD==IPOD_3G_PAD) + return (GPIOB_INPUT_VAL & 0x10)?true:false; +#elif (CONFIG_KEYPAD==IPOD_4G_PAD) return (GPIOA_INPUT_VAL & 0x80)?true:false; +#endif } #endif diff --git a/firmware/export/config-ipod3g.h b/firmware/export/config-ipod3g.h index 2f008e17c8..94035069a5 100644 --- a/firmware/export/config-ipod3g.h +++ b/firmware/export/config-ipod3g.h @@ -108,6 +108,9 @@ /* Define this if you have adjustable CPU frequency */ #define HAVE_ADJUSTABLE_CPU_FREQ +/* Define this if you can detect headphones */ +#define HAVE_HEADPHONE_DETECTION + #define BOOTFILE_EXT "ipod" #define BOOTFILE "rockbox." BOOTFILE_EXT diff --git a/firmware/export/config-ipodmini.h b/firmware/export/config-ipodmini.h index f6d51aefaa..f2f96946c9 100644 --- a/firmware/export/config-ipodmini.h +++ b/firmware/export/config-ipodmini.h @@ -109,6 +109,9 @@ /* Define this if you have adjustable CPU frequency */ #define HAVE_ADJUSTABLE_CPU_FREQ +/* Define this if you can detect headphones */ +#define HAVE_HEADPHONE_DETECTION + #define BOOTFILE_EXT "ipod" #define BOOTFILE "rockbox." BOOTFILE_EXT diff --git a/firmware/export/config-ipodmini2g.h b/firmware/export/config-ipodmini2g.h index a7e1a3a5ee..342742ea43 100755 --- a/firmware/export/config-ipodmini2g.h +++ b/firmware/export/config-ipodmini2g.h @@ -112,6 +112,9 @@ /* Define this if you have adjustable CPU frequency */ #define HAVE_ADJUSTABLE_CPU_FREQ +/* Define this if you can detect headphones */ +#define HAVE_HEADPHONE_DETECTION + #define BOOTFILE_EXT "ipod" #define BOOTFILE "rockbox." BOOTFILE_EXT