forked from len0rd/rockbox
Fix the problem with the user timer on X5 by explicitly resetting the timer before setting it
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10743 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
28388b131a
commit
798a8c1b76
1 changed files with 4 additions and 0 deletions
|
@ -133,6 +133,10 @@ static bool timer_set(long cycles, bool start)
|
||||||
phi &= ~1; /* timer disabled at start */
|
phi &= ~1; /* timer disabled at start */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If it is already enabled, writing a 0 to the RST bit will clear the
|
||||||
|
register, so we clear RST explicitly before writing the real data. */
|
||||||
|
TMR1 = 0;
|
||||||
|
|
||||||
/* We are using timer 1 */
|
/* We are using timer 1 */
|
||||||
TMR1 = 0x0018 | (unsigned short)phi | ((unsigned short)(prescale - 1) << 8);
|
TMR1 = 0x0018 | (unsigned short)phi | ((unsigned short)(prescale - 1) << 8);
|
||||||
TRR1 = (unsigned short)(cycles - 1);
|
TRR1 = (unsigned short)(cycles - 1);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue