diff options
| author | Rafaël Carré <rafael.carre@gmail.com> | 2009-06-04 14:50:07 +0000 |
|---|---|---|
| committer | Rafaël Carré <rafael.carre@gmail.com> | 2009-06-04 14:50:07 +0000 |
| commit | 2409c28f216b3e8afb4eeceb2ee314098e79691e (patch) | |
| tree | 41bd7793cd15cc2ef3d76aacff400f2b07d9b0b4 | |
| parent | aa7b081baddeebd8cff89477a6428aa5f2dd502c (diff) | |
| download | rockbox-2409c28f216b3e8afb4eeceb2ee314098e79691e.zip rockbox-2409c28f216b3e8afb4eeceb2ee314098e79691e.tar.gz rockbox-2409c28f216b3e8afb4eeceb2ee314098e79691e.tar.bz2 rockbox-2409c28f216b3e8afb4eeceb2ee314098e79691e.tar.xz | |
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
| -rw-r--r-- | firmware/target/arm/as3525/kernel-as3525.c | 16 | ||||
| -rw-r--r-- | firmware/target/arm/as3525/timer-target.h | 9 |
2 files changed, 13 insertions, 12 deletions
diff --git a/firmware/target/arm/as3525/kernel-as3525.c b/firmware/target/arm/as3525/kernel-as3525.c index 0f907f6..d8f0e23 100644 --- a/firmware/target/arm/as3525/kernel-as3525.c +++ b/firmware/target/arm/as3525/kernel-as3525.c @@ -25,18 +25,26 @@ #include "timer-target.h" #ifdef HAVE_SCROLLWHEEL +/* let the timer interrupt twice as often for the scrollwheel polling */ +#define KERNEL_TIMER_FREQ (TIMER_FREQ/2) +#else +#define KERNEL_TIMER_FREQ TIMER_FREQ +#endif + +#ifdef HAVE_SCROLLWHEEL #include "button-target.h" /* The scrollwheel is polled every 5 ms (the tick tasks only every 10) */ -static volatile int poll_scrollwheel = 0; +static int poll_scrollwheel = 0; void INT_TIMER2(void) { if (!poll_scrollwheel) - call_tick_tasks(); /* Run through the list of tick tasks */ + call_tick_tasks(); /* Run through the list of tick tasks + * (that includes reading the scrollwheel) */ else { if (!button_hold()) - button_read_dbop(); + button_read_dbop(); /* Read the scrollwheel */ } poll_scrollwheel ^= 1; @@ -55,7 +63,7 @@ void tick_start(unsigned int interval_in_ms) { int phi = 0; /* prescaler bits */ int prescale = 1; - int cycles = TIMER_FREQ / 1000 * interval_in_ms; + int cycles = KERNEL_TIMER_FREQ / 1000 * interval_in_ms; while(cycles > 0x10000) { diff --git a/firmware/target/arm/as3525/timer-target.h b/firmware/target/arm/as3525/timer-target.h index b5cdb74..21ee6e7 100644 --- a/firmware/target/arm/as3525/timer-target.h +++ b/firmware/target/arm/as3525/timer-target.h @@ -25,14 +25,7 @@ bool __timer_set(long cycles, bool set); bool __timer_register(void); void __timer_unregister(void); -#ifdef HAVE_SCROLLWHEEL -/* The scrollwheel is polled every 5 ms (the tick tasks still every 10ms) */ -#define TIMER_DIV (16*2) -#else -#define TIMER_DIV (16) -#endif - -#define TIMER_FREQ (24000000 / TIMER_DIV) +#define TIMER_FREQ (24000000 / 16) #define __TIMER_SET(cycles, set) \ __timer_set(cycles, set) |