summaryrefslogtreecommitdiff
path: root/firmware/target/arm
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm')
-rw-r--r--firmware/target/arm/ipod/button-1g-3g.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/firmware/target/arm/ipod/button-1g-3g.c b/firmware/target/arm/ipod/button-1g-3g.c
index be02f873bb..2aa65bb2c0 100644
--- a/firmware/target/arm/ipod/button-1g-3g.c
+++ b/firmware/target/arm/ipod/button-1g-3g.c
@@ -250,5 +250,21 @@ bool button_hold(void)
250 250
251bool headphones_inserted(void) 251bool headphones_inserted(void)
252{ 252{
253#ifdef IPOD_1G2G
254 if ((IPOD_HW_REVISION >> 16) == 2)
255 {
256 /* 2G uses GPIO B bit 0 */
257 return (GPIOB_INPUT_VAL & 0x1)?true:false;
258 }
259 else
260 {
261 /* 1G has no headphone detection, so fake insertion */
262 return (true);
263 }
264#else
265 /* 3G uses GPIO C bit 0 */
253 return (GPIOC_INPUT_VAL & 0x1)?true:false; 266 return (GPIOC_INPUT_VAL & 0x1)?true:false;
267#endif
254} 268}
269
270