summaryrefslogtreecommitdiff
path: root/firmware/drivers/button.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers/button.c')
-rw-r--r--firmware/drivers/button.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c
index f934052746..25cdd3d96b 100644
--- a/firmware/drivers/button.c
+++ b/firmware/drivers/button.c
@@ -267,7 +267,6 @@ void button_set_flip(bool flip)
267 } 267 }
268} 268}
269 269
270
271/* 270/*
272 * Get button pressed from hardware 271 * Get button pressed from hardware
273 */ 272 */
@@ -376,12 +375,12 @@ static int button_read(void)
376 if(adc_read(2) < 0x180) 375 if(adc_read(2) < 0x180)
377 btn |= BUTTON_RIGHT; 376 btn |= BUTTON_RIGHT;
378 if(adc_read(3) < 0x180) 377 if(adc_read(3) < 0x180)
379 btn |= BUTTON_PLAY | BUTTON_UP; 378 btn |= BUTTON_PLAY;
380 379
381 if ( !(porta & 0x20) ) 380 if ( !(porta & 0x20) )
382 btn |= BUTTON_ON; 381 btn |= BUTTON_ON;
383 if ( !(porta & 0x800) ) 382 if ( !(porta & 0x800) )
384 btn |= BUTTON_STOP | BUTTON_DOWN; 383 btn |= BUTTON_STOP;
385 384
386 return btn; 385 return btn;
387} 386}
@@ -488,7 +487,7 @@ static int button_read(void)
488 if(adc_read(ADC_BUTTON_OPTION) > 0x200) /* active high */ 487 if(adc_read(ADC_BUTTON_OPTION) > 0x200) /* active high */
489 btn |= BUTTON_MENU; 488 btn |= BUTTON_MENU;
490 if(adc_read(ADC_BUTTON_ONOFF) < 0x120) /* active low */ 489 if(adc_read(ADC_BUTTON_ONOFF) < 0x120) /* active low */
491 btn |= BUTTON_ON; 490 btn |= BUTTON_OFF;
492 491
493 /* Check the 4 direction keys, hard-coded analog limits for now */ 492 /* Check the 4 direction keys, hard-coded analog limits for now */
494 if (data >= 0x2EF) 493 if (data >= 0x2EF)
@@ -496,9 +495,9 @@ static int button_read(void)
496 else if (data >= 0x246) 495 else if (data >= 0x246)
497 btn |= BUTTON_RIGHT; 496 btn |= BUTTON_RIGHT;
498 else if (data >= 0x19D) 497 else if (data >= 0x19D)
499 btn |= BUTTON_PLAY | BUTTON_UP; 498 btn |= BUTTON_UP;
500 else if (data >= 0x0A1) 499 else if (data >= 0x0A1)
501 btn |= BUTTON_STOP | BUTTON_DOWN; 500 btn |= BUTTON_DOWN;
502 501
503 return btn; 502 return btn;
504} 503}