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:
parent
8232306d80
commit
88098be7e3
9 changed files with 122 additions and 67 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue