forked from len0rd/rockbox
Optimized the gui list code performance, including automatic frame dropping and cpu boosting when button events are getting queued. Improved scrollwheel acceleration code is needed to notice a real change.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12721 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
408dfd65ad
commit
2eefb5acb8
5 changed files with 222 additions and 82 deletions
|
@ -374,6 +374,27 @@ void queue_remove_from_head(struct event_queue *q, long id)
|
|||
set_irq_level(oldlevel);
|
||||
}
|
||||
|
||||
/**
|
||||
* The number of events waiting in the queue.
|
||||
*
|
||||
* @param struct of event_queue
|
||||
* @return number of events in the queue
|
||||
*/
|
||||
int queue_count(const struct event_queue *q)
|
||||
{
|
||||
int oldlevel = set_irq_level(HIGHEST_IRQ_LEVEL);
|
||||
int result = 0;
|
||||
|
||||
if (q->read <= q->write)
|
||||
result = q->write - q->read;
|
||||
else
|
||||
result = QUEUE_LENGTH - (q->read - q->write);
|
||||
|
||||
set_irq_level(oldlevel);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
int queue_broadcast(long id, intptr_t data)
|
||||
{
|
||||
int i;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue