forked from len0rd/rockbox
Make the clickwheel driver stop buffering events if Rockbox is too busy
to handle them. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8650 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
1c366425f9
commit
1f8529708b
1 changed files with 13 additions and 2 deletions
|
@ -174,9 +174,20 @@ static int ipod_4g_button_read(void)
|
||||||
old_wheel_value = new_wheel_value;
|
old_wheel_value = new_wheel_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wheel_keycode != BUTTON_NONE)
|
if (wheel_keycode != BUTTON_NONE) {
|
||||||
|
/* When you use the clickwheel, the queue should
|
||||||
|
usually have no other events in it, so we check if
|
||||||
|
it's empty to see whether pending clickwheel events
|
||||||
|
have been handled. This way, Rockbox will stop
|
||||||
|
responding to the clickwheel if it doesn't have time
|
||||||
|
to handle the events immediately.
|
||||||
|
Can also implement queue_peek() to do this in a
|
||||||
|
cleaner way.
|
||||||
|
*/
|
||||||
|
if (queue_empty(&button_queue))
|
||||||
queue_post(&button_queue, wheel_keycode, NULL);
|
queue_post(&button_queue, wheel_keycode, NULL);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
old_wheel_value = new_wheel_value;
|
old_wheel_value = new_wheel_value;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue