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:
parent
8abcf1bd20
commit
3c67c0a512
2 changed files with 19 additions and 0 deletions
|
|
@ -149,6 +149,24 @@ int button_get(bool block)
|
||||||
return BUTTON_NONE;
|
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 button_set_repeat(int newmask)
|
||||||
{
|
{
|
||||||
int oldmask = repeat_mask;
|
int oldmask = repeat_mask;
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ extern struct event_queue button_queue;
|
||||||
|
|
||||||
void button_init (void);
|
void button_init (void);
|
||||||
int button_get (bool block);
|
int button_get (bool block);
|
||||||
|
int button_get_w_tmo(int ticks);
|
||||||
int button_set_repeat(int newmask);
|
int button_set_repeat(int newmask);
|
||||||
int button_set_release(int newmask);
|
int button_set_release(int newmask);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue