summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndree Buschmann <AndreeBuschmann@t-online.de>2011-11-11 19:40:32 +0000
committerAndree Buschmann <AndreeBuschmann@t-online.de>2011-11-11 19:40:32 +0000
commitf1ee740f2b48c8a2da5fa1d33e033a9067fe3843 (patch)
treeb32fdb2f489ec0ce016eba2b4736e26af552cccf
parent312b2a2de7a35f8c4b0dc355b7b291085a9a5ea4 (diff)
downloadrockbox-f1ee740f2b48c8a2da5fa1d33e033a9067fe3843.tar.gz
rockbox-f1ee740f2b48c8a2da5fa1d33e033a9067fe3843.zip
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.c38
-rw-r--r--firmware/export/config/ipod1g2g.h3
-rw-r--r--firmware/export/config/ipod3g.h3
-rw-r--r--firmware/export/config/ipod4g.h3
-rw-r--r--firmware/export/config/ipod6g.h3
-rw-r--r--firmware/export/config/ipodcolor.h3
-rw-r--r--firmware/export/config/ipodmini1g.h3
-rw-r--r--firmware/export/config/ipodmini2g.h3
-rw-r--r--firmware/export/config/ipodnano1g.h3
-rw-r--r--firmware/export/config/ipodnano2g.h3
-rw-r--r--firmware/export/config/ipodvideo.h3
-rw-r--r--firmware/export/config/sansae200.h3
-rw-r--r--firmware/export/config/sansae200v2.h3
-rw-r--r--firmware/export/config/sansafuze.h3
-rw-r--r--firmware/export/config/sansafuzev2.h3
-rw-r--r--firmware/export/config/sansaview.h3
16 files changed, 83 insertions, 0 deletions
diff --git a/apps/action.c b/apps/action.c
index 15b2d8a4c8..0b21a27ea9 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)
149 CONTEXT_STD : 149 CONTEXT_STD :
150 items[i].action_code; 150 items[i].action_code;
151} 151}
152
153#if defined(HAVE_GUI_BOOST) && defined(HAVE_ADJUSTABLE_CPU_FREQ)
154/* Helper function which is called to boost / unboost CPU. This function
155 * avoids to increase boost_count with each call of gui_boost(). */
156static void gui_boost(bool want_to_boost)
157{
158 static bool boosted = false;
159
160 if (want_to_boost && !boosted)
161 {
162 cpu_boost(true);
163 boosted = true;
164 }
165 else if (!want_to_boost && boosted)
166 {
167 cpu_boost(false);
168 boosted = false;
169 }
170}
171#endif
172
152/* 173/*
153 * int get_action_worker(int context, struct button_mapping *user_mappings, 174 * int get_action_worker(int context, struct button_mapping *user_mappings,
154 int timeout) 175 int timeout)
@@ -183,6 +204,23 @@ static int get_action_worker(int context, int timeout,
183 else 204 else
184 button = button_get_w_tmo(timeout); 205 button = button_get_w_tmo(timeout);
185 206
207#if defined(HAVE_GUI_BOOST) && defined(HAVE_ADJUSTABLE_CPU_FREQ)
208 /* Boost the CPU in case of wheel scrolling activity in the defined contexts.
209 * Unboost the CPU after timeout. */
210 static long last_boost_tick;
211 if ((button&(BUTTON_SCROLL_BACK|BUTTON_SCROLL_FWD)) &&
212 (context == CONTEXT_STD || context == CONTEXT_LIST ||
213 context == CONTEXT_MAINMENU || context == CONTEXT_TREE))
214 {
215 last_boost_tick = current_tick;
216 gui_boost(true);
217 }
218 else if (TIME_AFTER(current_tick, last_boost_tick + HZ))
219 {
220 gui_boost(false);
221 }
222#endif
223
186 /* Data from sys events can be pulled with button_get_data 224 /* Data from sys events can be pulled with button_get_data
187 * multimedia button presses don't go through the action system */ 225 * multimedia button presses don't go through the action system */
188 if (button == BUTTON_NONE || button & (SYS_EVENT|BUTTON_MULTIMEDIA)) 226 if (button == BUTTON_NONE || button & (SYS_EVENT|BUTTON_MULTIMEDIA))
diff --git a/firmware/export/config/ipod1g2g.h b/firmware/export/config/ipod1g2g.h
index f4e6c19456..0ce5d45590 100644
--- a/firmware/export/config/ipod1g2g.h
+++ b/firmware/export/config/ipod1g2g.h
@@ -78,6 +78,9 @@
78 78
79#define CONFIG_KEYPAD IPOD_1G2G_PAD 79#define CONFIG_KEYPAD IPOD_1G2G_PAD
80 80
81/* Define this to have CPU boosted while scrolling in the UI */
82#define HAVE_GUI_BOOST
83
81/* define this if the unit uses a scrollwheel for navigation */ 84/* define this if the unit uses a scrollwheel for navigation */
82#define HAVE_SCROLLWHEEL 85#define HAVE_SCROLLWHEEL
83/* define to activate advanced wheel acceleration code */ 86/* define to activate advanced wheel acceleration code */
diff --git a/firmware/export/config/ipod3g.h b/firmware/export/config/ipod3g.h
index ee59a1bc76..e7d8bff53b 100644
--- a/firmware/export/config/ipod3g.h
+++ b/firmware/export/config/ipod3g.h
@@ -79,6 +79,9 @@
79 79
80#define CONFIG_KEYPAD IPOD_3G_PAD 80#define CONFIG_KEYPAD IPOD_3G_PAD
81 81
82/* Define this to have CPU boosted while scrolling in the UI */
83#define HAVE_GUI_BOOST
84
82/* define this if the unit uses a scrollwheel for navigation */ 85/* define this if the unit uses a scrollwheel for navigation */
83#define HAVE_SCROLLWHEEL 86#define HAVE_SCROLLWHEEL
84/* define to activate advanced wheel acceleration code */ 87/* define to activate advanced wheel acceleration code */
diff --git a/firmware/export/config/ipod4g.h b/firmware/export/config/ipod4g.h
index 56d0599799..165f5967b4 100644
--- a/firmware/export/config/ipod4g.h
+++ b/firmware/export/config/ipod4g.h
@@ -79,6 +79,9 @@
79 79
80#define CONFIG_KEYPAD IPOD_4G_PAD 80#define CONFIG_KEYPAD IPOD_4G_PAD
81 81
82/* Define this to have CPU boosted while scrolling in the UI */
83#define HAVE_GUI_BOOST
84
82/* Define this to enable morse code input */ 85/* Define this to enable morse code input */
83#define HAVE_MORSE_INPUT 86#define HAVE_MORSE_INPUT
84 87
diff --git a/firmware/export/config/ipod6g.h b/firmware/export/config/ipod6g.h
index dae9340d5a..0dac46cd8e 100644
--- a/firmware/export/config/ipod6g.h
+++ b/firmware/export/config/ipod6g.h
@@ -100,6 +100,9 @@
100 100
101#define CONFIG_KEYPAD IPOD_4G_PAD 101#define CONFIG_KEYPAD IPOD_4G_PAD
102 102
103/* Define this to have CPU boosted while scrolling in the UI */
104#define HAVE_GUI_BOOST
105
103//#define AB_REPEAT_ENABLE 106//#define AB_REPEAT_ENABLE
104//#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE 107//#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE
105 108
diff --git a/firmware/export/config/ipodcolor.h b/firmware/export/config/ipodcolor.h
index ec3d2c6cdf..645e20041c 100644
--- a/firmware/export/config/ipodcolor.h
+++ b/firmware/export/config/ipodcolor.h
@@ -66,6 +66,9 @@
66 66
67#define CONFIG_KEYPAD IPOD_4G_PAD 67#define CONFIG_KEYPAD IPOD_4G_PAD
68 68
69/* Define this to have CPU boosted while scrolling in the UI */
70#define HAVE_GUI_BOOST
71
69/* Define this to enable morse code input */ 72/* Define this to enable morse code input */
70#define HAVE_MORSE_INPUT 73#define HAVE_MORSE_INPUT
71 74
diff --git a/firmware/export/config/ipodmini1g.h b/firmware/export/config/ipodmini1g.h
index 55b78de752..777dc6f9a2 100644
--- a/firmware/export/config/ipodmini1g.h
+++ b/firmware/export/config/ipodmini1g.h
@@ -78,6 +78,9 @@
78 78
79#define CONFIG_KEYPAD IPOD_4G_PAD 79#define CONFIG_KEYPAD IPOD_4G_PAD
80 80
81/* Define this to have CPU boosted while scrolling in the UI */
82#define HAVE_GUI_BOOST
83
81#define HAVE_SCROLLWHEEL 84#define HAVE_SCROLLWHEEL
82/* define to activate advanced wheel acceleration code */ 85/* define to activate advanced wheel acceleration code */
83#define HAVE_WHEEL_ACCELERATION 86#define HAVE_WHEEL_ACCELERATION
diff --git a/firmware/export/config/ipodmini2g.h b/firmware/export/config/ipodmini2g.h
index fd332c0a03..c401170459 100644
--- a/firmware/export/config/ipodmini2g.h
+++ b/firmware/export/config/ipodmini2g.h
@@ -78,6 +78,9 @@
78 78
79#define CONFIG_KEYPAD IPOD_4G_PAD 79#define CONFIG_KEYPAD IPOD_4G_PAD
80 80
81/* Define this to have CPU boosted while scrolling in the UI */
82#define HAVE_GUI_BOOST
83
81/* Define this to enable morse code input */ 84/* Define this to enable morse code input */
82#define HAVE_MORSE_INPUT 85#define HAVE_MORSE_INPUT
83 86
diff --git a/firmware/export/config/ipodnano1g.h b/firmware/export/config/ipodnano1g.h
index 9dba533744..388ba34447 100644
--- a/firmware/export/config/ipodnano1g.h
+++ b/firmware/export/config/ipodnano1g.h
@@ -69,6 +69,9 @@
69 69
70#define CONFIG_KEYPAD IPOD_4G_PAD 70#define CONFIG_KEYPAD IPOD_4G_PAD
71 71
72/* Define this to have CPU boosted while scrolling in the UI */
73#define HAVE_GUI_BOOST
74
72/* Define this to enable morse code input */ 75/* Define this to enable morse code input */
73#define HAVE_MORSE_INPUT 76#define HAVE_MORSE_INPUT
74 77
diff --git a/firmware/export/config/ipodnano2g.h b/firmware/export/config/ipodnano2g.h
index a85cd61436..37a21b33ba 100644
--- a/firmware/export/config/ipodnano2g.h
+++ b/firmware/export/config/ipodnano2g.h
@@ -104,6 +104,9 @@
104 104
105#define CONFIG_KEYPAD IPOD_4G_PAD 105#define CONFIG_KEYPAD IPOD_4G_PAD
106 106
107/* Define this to have CPU boosted while scrolling in the UI */
108#define HAVE_GUI_BOOST
109
107#define AB_REPEAT_ENABLE 110#define AB_REPEAT_ENABLE
108#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE 111#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE
109 112
diff --git a/firmware/export/config/ipodvideo.h b/firmware/export/config/ipodvideo.h
index dd21bb518a..1dd7d48e30 100644
--- a/firmware/export/config/ipodvideo.h
+++ b/firmware/export/config/ipodvideo.h
@@ -65,6 +65,9 @@
65 65
66#define CONFIG_KEYPAD IPOD_4G_PAD 66#define CONFIG_KEYPAD IPOD_4G_PAD
67 67
68/* Define this to have CPU boosted while scrolling in the UI */
69#define HAVE_GUI_BOOST
70
68/* Define this to enable morse code input */ 71/* Define this to enable morse code input */
69#define HAVE_MORSE_INPUT 72#define HAVE_MORSE_INPUT
70 73
diff --git a/firmware/export/config/sansae200.h b/firmware/export/config/sansae200.h
index a6f4e5416d..dd5747a9ca 100644
--- a/firmware/export/config/sansae200.h
+++ b/firmware/export/config/sansae200.h
@@ -78,6 +78,9 @@
78 78
79#define CONFIG_KEYPAD SANSA_E200_PAD 79#define CONFIG_KEYPAD SANSA_E200_PAD
80 80
81/* Define this to have CPU boosted while scrolling in the UI */
82#define HAVE_GUI_BOOST
83
81/* Define this to enable morse code input */ 84/* Define this to enable morse code input */
82#define HAVE_MORSE_INPUT 85#define HAVE_MORSE_INPUT
83 86
diff --git a/firmware/export/config/sansae200v2.h b/firmware/export/config/sansae200v2.h
index 03711990a9..34c2cd98ad 100644
--- a/firmware/export/config/sansae200v2.h
+++ b/firmware/export/config/sansae200v2.h
@@ -76,6 +76,9 @@
76/* Define this to enable morse code input */ 76/* Define this to enable morse code input */
77#define HAVE_MORSE_INPUT 77#define HAVE_MORSE_INPUT
78 78
79/* Define this to have CPU boosted while scrolling in the UI */
80#define HAVE_GUI_BOOST
81
79/* Define this if you do software codec */ 82/* Define this if you do software codec */
80#define CONFIG_CODEC SWCODEC 83#define CONFIG_CODEC SWCODEC
81 84
diff --git a/firmware/export/config/sansafuze.h b/firmware/export/config/sansafuze.h
index 2f0073fc53..8563664cb8 100644
--- a/firmware/export/config/sansafuze.h
+++ b/firmware/export/config/sansafuze.h
@@ -77,6 +77,9 @@
77 77
78#define CONFIG_KEYPAD SANSA_FUZE_PAD 78#define CONFIG_KEYPAD SANSA_FUZE_PAD
79 79
80/* Define this to have CPU boosted while scrolling in the UI */
81#define HAVE_GUI_BOOST
82
80/* Define this to enable morse code input */ 83/* Define this to enable morse code input */
81#define HAVE_MORSE_INPUT 84#define HAVE_MORSE_INPUT
82 85
diff --git a/firmware/export/config/sansafuzev2.h b/firmware/export/config/sansafuzev2.h
index ff88aa9146..1c0f8a99dc 100644
--- a/firmware/export/config/sansafuzev2.h
+++ b/firmware/export/config/sansafuzev2.h
@@ -88,6 +88,9 @@
88 88
89#define CONFIG_KEYPAD SANSA_FUZE_PAD 89#define CONFIG_KEYPAD SANSA_FUZE_PAD
90 90
91/* Define this to have CPU boosted while scrolling in the UI */
92#define HAVE_GUI_BOOST
93
91/* Define this to enable morse code input */ 94/* Define this to enable morse code input */
92#define HAVE_MORSE_INPUT 95#define HAVE_MORSE_INPUT
93 96
diff --git a/firmware/export/config/sansaview.h b/firmware/export/config/sansaview.h
index b0317f3e0d..829f67ab3e 100644
--- a/firmware/export/config/sansaview.h
+++ b/firmware/export/config/sansaview.h
@@ -74,6 +74,9 @@
74/* The only difference is that the power/hold is on the left instead of right on Fuze */ 74/* The only difference is that the power/hold is on the left instead of right on Fuze */
75#define CONFIG_KEYPAD SANSA_FUZE_PAD 75#define CONFIG_KEYPAD SANSA_FUZE_PAD
76 76
77/* Define this to have CPU boosted while scrolling in the UI */
78#define HAVE_GUI_BOOST
79
77/* Define this to enable morse code input */ 80/* Define this to enable morse code input */
78#define HAVE_MORSE_INPUT 81#define HAVE_MORSE_INPUT
79 82