summaryrefslogtreecommitdiff
path: root/firmware/target/coldfire/iriver/h300/button-h300.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/coldfire/iriver/h300/button-h300.c')
-rw-r--r--firmware/target/coldfire/iriver/h300/button-h300.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/firmware/target/coldfire/iriver/h300/button-h300.c b/firmware/target/coldfire/iriver/h300/button-h300.c
index 80210b6c19..bcd954df8a 100644
--- a/firmware/target/coldfire/iriver/h300/button-h300.c
+++ b/firmware/target/coldfire/iriver/h300/button-h300.c
@@ -27,9 +27,10 @@
27#include "backlight.h" 27#include "backlight.h"
28#include "adc.h" 28#include "adc.h"
29#include "system.h" 29#include "system.h"
30#ifdef HAVE_REMOTE_LCD
31#include "lcd-remote.h" 30#include "lcd-remote.h"
32#endif 31
32/* have buttons scan by default */
33static bool button_scan_on = true;
33 34
34void button_init_device(void) 35void button_init_device(void)
35{ 36{
@@ -41,13 +42,23 @@ void button_init_device(void)
41 GPIO1_FUNCTION |= 0x00100062; 42 GPIO1_FUNCTION |= 0x00100062;
42} 43}
43 44
45void button_enable_scan(bool enable)
46{
47 button_scan_on = enable;
48}
49
50bool button_scan_enabled(void)
51{
52 return button_scan_on;
53}
54
44bool button_hold(void) 55bool button_hold(void)
45{ 56{
46 return (GPIO1_READ & 0x00000002)?true:false; 57 return (GPIO1_READ & 0x00000002)?true:false;
47} 58}
48 59
49bool remote_button_hold_only(void) 60bool remote_button_hold_only(void)
50{ 61{
51 if(remote_type() == REMOTETYPE_H300_NONLCD) 62 if(remote_type() == REMOTETYPE_H300_NONLCD)
52 return adc_scan(ADC_REMOTE)<0x0d; /* hold should be 0x00 */ 63 return adc_scan(ADC_REMOTE)<0x0d; /* hold should be 0x00 */
53 else 64 else
@@ -88,7 +99,7 @@ int button_read_device(void)
88 backlight_hold_changed(hold_button); 99 backlight_hold_changed(hold_button);
89#endif 100#endif
90 101
91 if (!hold_button) 102 if (button_scan_on && !hold_button)
92 { 103 {
93 data = adc_scan(ADC_BUTTONS); 104 data = adc_scan(ADC_BUTTONS);
94 105