Index: apps/action.c =================================================================== --- apps/action.c (Revision 30836) +++ apps/action.c (Arbeitskopie) @@ -149,6 +149,27 @@ CONTEXT_STD : items[i].action_code; } + +#if defined(HAVE_GUI_BOOST_ON_WHEEL) && defined(HAVE_ADJUSTABLE_CPU_FREQ) +/* 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; + } +} +#endif + /* * int get_action_worker(int context, struct button_mapping *user_mappings, int timeout) @@ -183,6 +204,23 @@ else button = button_get_w_tmo(timeout); +#if defined(HAVE_GUI_BOOST_ON_WHEEL) && defined(HAVE_ADJUSTABLE_CPU_FREQ) + /* Boost the CPU in case of scroll wheel activity in the defined contexts. + * Unboost the CPU after timeout. */ + static long last_boost_tick; + if ((button&(BUTTON_SCROLL_BACK|BUTTON_SCROLL_FWD)) && + (context == CONTEXT_STD || context == CONTEXT_LIST || + context == CONTEXT_MAINMENU || context == CONTEXT_TREE)) + { + last_boost_tick = current_tick; + gui_boost(true); + } + else if (TIME_AFTER(current_tick, last_boost_tick + HZ)) + { + gui_boost(false); + } +#endif + /* Data from sys events can be pulled with button_get_data * multimedia button presses don't go through the action system */ if (button == BUTTON_NONE || button & (SYS_EVENT|BUTTON_MULTIMEDIA)) Index: firmware/export/config/ipodvideo.h =================================================================== --- firmware/export/config/ipodvideo.h (Revision 30836) +++ firmware/export/config/ipodvideo.h (Arbeitskopie) @@ -65,6 +65,9 @@ #define CONFIG_KEYPAD IPOD_4G_PAD +/* Define this to have CPU boosted while using wheel in the UI */ +#define HAVE_GUI_BOOST_ON_WHEEL + /* Define this to enable morse code input */ #define HAVE_MORSE_INPUT Index: firmware/export/config/ipodnano2g.h =================================================================== --- firmware/export/config/ipodnano2g.h (Revision 30836) +++ firmware/export/config/ipodnano2g.h (Arbeitskopie) @@ -104,6 +104,9 @@ #define CONFIG_KEYPAD IPOD_4G_PAD +/* Define this to have CPU boosted while using wheel in the UI */ +#define HAVE_GUI_BOOST_ON_WHEEL + #define AB_REPEAT_ENABLE #define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE