From 5c6f32af9563764cf7b3f9529956ac27808246cf Mon Sep 17 00:00:00 2001 From: Daniel Ankers Date: Sat, 7 Oct 2006 12:19:34 +0000 Subject: Move iPod headphone detection into target tree (FS#6131 by Robert Keevil) and fix detection on 3G iPod git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11143 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/button.c | 12 ------------ firmware/target/arm/ipod/3g/button-3g.c | 5 +++++ firmware/target/arm/ipod/button-clickwheel.c | 5 +++++ firmware/target/arm/ipod/button-mini1g.c | 5 +++++ 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c index 8acae01006..cc9f0fa18d 100644 --- a/firmware/drivers/button.c +++ b/firmware/drivers/button.c @@ -951,15 +951,3 @@ void button_clear_queue(void) { queue_clear(&button_queue); } - -#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/target/arm/ipod/3g/button-3g.c b/firmware/target/arm/ipod/3g/button-3g.c index 7244dd597b..25afd42095 100644 --- a/firmware/target/arm/ipod/3g/button-3g.c +++ b/firmware/target/arm/ipod/3g/button-3g.c @@ -187,3 +187,8 @@ bool button_hold(void) { return (GPIOA_INPUT_VAL & 0x20)?false:true; } + +bool headphones_inserted(void) +{ + return (GPIOC_INPUT_VAL & 0x1)?true:false; +} diff --git a/firmware/target/arm/ipod/button-clickwheel.c b/firmware/target/arm/ipod/button-clickwheel.c index 4c536343c4..6cac037155 100644 --- a/firmware/target/arm/ipod/button-clickwheel.c +++ b/firmware/target/arm/ipod/button-clickwheel.c @@ -235,3 +235,8 @@ bool button_hold(void) { return (GPIOA_INPUT_VAL & 0x20)?false:true; } + +bool headphones_inserted(void) +{ + return (GPIOA_INPUT_VAL & 0x80)?true:false; +} diff --git a/firmware/target/arm/ipod/button-mini1g.c b/firmware/target/arm/ipod/button-mini1g.c index 07885bc159..f979991141 100644 --- a/firmware/target/arm/ipod/button-mini1g.c +++ b/firmware/target/arm/ipod/button-mini1g.c @@ -215,3 +215,8 @@ bool button_hold(void) { return (GPIOA_INPUT_VAL & 0x20)?false:true; } + +bool headphones_inserted(void) +{ + return (GPIOA_INPUT_VAL & 0x80)?true:false; +} -- cgit v1.2.3