summaryrefslogtreecommitdiff
path: root/firmware/target/coldfire/iaudio/x5/button-x5.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/coldfire/iaudio/x5/button-x5.c')
-rwxr-xr-xfirmware/target/coldfire/iaudio/x5/button-x5.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/firmware/target/coldfire/iaudio/x5/button-x5.c b/firmware/target/coldfire/iaudio/x5/button-x5.c
index 287ee0e92b..84d1dbc7d8 100755
--- a/firmware/target/coldfire/iaudio/x5/button-x5.c
+++ b/firmware/target/coldfire/iaudio/x5/button-x5.c
@@ -41,7 +41,7 @@ bool button_hold(void)
41 41
42bool remote_button_hold(void) 42bool remote_button_hold(void)
43{ 43{
44 return false; /* TODO X5 */ 44 return adc_scan(ADC_REMOTE) < 0x17;
45} 45}
46 46
47int button_read_device(void) 47int button_read_device(void)
@@ -51,6 +51,7 @@ int button_read_device(void)
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 bool hold_button_old;
54 bool remote_hold_button_old;
54 55
55 /* normal buttons */ 56 /* normal buttons */
56 hold_button_old = hold_button; 57 hold_button_old = hold_button;
@@ -90,14 +91,15 @@ int button_read_device(void)
90 } 91 }
91 92
92 /* remote buttons */ 93 /* remote buttons */
93 94 remote_hold_button_old = remote_hold_button;
94 /* TODO: add light handling for the remote */
95
96 remote_hold_button = remote_button_hold();
97 95
98 data = adc_scan(ADC_REMOTE); 96 data = adc_scan(ADC_REMOTE);
99 if(data < 0x17) 97 remote_hold_button = data < 0x17;
100 remote_hold_button = true; 98
99#ifndef BOOTLOADER
100 if (remote_hold_button != remote_hold_button_old)
101 remote_backlight_hold_changed(remote_hold_button);
102#endif
101 103
102 if(!remote_hold_button) 104 if(!remote_hold_button)
103 { 105 {