forked from len0rd/rockbox
Fix non-hold button and headphone detection target sims.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22800 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
ca85c401f5
commit
d5797a6e93
3 changed files with 8 additions and 3 deletions
|
@ -87,7 +87,7 @@ static int button_read(void);
|
||||||
#ifdef HAVE_TOUCHSCREEN
|
#ifdef HAVE_TOUCHSCREEN
|
||||||
static int last_touchscreen_touch;
|
static int last_touchscreen_touch;
|
||||||
#endif
|
#endif
|
||||||
#if defined(HAVE_HEADPHONE_DETECTION) && !defined(SIMULATOR)
|
#if defined(HAVE_HEADPHONE_DETECTION)
|
||||||
static struct timeout hp_detect_timeout; /* Debouncer for headphone plug/unplug */
|
static struct timeout hp_detect_timeout; /* Debouncer for headphone plug/unplug */
|
||||||
/* This callback can be used for many different functions if needed -
|
/* This callback can be used for many different functions if needed -
|
||||||
just check to which object tmo points */
|
just check to which object tmo points */
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "button-target.h"
|
#include "button-target.h"
|
||||||
|
|
||||||
#define HAS_BUTTON_HOLD
|
|
||||||
#undef HAVE_LCD_FLIP
|
#undef HAVE_LCD_FLIP
|
||||||
|
|
||||||
#undef button_init_device
|
#undef button_init_device
|
||||||
|
|
|
@ -1216,17 +1216,23 @@ int button_read_device(int* data)
|
||||||
int button_read_device(void)
|
int button_read_device(void)
|
||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
static int hold_button_old = false;
|
|
||||||
|
#ifdef HAS_BUTTON_HOLD
|
||||||
int hold_button = button_hold();
|
int hold_button = button_hold();
|
||||||
|
|
||||||
|
#ifdef HAVE_BACKLIGHT
|
||||||
/* light handling */
|
/* light handling */
|
||||||
|
static int hold_button_old = false;
|
||||||
if (hold_button != hold_button_old)
|
if (hold_button != hold_button_old)
|
||||||
{
|
{
|
||||||
hold_button_old = hold_button;
|
hold_button_old = hold_button;
|
||||||
backlight_hold_changed(hold_button);
|
backlight_hold_changed(hold_button);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (hold_button)
|
if (hold_button)
|
||||||
return BUTTON_NONE;
|
return BUTTON_NONE;
|
||||||
|
#endif
|
||||||
|
|
||||||
return btn;
|
return btn;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue