From e5e41c3a82bfd546a686a758ca3a382d0173a3e2 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Mon, 13 Apr 2009 10:28:06 +0000 Subject: FS#10120 - fuze/e200v2: poll the wheel more often (every 5ms). This makes the scrollwheel behavior nearly perfect (decent acceleration, no direction changes if you turn to fast). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20699 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/as3525/kernel-as3525.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'firmware/target/arm/as3525/kernel-as3525.c') diff --git a/firmware/target/arm/as3525/kernel-as3525.c b/firmware/target/arm/as3525/kernel-as3525.c index 3252e5abd1..986ceb3189 100644 --- a/firmware/target/arm/as3525/kernel-as3525.c +++ b/firmware/target/arm/as3525/kernel-as3525.c @@ -24,12 +24,29 @@ #include "panic.h" #include "timer-target.h" +#ifdef HAVE_SCROLLWHEEL +/* The scrollwheel is polled every 5 ms (the tick tasks only every 10) */ +extern void button_read_dbop(void); +static volatile int poll_scrollwheel = 0; + +void INT_TIMER2(void) +{ + if (!poll_scrollwheel) + call_tick_tasks(); /* Run through the list of tick tasks */ + else + button_read_dbop(); + + poll_scrollwheel ^= 1; + TIMER2_INTCLR = 0; /* clear interrupt */ +} +#else void INT_TIMER2(void) { call_tick_tasks(); /* Run through the list of tick tasks */ TIMER2_INTCLR = 0; /* clear interrupt */ } +#endif void tick_start(unsigned int interval_in_ms) { @@ -37,6 +54,11 @@ void tick_start(unsigned int interval_in_ms) int prescale = 1; int cycles = TIMER_FREQ / 1000 * interval_in_ms; +#ifdef HAVE_SCROLLWHEEL + /* let the timer interrupt twice as often for the scrollwheel polling */ + cycles >>= 1; +#endif + while(cycles > 0x10000) { phi++; -- cgit