forked from len0rd/rockbox
Few Fuze/e200v2 button fixes. Don't read the scrollwheel when the hold button is active and rename a variable to describe better what it is for.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20701 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
c48f4c6be4
commit
42f5973177
5 changed files with 27 additions and 10 deletions
|
|
@ -55,7 +55,7 @@ static void scrollwheel(short dbop_din)
|
|||
unsigned btn = BUTTON_NONE;
|
||||
/* old wheel values */
|
||||
static unsigned old_wheel_value = 0;
|
||||
static unsigned wheel_repeat = BUTTON_NONE;
|
||||
static unsigned old_btn = BUTTON_NONE;
|
||||
|
||||
/* getting BUTTON_REPEAT works like this: Remember when the btn value was
|
||||
* posted to the button_queue last, and if it was recent enough, generate
|
||||
|
|
@ -77,7 +77,13 @@ static void scrollwheel(short dbop_din)
|
|||
{ 2, 0, 3, 1 }, /* Clockwise rotation */
|
||||
{ 1, 3, 0, 2 }, /* Counter-clockwise */
|
||||
};
|
||||
|
||||
|
||||
if(hold_button)
|
||||
{
|
||||
repeat = counter = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
wheel_value = dbop_din & (1<<13|1<<14);
|
||||
wheel_value >>= 13;
|
||||
|
||||
|
|
@ -88,10 +94,10 @@ static void scrollwheel(short dbop_din)
|
|||
|
||||
if (btn != BUTTON_NONE)
|
||||
{
|
||||
if (btn != wheel_repeat)
|
||||
if (btn != old_btn)
|
||||
{
|
||||
/* direction reversals nullify repeats */
|
||||
wheel_repeat = btn;
|
||||
old_btn = btn;
|
||||
repeat = counter = 0;
|
||||
}
|
||||
if (btn != BUTTON_NONE)
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
bool button_hold(void);
|
||||
void button_init_device(void);
|
||||
int button_read_device(void);
|
||||
short button_read_dbop(void);
|
||||
|
||||
/* Sandisk Sansa E200 button codes */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue