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 /firmware | |
parent | aa7b081baddeebd8cff89477a6428aa5f2dd502c (diff) | |
download | rockbox-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')
-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 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) */ |
30 | static volatile int poll_scrollwheel = 0; | 37 | static int poll_scrollwheel = 0; |
31 | 38 | ||
32 | void INT_TIMER2(void) | 39 | void 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 | { |
diff --git a/firmware/target/arm/as3525/timer-target.h b/firmware/target/arm/as3525/timer-target.h index b5cdb74e85..21ee6e7804 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); | |||
25 | bool __timer_register(void); | 25 | bool __timer_register(void); |
26 | void __timer_unregister(void); | 26 | void __timer_unregister(void); |
27 | 27 | ||
28 | #ifdef HAVE_SCROLLWHEEL | 28 | #define TIMER_FREQ (24000000 / 16) |
29 | /* The scrollwheel is polled every 5 ms (the tick tasks still every 10ms) */ | ||
30 | #define TIMER_DIV (16*2) | ||
31 | #else | ||
32 | #define TIMER_DIV (16) | ||
33 | #endif | ||
34 | |||
35 | #define TIMER_FREQ (24000000 / TIMER_DIV) | ||
36 | 29 | ||
37 | #define __TIMER_SET(cycles, set) \ | 30 | #define __TIMER_SET(cycles, set) \ |
38 | __timer_set(cycles, set) | 31 | __timer_set(cycles, set) |