1
0
Fork 0
forked from len0rd/rockbox

Additional minor button interrupt tweaks, in a completely unscientific way, this seems to make the 5g more responsive at 30mhz

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8940 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Brandon Low 2006-03-07 05:21:00 +00:00
parent b5648000ba
commit a4b45ee131

View file

@ -124,27 +124,21 @@ static void opto_i2c_init(void)
static int ipod_4g_button_read(void)
{
unsigned reg, status;
static int clickwheel_down = 0;
static int old_wheel_value = -1;
int wheel_keycode = BUTTON_NONE;
int new_wheel_value;
int btn = BUTTON_NONE;
/* The ipodlinux source had a udelay(250) here, but testing has shown that
it is not needed - tested on Nano, Color/Photo and Video. */
/* udelay(250);*/
reg = 0x7000c104;
int btn = BUTTON_NONE;
unsigned reg = 0x7000c104;
if ((inl(0x7000c104) & 0x4000000) != 0) {
reg = reg + 0x3C; /* 0x7000c140 */
unsigned status = inl(0x7000c140);
status = inl(0x7000c140);
reg = reg + 0x3C; /* 0x7000c140 */
outl(0x0, 0x7000c140); /* clear interrupt status? */
if ((status & 0x800000ff) == 0x8000001a) {
/* NB: highest wheel = 0x5F, clockwise increases */
new_wheel_value = ((status << 9) >> 25) & 0xff;
static int clickwheel_down IDATA_ATTR = 0;
static int old_wheel_value IDATA_ATTR = -1;
if (status & 0x100)
btn |= BUTTON_SELECT;
@ -157,10 +151,14 @@ static int ipod_4g_button_read(void)
if (status & 0x1000)
btn |= BUTTON_MENU;
if (status & 0x40000000) {
/* NB: highest wheel = 0x5F, clockwise increases */
int new_wheel_value = ((status << 9) >> 25) & 0xff;
/* scroll wheel down */
clickwheel_down = 1;
backlight_on();
if (old_wheel_value != -1) {
if (old_wheel_value >= 0) {
int wheel_keycode = BUTTON_NONE;
int wheel_delta;
if (old_wheel_value > new_wheel_value + 48) {
/* Forward wrapping case */