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.c51
1 files changed, 1 insertions, 50 deletions
diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c
index 3ae4893290..1cdd8995fe 100644
--- a/firmware/drivers/button.c
+++ b/firmware/drivers/button.c
@@ -75,10 +75,7 @@ static bool remote_filter_first_keypress;
75#define REPEAT_INTERVAL_FINISH 5 75#define REPEAT_INTERVAL_FINISH 5
76 76
77/* the power-off button and number of repeated keys before shutting off */ 77/* the power-off button and number of repeated keys before shutting off */
78#if (CONFIG_KEYPAD == IRIVER_IFP7XX_PAD) 78#if !defined(TARGET_TREE)
79#define POWEROFF_BUTTON BUTTON_PLAY
80#define POWEROFF_COUNT 40
81#elif !defined(TARGET_TREE)
82#define POWEROFF_BUTTON BUTTON_OFF 79#define POWEROFF_BUTTON BUTTON_OFF
83#define POWEROFF_COUNT 10 80#define POWEROFF_COUNT 10
84#endif 81#endif
@@ -506,46 +503,6 @@ static int button_read(void)
506 || (CONFIG_KEYPAD == IRIVER_H300_PAD) 503 || (CONFIG_KEYPAD == IRIVER_H300_PAD)
507 btn = button_read_device(); /* temp untill TARGET_TREE is defined */ 504 btn = button_read_device(); /* temp untill TARGET_TREE is defined */
508 505
509#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
510 static bool hold_button = false;
511 bool hold_button_old;
512
513 /* normal buttons */
514 hold_button_old = hold_button;
515 hold_button = button_hold();
516
517 if (hold_button != hold_button_old)
518 backlight_hold_changed(hold_button);
519
520 if (!button_hold())
521 {
522 data = adc_read(ADC_BUTTONS);
523 if (data < 0x35c)
524 {
525 if (data < 0x151)
526 if (data < 0xc7)
527 if (data < 0x41)
528 btn = BUTTON_LEFT;
529 else
530 btn = BUTTON_RIGHT;
531 else
532 btn = BUTTON_SELECT;
533 else
534 if (data < 0x268)
535 if (data < 0x1d7)
536 btn = BUTTON_UP;
537 else
538 btn = BUTTON_DOWN;
539 else
540 if (data < 0x2f9)
541 btn = BUTTON_EQ;
542 else
543 btn = BUTTON_MODE;
544 }
545
546 if (adc_read(ADC_BUTTON_PLAY) < 0x64)
547 btn |= BUTTON_PLAY;
548 }
549 506
550#elif CONFIG_KEYPAD == RECORDER_PAD 507#elif CONFIG_KEYPAD == RECORDER_PAD
551#ifndef HAVE_FMADC 508#ifndef HAVE_FMADC
@@ -703,12 +660,6 @@ static int button_read(void)
703 return retval; 660 return retval;
704} 661}
705 662
706#if CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
707bool button_hold(void)
708{
709 return (GPIO5_READ & 4) ? false : true;
710}
711#endif
712 663
713int button_status(void) 664int button_status(void)
714{ 665{