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