1
0
Fork 0
forked from len0rd/rockbox

most of UI sim patch 708460 from Magnus Holmgren, except the bitmap removal

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3571 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jörg Hohensohn 2003-04-19 13:15:33 +00:00
parent 6d522179dc
commit c6fb565dd9
7 changed files with 279 additions and 98 deletions

View file

@ -56,6 +56,25 @@ void queue_wait(struct event_queue *q, struct event *ev)
*ev = q->events[(q->read++) & QUEUE_LENGTH_MASK];
}
void queue_wait_w_tmo(struct event_queue *q, struct event *ev, int ticks)
{
unsigned int timeout = current_tick + ticks;
while(q->read == q->write && TIME_BEFORE( current_tick, timeout ))
{
sleep(1);
}
if(q->read != q->write)
{
*ev = q->events[(q->read++) & QUEUE_LENGTH_MASK];
}
else
{
ev->id = SYS_TIMEOUT;
}
}
void queue_post(struct event_queue *q, int id, void *data)
{
int wr;