diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/export/config/ipod1g2g.h | 7 | ||||
-rw-r--r-- | firmware/target/arm/ipod/button-1g-3g.c | 47 |
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 | ||
192 | static 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 | ||
238 | static int ipod_3g_button_read(void) | 191 | static int ipod_3g_button_read(void) |
239 | { | 192 | { |