summaryrefslogtreecommitdiffstats
path: root/apps/action.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2017-01-21 08:09:48 -0500
committerMichael Sevakis <jethead71@rockbox.org>2017-01-21 12:03:23 -0500
commitc6299b268da0599c2bbce3e71efb5398ffd0a808 (patch)
tree6eb097f0d66b27f8524b5471d56e5460cdc4a0a5 /apps/action.c
parent15e1f592de7d91b208b83425d3c8b12496b30b89 (diff)
downloadrockbox-c6299b268da0599c2bbce3e71efb5398ffd0a808.tar.gz
rockbox-c6299b268da0599c2bbce3e71efb5398ffd0a808.tar.bz2
rockbox-c6299b268da0599c2bbce3e71efb5398ffd0a808.zip
action.c must desist in calling set_cpu_frequency from a tick
The function is neither reentrant nor ISR callable. Instead of using a ticked-based timeout, have the button driver provide the unboost after a delay when waiting for a button. HAVE_GUI_BOOST gets immediate boost after dequeuing any message, otherwise the queue has to have at least three messages waiting for it to trigger a boost-- essentially the behavior that existed but now combined in one place. Change-Id: I1d924702840f56a1a65abe41fa92b4e753c4e75a
Diffstat (limited to 'apps/action.c')
-rw-r--r--apps/action.c50
1 files changed, 1 insertions, 49 deletions
diff --git a/apps/action.c b/apps/action.c
index 286d4f39b3..30277dc3a6 100644
--- a/apps/action.c
+++ b/apps/action.c
@@ -181,38 +181,6 @@ static inline int get_next_context(const struct button_mapping *items, int i)
items[i].action_code;
}
-#if defined(HAVE_GUI_BOOST) && defined(HAVE_ADJUSTABLE_CPU_FREQ)
-
-/* Timeout for gui boost in seconds. */
-#define GUI_BOOST_TIMEOUT (HZ)
-
-/* Helper function which is called to boost / unboost CPU. This function
- * avoids to increase boost_count with each call of gui_boost(). */
-static void gui_boost(bool want_to_boost)
-{
- static bool boosted = false;
-
- if (want_to_boost && !boosted)
- {
- cpu_boost(true);
- boosted = true;
- }
- else if (!want_to_boost && boosted)
- {
- cpu_boost(false);
- boosted = false;
- }
-}
-
-/* gui_unboost_callback() is called GUI_BOOST_TIMEOUT seconds after the
- * last wheel scrolling event. */
-static int gui_unboost_callback(struct timeout *tmo)
-{
- (void)tmo;
- gui_boost(false);
- return 0;
-}
-#endif
/*
* int get_action_worker(int context, int timeout, bool *is_pre_button,
@@ -242,23 +210,7 @@ static int get_action_worker(int context, int timeout, bool *is_pre_button,
send_event(GUI_EVENT_ACTIONUPDATE, NULL);
- if (timeout == TIMEOUT_NOBLOCK)
- button = button_get(false);
- else if (timeout == TIMEOUT_BLOCK)
- button = button_get(true);
- else
- button = button_get_w_tmo(timeout);
-
-#if defined(HAVE_GUI_BOOST) && defined(HAVE_ADJUSTABLE_CPU_FREQ)
- static struct timeout gui_unboost;
- /* Boost the CPU in case of wheel scrolling activity in the defined contexts.
- * Call unboost with a timeout of GUI_BOOST_TIMEOUT. */
- if (button != BUTTON_NONE)
- {
- gui_boost(true);
- timeout_register(&gui_unboost, gui_unboost_callback, GUI_BOOST_TIMEOUT, 0);
- }
-#endif
+ button = button_get_w_tmo(timeout);
/* Data from sys events can be pulled with button_get_data
* multimedia button presses don't go through the action system */