1
0
Fork 0
forked from len0rd/rockbox

Meg F/X: Radically changing divider settings messed up the fake sleep in the bootloader. They aren't reset even after powering off. Make sure they are always specified. Move that code to target tree as well.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19358 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Michael Sevakis 2008-12-07 17:48:42 +00:00
parent 8289b966b8
commit 528ec2a555
2 changed files with 29 additions and 14 deletions

View file

@ -245,19 +245,8 @@ void timeout_register(struct timeout *tmo, timeout_cb_type callback,
void sleep(int ticks)
{
#if CONFIG_CPU == S3C2440 && defined(BOOTLOADER)
volatile int counter;
TCON &= ~(1 << 20); // stop timer 4
// TODO: this constant depends on dividers settings inherited from
// firmware. Set them explicitly somwhere.
TCNTB4 = 12193 * ticks / HZ;
TCON |= 1 << 21; // set manual bit
TCON &= ~(1 << 21); // reset manual bit
TCON &= ~(1 << 22); //autoreload Off
TCON |= (1 << 20); // start timer 4
do {
counter = TCNTO4;
} while(counter > 0);
extern void delay(int ticks);
delay(ticks);
#elif defined(CPU_PP) && defined(BOOTLOADER)
unsigned stop = USEC_TIMER + ticks * (1000000/HZ);
while (TIME_BEFORE(USEC_TIMER, stop))