diff options
| author | Andree Buschmann <AndreeBuschmann@t-online.de> | 2011-11-11 19:40:32 +0000 |
|---|---|---|
| committer | Andree Buschmann <AndreeBuschmann@t-online.de> | 2011-11-11 19:40:32 +0000 |
| commit | f1ee740f2b48c8a2da5fa1d33e033a9067fe3843 (patch) | |
| tree | b32fdb2f489ec0ce016eba2b4736e26af552cccf | |
| parent | 312b2a2de7a35f8c4b0dc355b7b291085a9a5ea4 (diff) | |
| download | rockbox-f1ee740f2b48c8a2da5fa1d33e033a9067fe3843.zip rockbox-f1ee740f2b48c8a2da5fa1d33e033a9067fe3843.tar.gz rockbox-f1ee740f2b48c8a2da5fa1d33e033a9067fe3843.tar.bz2 rockbox-f1ee740f2b48c8a2da5fa1d33e033a9067fe3843.tar.xz | |
Finally submit GUI boost (FS#8668). With this change the CPU is boosted (with a 1 second timeout) on scrollwheel activity in the list, main menu, tree and std context. For now GUI boost is only enabled on scrollwheel targets. The code can easily be enhanced to work with other targets as well.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30967 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | apps/action.c | 38 | ||||
| -rw-r--r-- | firmware/export/config/ipod1g2g.h | 3 | ||||
| -rw-r--r-- | firmware/export/config/ipod3g.h | 3 | ||||
| -rw-r--r-- | firmware/export/config/ipod4g.h | 3 | ||||
| -rw-r--r-- | firmware/export/config/ipod6g.h | 3 | ||||
| -rw-r--r-- | firmware/export/config/ipodcolor.h | 3 | ||||
| -rw-r--r-- | firmware/export/config/ipodmini1g.h | 3 | ||||
| -rw-r--r-- | firmware/export/config/ipodmini2g.h | 3 | ||||
| -rw-r--r-- | firmware/export/config/ipodnano1g.h | 3 | ||||
| -rw-r--r-- | firmware/export/config/ipodnano2g.h | 3 | ||||
| -rw-r--r-- | firmware/export/config/ipodvideo.h | 3 | ||||
| -rw-r--r-- | firmware/export/config/sansae200.h | 3 | ||||
| -rw-r--r-- | firmware/export/config/sansae200v2.h | 3 | ||||
| -rw-r--r-- | firmware/export/config/sansafuze.h | 3 | ||||
| -rw-r--r-- | firmware/export/config/sansafuzev2.h | 3 | ||||
| -rw-r--r-- | firmware/export/config/sansaview.h | 3 |
16 files changed, 83 insertions, 0 deletions
diff --git a/apps/action.c b/apps/action.c index 15b2d8a..0b21a27 100644 --- a/apps/action.c +++ b/apps/action.c @@ -149,6 +149,27 @@ static inline int get_next_context(const struct button_mapping *items, int i) CONTEXT_STD : items[i].action_code; } + +#if defined(HAVE_GUI_BOOST) && 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 @@ static int get_action_worker(int context, int timeout, else button = button_get_w_tmo(timeout); +#if defined(HAVE_GUI_BOOST) && defined(HAVE_ADJUSTABLE_CPU_FREQ) + /* Boost the CPU in case of wheel scrolling 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)) diff --git a/firmware/export/config/ipod1g2g.h b/firmware/export/config/ipod1g2g.h index f4e6c19..0ce5d45 100644 --- a/firmware/export/config/ipod1g2g.h +++ b/firmware/export/config/ipod1g2g.h @@ -78,6 +78,9 @@ #define CONFIG_KEYPAD IPOD_1G2G_PAD +/* Define this to have CPU boosted while scrolling in the UI */ +#define HAVE_GUI_BOOST + /* define this if the unit uses a scrollwheel for navigation */ #define HAVE_SCROLLWHEEL /* define to activate advanced wheel acceleration code */ diff --git a/firmware/export/config/ipod3g.h b/firmware/export/config/ipod3g.h index ee59a1b..e7d8bff 100644 --- a/firmware/export/config/ipod3g.h +++ b/firmware/export/config/ipod3g.h @@ -79,6 +79,9 @@ #define CONFIG_KEYPAD IPOD_3G_PAD +/* Define this to have CPU boosted while scrolling in the UI */ +#define HAVE_GUI_BOOST + /* define this if the unit uses a scrollwheel for navigation */ #define HAVE_SCROLLWHEEL /* define to activate advanced wheel acceleration code */ diff --git a/firmware/export/config/ipod4g.h b/firmware/export/config/ipod4g.h index 56d0599..165f596 100644 --- a/firmware/export/config/ipod4g.h +++ b/firmware/export/config/ipod4g.h @@ -79,6 +79,9 @@ #define CONFIG_KEYPAD IPOD_4G_PAD +/* Define this to have CPU boosted while scrolling in the UI */ +#define HAVE_GUI_BOOST + /* Define this to enable morse code input */ #define HAVE_MORSE_INPUT diff --git a/firmware/export/config/ipod6g.h b/firmware/export/config/ipod6g.h index dae9340..0dac46c 100644 --- a/firmware/export/config/ipod6g.h +++ b/firmware/export/config/ipod6g.h @@ -100,6 +100,9 @@ #define CONFIG_KEYPAD IPOD_4G_PAD +/* Define this to have CPU boosted while scrolling in the UI */ +#define HAVE_GUI_BOOST + //#define AB_REPEAT_ENABLE //#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE diff --git a/firmware/export/config/ipodcolor.h b/firmware/export/config/ipodcolor.h index ec3d2c6..645e200 100644 --- a/firmware/export/config/ipodcolor.h +++ b/firmware/export/config/ipodcolor.h @@ -66,6 +66,9 @@ #define CONFIG_KEYPAD IPOD_4G_PAD +/* Define this to have CPU boosted while scrolling in the UI */ +#define HAVE_GUI_BOOST + /* Define this to enable morse code input */ #define HAVE_MORSE_INPUT diff --git a/firmware/export/config/ipodmini1g.h b/firmware/export/config/ipodmini1g.h index 55b78de..777dc6f 100644 --- a/firmware/export/config/ipodmini1g.h +++ b/firmware/export/config/ipodmini1g.h @@ -78,6 +78,9 @@ #define CONFIG_KEYPAD IPOD_4G_PAD +/* Define this to have CPU boosted while scrolling in the UI */ +#define HAVE_GUI_BOOST + #define HAVE_SCROLLWHEEL /* define to activate advanced wheel acceleration code */ #define HAVE_WHEEL_ACCELERATION diff --git a/firmware/export/config/ipodmini2g.h b/firmware/export/config/ipodmini2g.h index fd332c0..c401170 100644 --- a/firmware/export/config/ipodmini2g.h +++ b/firmware/export/config/ipodmini2g.h @@ -78,6 +78,9 @@ #define CONFIG_KEYPAD IPOD_4G_PAD +/* Define this to have CPU boosted while scrolling in the UI */ +#define HAVE_GUI_BOOST + /* Define this to enable morse code input */ #define HAVE_MORSE_INPUT diff --git a/firmware/export/config/ipodnano1g.h b/firmware/export/config/ipodnano1g.h index 9dba533..388ba34 100644 --- a/firmware/export/config/ipodnano1g.h +++ b/firmware/export/config/ipodnano1g.h @@ -69,6 +69,9 @@ #define CONFIG_KEYPAD IPOD_4G_PAD +/* Define this to have CPU boosted while scrolling in the UI */ +#define HAVE_GUI_BOOST + /* Define this to enable morse code input */ #define HAVE_MORSE_INPUT diff --git a/firmware/export/config/ipodnano2g.h b/firmware/export/config/ipodnano2g.h index a85cd61..37a21b3 100644 --- a/firmware/export/config/ipodnano2g.h +++ b/firmware/export/config/ipodnano2g.h @@ -104,6 +104,9 @@ #define CONFIG_KEYPAD IPOD_4G_PAD +/* Define this to have CPU boosted while scrolling in the UI */ +#define HAVE_GUI_BOOST + #define AB_REPEAT_ENABLE #define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE diff --git a/firmware/export/config/ipodvideo.h b/firmware/export/config/ipodvideo.h index dd21bb5..1dd7d48 100644 --- a/firmware/export/config/ipodvideo.h +++ b/firmware/export/config/ipodvideo.h @@ -65,6 +65,9 @@ #define CONFIG_KEYPAD IPOD_4G_PAD +/* Define this to have CPU boosted while scrolling in the UI */ +#define HAVE_GUI_BOOST + /* Define this to enable morse code input */ #define HAVE_MORSE_INPUT diff --git a/firmware/export/config/sansae200.h b/firmware/export/config/sansae200.h index a6f4e54..dd5747a 100644 --- a/firmware/export/config/sansae200.h +++ b/firmware/export/config/sansae200.h @@ -78,6 +78,9 @@ #define CONFIG_KEYPAD SANSA_E200_PAD +/* Define this to have CPU boosted while scrolling in the UI */ +#define HAVE_GUI_BOOST + /* Define this to enable morse code input */ #define HAVE_MORSE_INPUT diff --git a/firmware/export/config/sansae200v2.h b/firmware/export/config/sansae200v2.h index 0371199..34c2cd9 100644 --- a/firmware/export/config/sansae200v2.h +++ b/firmware/export/config/sansae200v2.h @@ -76,6 +76,9 @@ /* Define this to enable morse code input */ #define HAVE_MORSE_INPUT +/* Define this to have CPU boosted while scrolling in the UI */ +#define HAVE_GUI_BOOST + /* Define this if you do software codec */ #define CONFIG_CODEC SWCODEC diff --git a/firmware/export/config/sansafuze.h b/firmware/export/config/sansafuze.h index 2f0073f..8563664 100644 --- a/firmware/export/config/sansafuze.h +++ b/firmware/export/config/sansafuze.h @@ -77,6 +77,9 @@ #define CONFIG_KEYPAD SANSA_FUZE_PAD +/* Define this to have CPU boosted while scrolling in the UI */ +#define HAVE_GUI_BOOST + /* Define this to enable morse code input */ #define HAVE_MORSE_INPUT diff --git a/firmware/export/config/sansafuzev2.h b/firmware/export/config/sansafuzev2.h index ff88aa9..1c0f8a9 100644 --- a/firmware/export/config/sansafuzev2.h +++ b/firmware/export/config/sansafuzev2.h @@ -88,6 +88,9 @@ #define CONFIG_KEYPAD SANSA_FUZE_PAD +/* Define this to have CPU boosted while scrolling in the UI */ +#define HAVE_GUI_BOOST + /* Define this to enable morse code input */ #define HAVE_MORSE_INPUT diff --git a/firmware/export/config/sansaview.h b/firmware/export/config/sansaview.h index b0317f3..829f67a 100644 --- a/firmware/export/config/sansaview.h +++ b/firmware/export/config/sansaview.h @@ -74,6 +74,9 @@ /* The only difference is that the power/hold is on the left instead of right on Fuze */ #define CONFIG_KEYPAD SANSA_FUZE_PAD +/* Define this to have CPU boosted while scrolling in the UI */ +#define HAVE_GUI_BOOST + /* Define this to enable morse code input */ #define HAVE_MORSE_INPUT |