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;