1
0
Fork 0
forked from len0rd/rockbox

Enable status bar in usb mode.

Moved usb_display_info() to screens.c
Added functions queue_wait_w_tmo() and usb_wait_for_disconnect_w_tmo().


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2574 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Markus Braun 2002-10-11 08:56:23 +00:00
parent 8232306d80
commit 88098be7e3
9 changed files with 122 additions and 67 deletions

View file

@ -102,6 +102,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 ))
{
switch_thread();
}
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;