forked from len0rd/rockbox
Make private function static on variable CPU frequency targets. Kill it on fixed frequency targets, regaining 1/3 of the waste on archos...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12731 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
e814bb66b3
commit
1b3fc39a65
1 changed files with 8 additions and 2 deletions
|
|
@ -256,7 +256,8 @@ static void button_tick(void)
|
|||
lastbtn = btn & ~(BUTTON_REL | BUTTON_REPEAT);
|
||||
}
|
||||
|
||||
void button_boost(bool state)
|
||||
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
|
||||
static void button_boost(bool state)
|
||||
{
|
||||
static bool boosted = false;
|
||||
|
||||
|
|
@ -271,17 +272,20 @@ void button_boost(bool state)
|
|||
boosted = false;
|
||||
}
|
||||
}
|
||||
#endif /* HAVE_ADJUSTABLE_CPU_FREQ */
|
||||
|
||||
long button_get(bool block)
|
||||
{
|
||||
struct event ev;
|
||||
int pending_count = queue_count(&button_queue);
|
||||
|
||||
|
||||
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
|
||||
/* Control the CPU boost trying to keep queue empty. */
|
||||
if (pending_count == 0)
|
||||
button_boost(false);
|
||||
else if (pending_count > 2)
|
||||
button_boost(true);
|
||||
#endif
|
||||
|
||||
if ( block || pending_count )
|
||||
{
|
||||
|
|
@ -296,11 +300,13 @@ long button_get_w_tmo(int ticks)
|
|||
{
|
||||
struct event ev;
|
||||
|
||||
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
|
||||
/* Be sure to keep boosted state. */
|
||||
if (!queue_empty(&button_queue))
|
||||
return button_get(true);
|
||||
|
||||
button_boost(false);
|
||||
#endif
|
||||
|
||||
queue_wait_w_tmo(&button_queue, &ev, ticks);
|
||||
return (ev.id != SYS_TIMEOUT)? ev.id: BUTTON_NONE;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue