1
0
Fork 0
forked from len0rd/rockbox

Replaced busy loop with sleep()

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1724 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Björn Stenberg 2002-08-13 20:58:03 +00:00
parent f385e36a05
commit c9ebbaf07e

View file

@ -38,26 +38,22 @@
void serial_setup (void) void serial_setup (void)
{ {
char dummy; char dummy;
int i;
int j;
dummy = SSR1; dummy = SSR1;
SSR1=0; SSR1 = 0;
SMR1 = 0x00; SMR1 = 0x00;
SCR1=0; SCR1 = 0;
BRR1 = (FREQ/(32*9600))-1; BRR1 = (FREQ/(32*9600))-1;
/* let the hardware settle */ /* let the hardware settle */
for (i = 0; i < 1000; i++) sleep(1);
j++;
SCR1 = 0x50; SCR1 = 0x50;
/* This enables the serial Rx interrupt*/ /* This enables the serial Rx interrupt*/
IPRE = (IPRE & 0x0FFF) | 0x8000; /* Set to medium priority */ IPRE = (IPRE & 0x0FFF) | 0x8000; /* Set to medium priority */
} }
static void process_byte(char byte) static void process_byte(int byte)
{ {
int btn = 0; int btn = 0;
@ -109,7 +105,7 @@ void REI1 (void)
#pragma interrupt #pragma interrupt
void RXI1 (void) void RXI1 (void)
{ {
char serial_byte; unsigned char serial_byte;
serial_byte = RDR1; serial_byte = RDR1;
SSR1 = SSR1 & ~0x40; /* Clear RDRF */ SSR1 = SSR1 & ~0x40; /* Clear RDRF */
process_byte(serial_byte); process_byte(serial_byte);