diff options
Diffstat (limited to 'firmware/target/coldfire/iriver/h300/button-h300.c')
-rw-r--r-- | firmware/target/coldfire/iriver/h300/button-h300.c | 19 |
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 */ | ||
33 | static bool button_scan_on = true; | ||
33 | 34 | ||
34 | void button_init_device(void) | 35 | void 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 | ||
45 | void button_enable_scan(bool enable) | ||
46 | { | ||
47 | button_scan_on = enable; | ||
48 | } | ||
49 | |||
50 | bool button_scan_enabled(void) | ||
51 | { | ||
52 | return button_scan_on; | ||
53 | } | ||
54 | |||
44 | bool button_hold(void) | 55 | bool button_hold(void) |
45 | { | 56 | { |
46 | return (GPIO1_READ & 0x00000002)?true:false; | 57 | return (GPIO1_READ & 0x00000002)?true:false; |
47 | } | 58 | } |
48 | 59 | ||
49 | bool remote_button_hold_only(void) | 60 | bool 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 | ||