From a6a10feace21bfc4ccc55a72c6e9386b465f894b Mon Sep 17 00:00:00 2001 From: jethead71 Date: Tue, 11 Jan 2011 04:51:24 +0000 Subject: [PATCH] SA9200: Implement the backlight hold handling. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29030 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/philips/sa9200/button-sa9200.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/firmware/target/arm/philips/sa9200/button-sa9200.c b/firmware/target/arm/philips/sa9200/button-sa9200.c index 9fab3d406..e3d569f42 100644 --- a/firmware/target/arm/philips/sa9200/button-sa9200.c +++ b/firmware/target/arm/philips/sa9200/button-sa9200.c @@ -30,6 +30,8 @@ static int int_btn = BUTTON_NONE; #ifndef BOOTLOADER +static bool hold_button_old = false; + void button_init_device(void) { /* The touchpad is powered on and initialized in power-sa9200.c @@ -72,8 +74,10 @@ void button_int(void) } } #else -void button_init_device(void){} -#endif /* bootloader */ +void button_init_device(void) +{ +} +#endif /* BOOTLOADER */ bool button_hold(void) { @@ -86,8 +90,18 @@ bool button_hold(void) int button_read_device(void) { int btn = int_btn; + bool hold = !(GPIOL_INPUT_VAL & 0x40); + +#ifndef BOOTLOADER + /* Backlight hold handling */ + if (hold != hold_button_old) + { + hold_button_old = hold; + backlight_hold_changed(hold); + } +#endif - if (button_hold()) + if (hold) return BUTTON_NONE; if (!(GPIOB_INPUT_VAL & 0x20)) btn |= BUTTON_POWER; -- 2.11.4.GIT