From 3c362fa8c6b9cd55f2c1e514c426b990be779563 Mon Sep 17 00:00:00 2001 From: Dave Chapman Date: Sat, 10 Oct 2009 15:37:05 +0000 Subject: Nano2G - implement "Pause on headphone unplug" feature git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23072 a1c6a512-1295-4272-9138-f99709370657 --- firmware/export/config-ipodnano2g.h | 3 +++ firmware/target/arm/ipod/button-clickwheel.c | 5 +++++ 2 files changed, 8 insertions(+) (limited to 'firmware') diff --git a/firmware/export/config-ipodnano2g.h b/firmware/export/config-ipodnano2g.h index f94584b3cf..e8f2c1935d 100644 --- a/firmware/export/config-ipodnano2g.h +++ b/firmware/export/config-ipodnano2g.h @@ -56,6 +56,9 @@ /* define this if you would like tagcache to build on this target */ #define HAVE_TAGCACHE +/* Define this if you can detect headphones */ +#define HAVE_HEADPHONE_DETECTION + /* define this if you have a flash memory storage */ #define HAVE_FLASH_STORAGE diff --git a/firmware/target/arm/ipod/button-clickwheel.c b/firmware/target/arm/ipod/button-clickwheel.c index 001f599878..bdcdd655f5 100644 --- a/firmware/target/arm/ipod/button-clickwheel.c +++ b/firmware/target/arm/ipod/button-clickwheel.c @@ -352,6 +352,11 @@ bool button_hold(void) { return ((PDAT14 & (1 << 6)) == 0); } + +bool headphones_inserted(void) +{ + return ((PDAT14 & (1 << 5)) != 0); +} #endif /* -- cgit v1.2.3