diff options
author | Jens Arnold <amiconn@rockbox.org> | 2006-09-01 06:13:33 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2006-09-01 06:13:33 +0000 |
commit | 1bb8657a8f1a3145ae0d66068f142008012da1cb (patch) | |
tree | 24b710744df1a54e74e62eab867516bce2d25298 /firmware | |
parent | de93c638344bc0c81d61acb3a93aadcb2e91c7dd (diff) | |
download | rockbox-1bb8657a8f1a3145ae0d66068f142008012da1cb.tar.gz rockbox-1bb8657a8f1a3145ae0d66068f142008012da1cb.zip |
Fixed an off-by-one error in the portalplayer timer handling.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10837 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/kernel.c | 2 | ||||
-rw-r--r-- | firmware/timer.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/firmware/kernel.c b/firmware/kernel.c index b4123fe3ca..889f950252 100644 --- a/firmware/kernel.c +++ b/firmware/kernel.c | |||
@@ -392,7 +392,7 @@ void tick_start(unsigned int interval_in_ms) | |||
392 | TIMER1_CFG = 0x0; | 392 | TIMER1_CFG = 0x0; |
393 | TIMER1_VAL; | 393 | TIMER1_VAL; |
394 | /* enable timer */ | 394 | /* enable timer */ |
395 | TIMER1_CFG = 0xc0000000 | (interval_in_ms*1000); | 395 | TIMER1_CFG = 0xc0000000 | (interval_in_ms*1000 - 1); |
396 | /* unmask interrupt source */ | 396 | /* unmask interrupt source */ |
397 | CPU_INT_EN = TIMER1_MASK; | 397 | CPU_INT_EN = TIMER1_MASK; |
398 | #else | 398 | #else |
diff --git a/firmware/timer.c b/firmware/timer.c index fd9bee2488..8523805890 100644 --- a/firmware/timer.c +++ b/firmware/timer.c | |||
@@ -55,7 +55,7 @@ void TIMER2(void) | |||
55 | TIMER2_VAL; /* ACK interrupt */ | 55 | TIMER2_VAL; /* ACK interrupt */ |
56 | if (cycles_new > 0) | 56 | if (cycles_new > 0) |
57 | { | 57 | { |
58 | TIMER2_CFG = 0xc0000000 | cycles_new; | 58 | TIMER2_CFG = 0xc0000000 | (cycles_new - 1); |
59 | cycles_new = 0; | 59 | cycles_new = 0; |
60 | } | 60 | } |
61 | if (pfn_timer != NULL) | 61 | if (pfn_timer != NULL) |
@@ -151,7 +151,7 @@ static bool timer_set(long cycles, bool start) | |||
151 | TCN1 = 0; /* reset the timer */ | 151 | TCN1 = 0; /* reset the timer */ |
152 | TER1 = 0xff; /* clear all events */ | 152 | TER1 = 0xff; /* clear all events */ |
153 | #elif CONFIG_CPU == PP5020 || CONFIG_CPU == PP5002 | 153 | #elif CONFIG_CPU == PP5020 || CONFIG_CPU == PP5002 |
154 | if (cycles > 0x1fffffff) | 154 | if (cycles > 0x20000000) |
155 | return false; | 155 | return false; |
156 | 156 | ||
157 | if (start) | 157 | if (start) |
@@ -163,7 +163,7 @@ static bool timer_set(long cycles, bool start) | |||
163 | } | 163 | } |
164 | } | 164 | } |
165 | if (start || (cycles_new == -1)) /* within isr, cycles_new is "locked" */ | 165 | if (start || (cycles_new == -1)) /* within isr, cycles_new is "locked" */ |
166 | TIMER2_CFG = 0xc0000000 | cycles; /* enable timer */ | 166 | TIMER2_CFG = 0xc0000000 | (cycles - 1); /* enable timer */ |
167 | else | 167 | else |
168 | cycles_new = cycles; | 168 | cycles_new = cycles; |
169 | 169 | ||