1
0
Fork 0
forked from len0rd/rockbox

iPod Nano 2G: Fix current leak through clickwheel GPIOs when clickwheel is powered down

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29272 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Michael Sparmann 2011-02-10 10:10:27 +00:00
parent e93713ba3c
commit cd8e8419f7

View file

@ -387,7 +387,11 @@ void button_init_device(void)
bool button_hold(void) bool button_hold(void)
{ {
#if CONFIG_CPU==S5L8701 #if CONFIG_CPU==S5L8701
return ((PDAT14 & (1 << 6)) == 0); bool value = (PDAT14 & (1 << 6)) == 0;
if (value)
PCONF = (PCONF & ~0xffff0000) | 0x11110000;
else PCONF = (PCONF & ~0xffff0000) | 0x22220000;
return value;
#elif CONFIG_CPU==S5L8702 #elif CONFIG_CPU==S5L8702
if (USEC_TIMER - holdswitch_last_read > 100000) if (USEC_TIMER - holdswitch_last_read > 100000)
{ {