summaryrefslogtreecommitdiff
path: root/firmware/target/coldfire/iaudio/x5/button-x5.c
diff options
context:
space:
mode:
authorRani Hod <raenye@gmail.com>2006-08-08 22:03:56 +0000
committerRani Hod <raenye@gmail.com>2006-08-08 22:03:56 +0000
commitc9f59e6f75bcfa25a563fedd77bfa77b3617f133 (patch)
treeceff51afb679acb2935ed18072384819abf4281e /firmware/target/coldfire/iaudio/x5/button-x5.c
parentf8866a3a9c3a12b72e87ae96445eca1b52ed23fb (diff)
downloadrockbox-c9f59e6f75bcfa25a563fedd77bfa77b3617f133.tar.gz
rockbox-c9f59e6f75bcfa25a563fedd77bfa77b3617f133.zip
Accepted FS #5772 by Michael Sevakis
1. X5 lcd sleep 2. #define HAVE_LCD_ENABLE 3. add "backlight (on hold switch)" setting, adapted from FS #5735 Note that the while(1) yield ==> asm("halt") part is NOT commited here, I prefer it would be discussed separately. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10489 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/coldfire/iaudio/x5/button-x5.c')
-rwxr-xr-xfirmware/target/coldfire/iaudio/x5/button-x5.c21
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;