summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2010-08-20 21:00:15 +0000
committerJens Arnold <amiconn@rockbox.org>2010-08-20 21:00:15 +0000
commit43ccc1eef7a7dae532e36e5ee3fdd144637eb279 (patch)
tree31e9f3ca77712981b368fd06a301d8d6c57811bd
parent333c0cc6b01a7e298f983c43339dc5eb9fef7019 (diff)
downloadrockbox-43ccc1eef7a7dae532e36e5ee3fdd144637eb279.tar.gz
rockbox-43ccc1eef7a7dae532e36e5ee3fdd144637eb279.zip
Enable wheel acceleration and repeats for iPod 1st/2nd Gen, using the same settings as on iPod 3rd Gen.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27849 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/export/config/ipod1g2g.h7
-rw-r--r--firmware/target/arm/ipod/button-1g-3g.c47
2 files changed, 7 insertions, 47 deletions
diff --git a/firmware/export/config/ipod1g2g.h b/firmware/export/config/ipod1g2g.h
index 6da48ab62f..f4e6c19456 100644
--- a/firmware/export/config/ipod1g2g.h
+++ b/firmware/export/config/ipod1g2g.h
@@ -78,7 +78,14 @@
78 78
79#define CONFIG_KEYPAD IPOD_1G2G_PAD 79#define CONFIG_KEYPAD IPOD_1G2G_PAD
80 80
81/* define this if the unit uses a scrollwheel for navigation */
81#define HAVE_SCROLLWHEEL 82#define HAVE_SCROLLWHEEL
83/* define to activate advanced wheel acceleration code */
84#define HAVE_WHEEL_ACCELERATION
85/* define from which rotation speed [degree/sec] on the acceleration starts */
86#define WHEEL_ACCEL_START 360
87/* define type of acceleration (1 = ^2, 2 = ^3, 3 = ^4) */
88#define WHEEL_ACCELERATION 1
82 89
83/* Define this to enable morse code input */ 90/* Define this to enable morse code input */
84#define HAVE_MORSE_INPUT 91#define HAVE_MORSE_INPUT
diff --git a/firmware/target/arm/ipod/button-1g-3g.c b/firmware/target/arm/ipod/button-1g-3g.c
index 071df3294c..045a0f6d8a 100644
--- a/firmware/target/arm/ipod/button-1g-3g.c
+++ b/firmware/target/arm/ipod/button-1g-3g.c
@@ -49,7 +49,6 @@ static int int_btn = BUTTON_NONE;
49#define WHEEL_TIMEOUT (HZ/4) 49#define WHEEL_TIMEOUT (HZ/4)
50#endif 50#endif
51 51
52#ifdef IPOD_3G
53#define WHEELCLICKS_PER_ROTATION 96 52#define WHEELCLICKS_PER_ROTATION 96
54#define WHEEL_BASE_SENSITIVITY 6 /* Compute every ... clicks */ 53#define WHEEL_BASE_SENSITIVITY 6 /* Compute every ... clicks */
55#define WHEEL_REPEAT_VELOCITY 45 /* deg/s */ 54#define WHEEL_REPEAT_VELOCITY 45 /* deg/s */
@@ -188,52 +187,6 @@ static void handle_scroll_wheel(int new_scroll)
188 187
189 last_wheel_usec = usec; 188 last_wheel_usec = usec;
190} 189}
191#else
192static void handle_scroll_wheel(int new_scroll)
193{
194 int wheel_keycode = BUTTON_NONE;
195 static int prev_scroll = -1;
196 static int direction = 0;
197 static int count = 0;
198 static int scroll_state[4][4] = {
199 {0, 1, -1, 0},
200 {-1, 0, 0, 1},
201 {1, 0, 0, -1},
202 {0, -1, 1, 0}
203 };
204
205 if ( prev_scroll == -1 ) {
206 prev_scroll = new_scroll;
207 }
208 else if (direction != scroll_state[prev_scroll][new_scroll]) {
209 direction = scroll_state[prev_scroll][new_scroll];
210 count = 0;
211 }
212 else {
213 backlight_on();
214 reset_poweroff_timer();
215 if (++count == 6) { /* reduce sensitivity */
216 count = 0;
217 /* 1st..3rd Gen wheel has inverse direction mapping
218 * compared to Mini 1st Gen wheel. */
219 switch (direction) {
220 case 1:
221 wheel_keycode = BUTTON_SCROLL_BACK;
222 break;
223 case -1:
224 wheel_keycode = BUTTON_SCROLL_FWD;
225 break;
226 default:
227 /* only happens if we get out of sync */
228 break;
229 }
230 }
231 }
232 if (wheel_keycode != BUTTON_NONE && queue_empty(&button_queue))
233 queue_post(&button_queue, wheel_keycode, 0);
234 prev_scroll = new_scroll;
235}
236#endif /* IPOD_3G */
237 190
238static int ipod_3g_button_read(void) 191static int ipod_3g_button_read(void)
239{ 192{