Samsung YP-S3: implement headphones detection

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22099 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Bertrik Sikken 2009-08-01 17:13:47 +00:00
parent 64b227e3ba
commit 0f0bf7b258

View file

@ -48,6 +48,9 @@ void button_init_device(void)
/* P0.5/P1.0 power switch input */
PCON0 &= ~(3 << 10);
PCON1 &= ~0x0000000F;
/* P1.3 headphones detect input */
PCON1 &= ~0x0000F000;
/* P1.5 DATA, P1.6 DRDY inputs (touch key controller) */
PCON1 &= ~0x0FF00000;
@ -144,3 +147,8 @@ bool button_hold(void)
return (PDAT4 & (1 << 3));
}
bool headphones_inserted(void)
{
return ((PDAT1 & (1 << 3)) == 0);
}