From 43ccc1eef7a7dae532e36e5ee3fdd144637eb279 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Fri, 20 Aug 2010 21:00:15 +0000 Subject: 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 --- firmware/export/config/ipod1g2g.h | 7 +++++ 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 @@ #define CONFIG_KEYPAD IPOD_1G2G_PAD +/* define this if the unit uses a scrollwheel for navigation */ #define HAVE_SCROLLWHEEL +/* define to activate advanced wheel acceleration code */ +#define HAVE_WHEEL_ACCELERATION +/* define from which rotation speed [degree/sec] on the acceleration starts */ +#define WHEEL_ACCEL_START 360 +/* define type of acceleration (1 = ^2, 2 = ^3, 3 = ^4) */ +#define WHEEL_ACCELERATION 1 /* Define this to enable morse code input */ #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; #define WHEEL_TIMEOUT (HZ/4) #endif -#ifdef IPOD_3G #define WHEELCLICKS_PER_ROTATION 96 #define WHEEL_BASE_SENSITIVITY 6 /* Compute every ... clicks */ #define WHEEL_REPEAT_VELOCITY 45 /* deg/s */ @@ -188,52 +187,6 @@ static void handle_scroll_wheel(int new_scroll) last_wheel_usec = usec; } -#else -static void handle_scroll_wheel(int new_scroll) -{ - int wheel_keycode = BUTTON_NONE; - static int prev_scroll = -1; - static int direction = 0; - static int count = 0; - static int scroll_state[4][4] = { - {0, 1, -1, 0}, - {-1, 0, 0, 1}, - {1, 0, 0, -1}, - {0, -1, 1, 0} - }; - - if ( prev_scroll == -1 ) { - prev_scroll = new_scroll; - } - else if (direction != scroll_state[prev_scroll][new_scroll]) { - direction = scroll_state[prev_scroll][new_scroll]; - count = 0; - } - else { - backlight_on(); - reset_poweroff_timer(); - if (++count == 6) { /* reduce sensitivity */ - count = 0; - /* 1st..3rd Gen wheel has inverse direction mapping - * compared to Mini 1st Gen wheel. */ - switch (direction) { - case 1: - wheel_keycode = BUTTON_SCROLL_BACK; - break; - case -1: - wheel_keycode = BUTTON_SCROLL_FWD; - break; - default: - /* only happens if we get out of sync */ - break; - } - } - } - if (wheel_keycode != BUTTON_NONE && queue_empty(&button_queue)) - queue_post(&button_queue, wheel_keycode, 0); - prev_scroll = new_scroll; -} -#endif /* IPOD_3G */ static int ipod_3g_button_read(void) { -- cgit v1.2.3