summaryrefslogtreecommitdiff
path: root/firmware/drivers/button.c
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2007-03-11 22:27:35 +0000
committerJens Arnold <amiconn@rockbox.org>2007-03-11 22:27:35 +0000
commit1b3fc39a658644b85800a900ab7c56303d163aa9 (patch)
tree38b0ea1a3097dce73b0aaf1823f76daa00d99113 /firmware/drivers/button.c
parente814bb66b3e826bc04ecbf68a3126aa17c363655 (diff)
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
Diffstat (limited to 'firmware/drivers/button.c')
-rw-r--r--firmware/drivers/button.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c
index 7c5858a1e3..dcf77ff661 100644
--- a/firmware/drivers/button.c
+++ b/firmware/drivers/button.c
@@ -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;