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
This commit is contained in:
parent
de93c63834
commit
1bb8657a8f
2 changed files with 4 additions and 4 deletions
|
@ -392,7 +392,7 @@ void tick_start(unsigned int interval_in_ms)
|
|||
TIMER1_CFG = 0x0;
|
||||
TIMER1_VAL;
|
||||
/* enable timer */
|
||||
TIMER1_CFG = 0xc0000000 | (interval_in_ms*1000);
|
||||
TIMER1_CFG = 0xc0000000 | (interval_in_ms*1000 - 1);
|
||||
/* unmask interrupt source */
|
||||
CPU_INT_EN = TIMER1_MASK;
|
||||
#else
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue