From c9f59e6f75bcfa25a563fedd77bfa77b3617f133 Mon Sep 17 00:00:00 2001 From: Rani Hod Date: Tue, 8 Aug 2006 22:03:56 +0000 Subject: 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 --- firmware/target/coldfire/iaudio/x5/button-x5.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'firmware/target/coldfire/iaudio/x5/button-x5.c') 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) int btn = BUTTON_NONE; static bool hold_button = false; static bool remote_hold_button = false; + bool hold_button_old; - /* backlight handling */ - if (hold_button && !button_hold()) - { - backlight_on(); - } - /* TODO: add light handling for the remote */ - + /* normal buttons */ + hold_button_old = hold_button; hold_button = button_hold(); - remote_hold_button = remote_button_hold(); - /* normal buttons */ + /* give BL notice if HB state chaged */ + if (hold_button != hold_button_old) + backlight_hold_changed(hold_button); + if (!hold_button) { data = adc_scan(ADC_BUTTONS); @@ -90,6 +88,11 @@ int button_read_device(void) } /* remote buttons */ + + /* TODO: add light handling for the remote */ + + remote_hold_button = remote_button_hold(); + data = adc_scan(ADC_REMOTE); if(data < 0x17) remote_hold_button = true; -- cgit v1.2.3