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:
parent
f385e36a05
commit
c9ebbaf07e
1 changed files with 6 additions and 10 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue