From c45ae3edf2764274833b97bb1fac3d372f2c1c60 Mon Sep 17 00:00:00 2001 From: Marcoen Hirschberg Date: Wed, 17 Jan 2007 20:24:06 +0000 Subject: fix backlight on hold key setting git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12055 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/gigabeat/meg-fx/button-meg-fx.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'firmware/target/arm/gigabeat') diff --git a/firmware/target/arm/gigabeat/meg-fx/button-meg-fx.c b/firmware/target/arm/gigabeat/meg-fx/button-meg-fx.c index 117e1114af..71d45c385c 100644 --- a/firmware/target/arm/gigabeat/meg-fx/button-meg-fx.c +++ b/firmware/target/arm/gigabeat/meg-fx/button-meg-fx.c @@ -29,6 +29,7 @@ #include "backlight-target.h" static bool headphones_detect; +static bool hold_button = false; static int const remote_buttons[] = { @@ -68,6 +69,17 @@ int button_read_device(void) static int lastbutton; unsigned short remote_adc; int btn = BUTTON_NONE; + bool hold_button_old; + + /* normal buttons */ + hold_button_old = hold_button; + hold_button = button_hold(); + +#ifndef BOOTLOADER + /* give BL notice if HB state chaged */ + if (hold_button != hold_button_old) + backlight_hold_changed(hold_button); +#endif /* See header for ADC values when remote control buttons are pressed */ /* Only one button can be sensed at a time on the remote. */ @@ -82,7 +94,7 @@ int button_read_device(void) } /* Check for hold first - exit if asserted with no button pressed */ - if (button_hold()) + if (hold_button) return btn; /* the side buttons - Check before doing all of the work on each bit */ -- cgit v1.2.3