summaryrefslogtreecommitdiff
path: root/firmware/target/arm/ipod/button-1g-3g.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/ipod/button-1g-3g.c')
-rw-r--r--firmware/target/arm/ipod/button-1g-3g.c47
1 files changed, 0 insertions, 47 deletions
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{