summaryrefslogtreecommitdiff
path: root/firmware/target/arm/as3525/kernel-as3525.c
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2009-06-04 14:50:07 +0000
committerRafaël Carré <rafael.carre@gmail.com>2009-06-04 14:50:07 +0000
commit2409c28f216b3e8afb4eeceb2ee314098e79691e (patch)
tree41bd7793cd15cc2ef3d76aacff400f2b07d9b0b4 /firmware/target/arm/as3525/kernel-as3525.c
parentaa7b081baddeebd8cff89477a6428aa5f2dd502c (diff)
downloadrockbox-2409c28f216b3e8afb4eeceb2ee314098e79691e.tar.gz
rockbox-2409c28f216b3e8afb4eeceb2ee314098e79691e.zip
Sansa AMS: Revert r21177 : the timer frequency is used by the user timer (example: metronome will be twice too fast)
Instead use a private KERNEL_TIMER_FREQ define which is dependant on HAVE_SCROLLWHEEL Comment that call_tick_tasks() will read the scrollwheel Remove the unneeded volatile type qualifier from poll_scrollwheel git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21187 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/as3525/kernel-as3525.c')
-rw-r--r--firmware/target/arm/as3525/kernel-as3525.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/firmware/target/arm/as3525/kernel-as3525.c b/firmware/target/arm/as3525/kernel-as3525.c
index 0f907f61e3..d8f0e23d30 100644
--- a/firmware/target/arm/as3525/kernel-as3525.c
+++ b/firmware/target/arm/as3525/kernel-as3525.c
@@ -25,18 +25,26 @@
25#include "timer-target.h" 25#include "timer-target.h"
26 26
27#ifdef HAVE_SCROLLWHEEL 27#ifdef HAVE_SCROLLWHEEL
28/* let the timer interrupt twice as often for the scrollwheel polling */
29#define KERNEL_TIMER_FREQ (TIMER_FREQ/2)
30#else
31#define KERNEL_TIMER_FREQ TIMER_FREQ
32#endif
33
34#ifdef HAVE_SCROLLWHEEL
28#include "button-target.h" 35#include "button-target.h"
29/* The scrollwheel is polled every 5 ms (the tick tasks only every 10) */ 36/* The scrollwheel is polled every 5 ms (the tick tasks only every 10) */
30static volatile int poll_scrollwheel = 0; 37static int poll_scrollwheel = 0;
31 38
32void INT_TIMER2(void) 39void INT_TIMER2(void)
33{ 40{
34 if (!poll_scrollwheel) 41 if (!poll_scrollwheel)
35 call_tick_tasks(); /* Run through the list of tick tasks */ 42 call_tick_tasks(); /* Run through the list of tick tasks
43 * (that includes reading the scrollwheel) */
36 else 44 else
37 { 45 {
38 if (!button_hold()) 46 if (!button_hold())
39 button_read_dbop(); 47 button_read_dbop(); /* Read the scrollwheel */
40 } 48 }
41 49
42 poll_scrollwheel ^= 1; 50 poll_scrollwheel ^= 1;
@@ -55,7 +63,7 @@ void tick_start(unsigned int interval_in_ms)
55{ 63{
56 int phi = 0; /* prescaler bits */ 64 int phi = 0; /* prescaler bits */
57 int prescale = 1; 65 int prescale = 1;
58 int cycles = TIMER_FREQ / 1000 * interval_in_ms; 66 int cycles = KERNEL_TIMER_FREQ / 1000 * interval_in_ms;
59 67
60 while(cycles > 0x10000) 68 while(cycles > 0x10000)
61 { 69 {