1
0
Fork 0
forked from len0rd/rockbox

Added button_get_w_tmo()

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1576 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Linus Nielsen Feltzing 2002-08-07 07:22:44 +00:00
parent 8abcf1bd20
commit 3c67c0a512
2 changed files with 19 additions and 0 deletions

View file

@ -149,6 +149,24 @@ int button_get(bool block)
return BUTTON_NONE;
}
int button_get_w_tmo(int ticks)
{
struct event ev;
unsigned int timeout = current_tick + ticks;
while (TIME_BEFORE( current_tick, timeout ))
{
if(!queue_empty(&button_queue))
{
queue_wait(&button_queue, &ev);
return ev.id;
}
yield();
}
return BUTTON_NONE;
}
int button_set_repeat(int newmask)
{
int oldmask = repeat_mask;