diff options
Diffstat (limited to 'firmware/target/coldfire/iaudio/x5/button-x5.c')
-rwxr-xr-x | firmware/target/coldfire/iaudio/x5/button-x5.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/firmware/target/coldfire/iaudio/x5/button-x5.c b/firmware/target/coldfire/iaudio/x5/button-x5.c index 07bc7bf3f7..b44909a975 100755 --- a/firmware/target/coldfire/iaudio/x5/button-x5.c +++ b/firmware/target/coldfire/iaudio/x5/button-x5.c | |||
@@ -50,18 +50,16 @@ int button_read_device(void) | |||
50 | int btn = BUTTON_NONE; | 50 | int btn = BUTTON_NONE; |
51 | static bool hold_button = false; | 51 | static bool hold_button = false; |
52 | static bool remote_hold_button = false; | 52 | static bool remote_hold_button = false; |
53 | bool hold_button_old; | ||
53 | 54 | ||
54 | /* backlight handling */ | 55 | /* normal buttons */ |
55 | if (hold_button && !button_hold()) | 56 | hold_button_old = hold_button; |
56 | { | ||
57 | backlight_on(); | ||
58 | } | ||
59 | /* TODO: add light handling for the remote */ | ||
60 | |||
61 | hold_button = button_hold(); | 57 | hold_button = button_hold(); |
62 | remote_hold_button = remote_button_hold(); | ||
63 | 58 | ||
64 | /* normal buttons */ | 59 | /* give BL notice if HB state chaged */ |
60 | if (hold_button != hold_button_old) | ||
61 | backlight_hold_changed(hold_button); | ||
62 | |||
65 | if (!hold_button) | 63 | if (!hold_button) |
66 | { | 64 | { |
67 | data = adc_scan(ADC_BUTTONS); | 65 | data = adc_scan(ADC_BUTTONS); |
@@ -90,6 +88,11 @@ int button_read_device(void) | |||
90 | } | 88 | } |
91 | 89 | ||
92 | /* remote buttons */ | 90 | /* remote buttons */ |
91 | |||
92 | /* TODO: add light handling for the remote */ | ||
93 | |||
94 | remote_hold_button = remote_button_hold(); | ||
95 | |||
93 | data = adc_scan(ADC_REMOTE); | 96 | data = adc_scan(ADC_REMOTE); |
94 | if(data < 0x17) | 97 | if(data < 0x17) |
95 | remote_hold_button = true; | 98 | remote_hold_button = true; |