summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/drivers/button.c12
-rw-r--r--firmware/target/arm/ipod/3g/button-3g.c5
-rw-r--r--firmware/target/arm/ipod/button-clickwheel.c5
-rw-r--r--firmware/target/arm/ipod/button-mini1g.c5
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;
+}