1
0
Fork 0
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:
Jens Arnold 2007-03-11 22:27:35 +00:00
parent e814bb66b3
commit 1b3fc39a65

View file

@ -256,7 +256,8 @@ static void button_tick(void)
lastbtn = btn & ~(BUTTON_REL | BUTTON_REPEAT); 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; static bool boosted = false;
@ -271,17 +272,20 @@ void button_boost(bool state)
boosted = false; boosted = false;
} }
} }
#endif /* HAVE_ADJUSTABLE_CPU_FREQ */
long button_get(bool block) long button_get(bool block)
{ {
struct event ev; struct event ev;
int pending_count = queue_count(&button_queue); int pending_count = queue_count(&button_queue);
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
/* Control the CPU boost trying to keep queue empty. */ /* Control the CPU boost trying to keep queue empty. */
if (pending_count == 0) if (pending_count == 0)
button_boost(false); button_boost(false);
else if (pending_count > 2) else if (pending_count > 2)
button_boost(true); button_boost(true);
#endif
if ( block || pending_count ) if ( block || pending_count )
{ {
@ -296,11 +300,13 @@ long button_get_w_tmo(int ticks)
{ {
struct event ev; struct event ev;
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
/* Be sure to keep boosted state. */ /* Be sure to keep boosted state. */
if (!queue_empty(&button_queue)) if (!queue_empty(&button_queue))
return button_get(true); return button_get(true);
button_boost(false); button_boost(false);
#endif
queue_wait_w_tmo(&button_queue, &ev, ticks); queue_wait_w_tmo(&button_queue, &ev, ticks);
return (ev.id != SYS_TIMEOUT)? ev.id: BUTTON_NONE; return (ev.id != SYS_TIMEOUT)? ev.id: BUTTON_NONE;