1
0
Fork 0
forked from len0rd/rockbox

Ondio levels adjusted, use ADC channel names

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5074 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jörg Hohensohn 2004-09-15 07:03:11 +00:00
parent 3f7c508a09
commit 73792b474e

View file

@ -483,19 +483,19 @@ void button_init(void)
static int button_read(void)
{
int btn = BUTTON_NONE;
int data = adc_read(4);
int data = adc_read(ADC_BUTTON_ROW1);
if(adc_read(2) > 0x200) /* active high */
if(adc_read(ADC_BUTTON_OPTION) > 0x200) /* active high */
btn |= BUTTON_MENU;
if(adc_read(3) < 0x200) /* active low */
if(adc_read(ADC_BUTTON_ONOFF) < 0x120) /* active low */
btn |= BUTTON_ON;
/* Check the 4 direction keys, hard-coded analog limits for now */
if (data >= 0x2E5)
if (data >= 0x2EF)
btn |= BUTTON_LEFT;
else if (data >= 0x23F)
else if (data >= 0x246)
btn |= BUTTON_RIGHT;
else if (data >= 0x197)
else if (data >= 0x19D)
btn |= BUTTON_PLAY | BUTTON_UP;
else if (data >= 0x0A1)
btn |= BUTTON_STOP | BUTTON_DOWN;