diff options
| author | Björn Stenberg <bjorn@haxx.se> | 2002-08-13 20:58:03 +0000 |
|---|---|---|
| committer | Björn Stenberg <bjorn@haxx.se> | 2002-08-13 20:58:03 +0000 |
| commit | c9ebbaf07eb007f9ff4dc20ab741174131d346a7 (patch) | |
| tree | 54bffb5c03906647d4f4d708ad8440933c30b042 | |
| parent | f385e36a05966e0df8da1f8cf1222fd42171500f (diff) | |
| download | rockbox-c9ebbaf07eb007f9ff4dc20ab741174131d346a7.zip rockbox-c9ebbaf07eb007f9ff4dc20ab741174131d346a7.tar.gz rockbox-c9ebbaf07eb007f9ff4dc20ab741174131d346a7.tar.bz2 rockbox-c9ebbaf07eb007f9ff4dc20ab741174131d346a7.tar.xz | |
Replaced busy loop with sleep()
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1724 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | firmware/drivers/serial.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/firmware/drivers/serial.c b/firmware/drivers/serial.c index ee83e2a..112e45c 100644 --- a/firmware/drivers/serial.c +++ b/firmware/drivers/serial.c @@ -38,26 +38,22 @@ void serial_setup (void) { char dummy; - int i; - int j; dummy = SSR1; - SSR1=0; + SSR1 = 0; SMR1 = 0x00; - SCR1=0; + SCR1 = 0; BRR1 = (FREQ/(32*9600))-1; - + /* let the hardware settle */ - for (i = 0; i < 1000; i++) - j++; + sleep(1); SCR1 = 0x50; /* This enables the serial Rx interrupt*/ IPRE = (IPRE & 0x0FFF) | 0x8000; /* Set to medium priority */ - } -static void process_byte(char byte) +static void process_byte(int byte) { int btn = 0; @@ -109,7 +105,7 @@ void REI1 (void) #pragma interrupt void RXI1 (void) { - char serial_byte; + unsigned char serial_byte; serial_byte = RDR1; SSR1 = SSR1 & ~0x40; /* Clear RDRF */ process_byte(serial_byte); |