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/timer.c | |
parent | de93c638344bc0c81d61acb3a93aadcb2e91c7dd (diff) | |
download | rockbox-1bb8657a8f1a3145ae0d66068f142008012da1cb.tar.gz rockbox-1bb8657a8f1a3145ae0d66068f142008012da1cb.tar.bz2 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/timer.c')
-rw-r--r-- | firmware/timer.c | 6 |
1 files changed, 3 insertions, 3 deletions
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) TIMER2_VAL; /* ACK interrupt */ if (cycles_new > 0) { - TIMER2_CFG = 0xc0000000 | cycles_new; + TIMER2_CFG = 0xc0000000 | (cycles_new - 1); cycles_new = 0; } if (pfn_timer != NULL) @@ -151,7 +151,7 @@ static bool timer_set(long cycles, bool start) TCN1 = 0; /* reset the timer */ TER1 = 0xff; /* clear all events */ #elif CONFIG_CPU == PP5020 || CONFIG_CPU == PP5002 - if (cycles > 0x1fffffff) + if (cycles > 0x20000000) return false; if (start) @@ -163,7 +163,7 @@ static bool timer_set(long cycles, bool start) } } if (start || (cycles_new == -1)) /* within isr, cycles_new is "locked" */ - TIMER2_CFG = 0xc0000000 | cycles; /* enable timer */ + TIMER2_CFG = 0xc0000000 | (cycles - 1); /* enable timer */ else cycles_new = cycles; |