diff options
author | Thom Johansen <thomj@rockbox.org> | 2006-02-10 14:39:19 +0000 |
---|---|---|
committer | Thom Johansen <thomj@rockbox.org> | 2006-02-10 14:39:19 +0000 |
commit | 1f8529708bd65c87f601d5b425f44755da4c237c (patch) | |
tree | 50d7629ab7719cfd240c1d22a915916364702665 /firmware | |
parent | 1c366425f99d4c9f06705ed71753b1b1d6067b71 (diff) | |
download | rockbox-1f8529708bd65c87f601d5b425f44755da4c237c.tar.gz rockbox-1f8529708bd65c87f601d5b425f44755da4c237c.zip |
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
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/drivers/button.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c index 5ba45bb460..db1033dc82 100644 --- a/firmware/drivers/button.c +++ b/firmware/drivers/button.c | |||
@@ -174,8 +174,19 @@ static int ipod_4g_button_read(void) | |||
174 | old_wheel_value = new_wheel_value; | 174 | old_wheel_value = new_wheel_value; |
175 | } | 175 | } |
176 | 176 | ||
177 | if (wheel_keycode != BUTTON_NONE) | 177 | if (wheel_keycode != BUTTON_NONE) { |
178 | queue_post(&button_queue, wheel_keycode, NULL); | 178 | /* When you use the clickwheel, the queue should |
179 | usually have no other events in it, so we check if | ||
180 | it's empty to see whether pending clickwheel events | ||
181 | have been handled. This way, Rockbox will stop | ||
182 | responding to the clickwheel if it doesn't have time | ||
183 | to handle the events immediately. | ||
184 | Can also implement queue_peek() to do this in a | ||
185 | cleaner way. | ||
186 | */ | ||
187 | if (queue_empty(&button_queue)) | ||
188 | queue_post(&button_queue, wheel_keycode, NULL); | ||
189 | } | ||
179 | } | 190 | } |
180 | else { | 191 | else { |
181 | old_wheel_value = new_wheel_value; | 192 | old_wheel_value = new_wheel_value; |