mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-08 12:45:26 -05:00
Revert r26060. A better fix was found. The acceleration should be fixed once for all now.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26175 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
9c774b3849
commit
0b28594036
2 changed files with 11 additions and 14 deletions
|
|
@ -73,7 +73,7 @@
|
||||||
/* define to activate advanced wheel acceleration code */
|
/* define to activate advanced wheel acceleration code */
|
||||||
#define HAVE_WHEEL_ACCELERATION
|
#define HAVE_WHEEL_ACCELERATION
|
||||||
/* define from which rotation speed [degree/sec] on the acceleration starts */
|
/* define from which rotation speed [degree/sec] on the acceleration starts */
|
||||||
#define WHEEL_ACCEL_START 540
|
#define WHEEL_ACCEL_START 720
|
||||||
/* define type of acceleration (1 = ^2, 2 = ^3, 3 = ^4) */
|
/* define type of acceleration (1 = ^2, 2 = ^3, 3 = ^4) */
|
||||||
#define WHEEL_ACCELERATION 1
|
#define WHEEL_ACCELERATION 1
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,6 @@ static bool hold_button = false;
|
||||||
#define TIMER_TICK (KERNEL_TIMER_FREQ/HZ)/* how long a tick lasts */
|
#define TIMER_TICK (KERNEL_TIMER_FREQ/HZ)/* how long a tick lasts */
|
||||||
#define TIMER_MS (TIMER_TICK/(1000/HZ))/* how long a ms lasts */
|
#define TIMER_MS (TIMER_TICK/(1000/HZ))/* how long a ms lasts */
|
||||||
|
|
||||||
#define WHEEL_LOOP_INTERVAL ( 3*TIMER_MS) /* 3 ms */
|
|
||||||
#define WHEEL_REPEAT_INTERVAL (300*TIMER_MS) /* 300ms */
|
#define WHEEL_REPEAT_INTERVAL (300*TIMER_MS) /* 300ms */
|
||||||
#define WHEEL_FAST_ON_INTERVAL ( 20*TIMER_MS) /* 20ms */
|
#define WHEEL_FAST_ON_INTERVAL ( 20*TIMER_MS) /* 20ms */
|
||||||
#define WHEEL_FAST_OFF_INTERVAL ( 60*TIMER_MS) /* 60ms */
|
#define WHEEL_FAST_OFF_INTERVAL ( 60*TIMER_MS) /* 60ms */
|
||||||
|
|
@ -77,18 +76,6 @@ static void scrollwheel(unsigned int wheel_value)
|
||||||
{ 1, 3, 0, 2 }, /* Counter-clockwise */
|
{ 1, 3, 0, 2 }, /* Counter-clockwise */
|
||||||
};
|
};
|
||||||
|
|
||||||
int repeat = 1; /* assume repeat */
|
|
||||||
long time = TIMER2_VALUE + current_tick*TIMER_TICK; /* to timer unit */
|
|
||||||
long v = (time - last_wheel_post);
|
|
||||||
if (v < WHEEL_LOOP_INTERVAL) /* avoid too frequent updates */
|
|
||||||
return ;
|
|
||||||
|
|
||||||
/* interpolate velocity in timer_freq/timer_unit == 1/s */
|
|
||||||
if (v) v = TIMER_FREQ / v;
|
|
||||||
|
|
||||||
/* accumulate velocities over time with each v */
|
|
||||||
wheel_velocity = (7*wheel_velocity + v) / 8;
|
|
||||||
|
|
||||||
unsigned int btn = BUTTON_NONE;
|
unsigned int btn = BUTTON_NONE;
|
||||||
|
|
||||||
if (old_wheel_value == wheel_tbl[0][wheel_value])
|
if (old_wheel_value == wheel_tbl[0][wheel_value])
|
||||||
|
|
@ -102,6 +89,16 @@ static void scrollwheel(unsigned int wheel_value)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int repeat = 1; /* assume repeat */
|
||||||
|
long time = (TIMER_TICK - TIMER2_VALUE) + current_tick*TIMER_TICK; /* to timer unit */
|
||||||
|
long v = (time - last_wheel_post);
|
||||||
|
|
||||||
|
/* interpolate velocity in timer_freq/timer_unit == 1/s */
|
||||||
|
if (v) v = TIMER_FREQ / v;
|
||||||
|
|
||||||
|
/* accumulate velocities over time with each v */
|
||||||
|
wheel_velocity = (7*wheel_velocity + v) / 8;
|
||||||
|
|
||||||
if (btn != wheel_repeat)
|
if (btn != wheel_repeat)
|
||||||
{
|
{
|
||||||
/* direction reversals nullify all fast mode states */
|
/* direction reversals nullify all fast mode states */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue