summaryrefslogtreecommitdiff
path: root/firmware/target/arm/as3525/kernel-as3525.c
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2009-04-13 10:28:06 +0000
committerThomas Martitz <kugel@rockbox.org>2009-04-13 10:28:06 +0000
commite5e41c3a82bfd546a686a758ca3a382d0173a3e2 (patch)
tree1434c0bdb7f52b44db96f87c9a75352110b22174 /firmware/target/arm/as3525/kernel-as3525.c
parent65aa187aef48191ea2d65e804493a18e9e900da7 (diff)
downloadrockbox-e5e41c3a82bfd546a686a758ca3a382d0173a3e2.tar.gz
rockbox-e5e41c3a82bfd546a686a758ca3a382d0173a3e2.zip
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
Diffstat (limited to 'firmware/target/arm/as3525/kernel-as3525.c')
-rw-r--r--firmware/target/arm/as3525/kernel-as3525.c22
1 files changed, 22 insertions, 0 deletions
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 @@
24#include "panic.h" 24#include "panic.h"
25#include "timer-target.h" 25#include "timer-target.h"
26 26
27#ifdef HAVE_SCROLLWHEEL
28/* The scrollwheel is polled every 5 ms (the tick tasks only every 10) */
29extern void button_read_dbop(void);
30static volatile int poll_scrollwheel = 0;
31
32void INT_TIMER2(void)
33{
34 if (!poll_scrollwheel)
35 call_tick_tasks(); /* Run through the list of tick tasks */
36 else
37 button_read_dbop();
38
39 poll_scrollwheel ^= 1;
40 TIMER2_INTCLR = 0; /* clear interrupt */
41}
42#else
27void INT_TIMER2(void) 43void INT_TIMER2(void)
28{ 44{
29 call_tick_tasks(); /* Run through the list of tick tasks */ 45 call_tick_tasks(); /* Run through the list of tick tasks */
30 46
31 TIMER2_INTCLR = 0; /* clear interrupt */ 47 TIMER2_INTCLR = 0; /* clear interrupt */
32} 48}
49#endif
33 50
34void tick_start(unsigned int interval_in_ms) 51void tick_start(unsigned int interval_in_ms)
35{ 52{
@@ -37,6 +54,11 @@ void tick_start(unsigned int interval_in_ms)
37 int prescale = 1; 54 int prescale = 1;
38 int cycles = TIMER_FREQ / 1000 * interval_in_ms; 55 int cycles = TIMER_FREQ / 1000 * interval_in_ms;
39 56
57#ifdef HAVE_SCROLLWHEEL
58 /* let the timer interrupt twice as often for the scrollwheel polling */
59 cycles >>= 1;
60#endif
61
40 while(cycles > 0x10000) 62 while(cycles > 0x10000)
41 { 63 {
42 phi++; 64 phi++;