1
0
Fork 0
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:
Miika Pekkarinen 2007-03-11 10:52:36 +00:00
parent 408dfd65ad
commit 2eefb5acb8
5 changed files with 222 additions and 82 deletions

View file

@ -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;