1
0
Fork 0
forked from len0rd/rockbox

Now yields when waiting for flow control

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@607 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Linus Nielsen Feltzing 2002-05-16 21:20:52 +00:00
parent 0e085999d5
commit 250c3b65df

View file

@ -18,6 +18,7 @@
****************************************************************************/ ****************************************************************************/
#include "lcd.h" #include "lcd.h"
#include "sh7034.h" #include "sh7034.h"
#include "kernel.h"
#include "debug.h" #include "debug.h"
#define PB13 0x2000 #define PB13 0x2000
@ -94,7 +95,8 @@ void i2c_ack(int bit)
SDA_LO; SDA_LO;
SCL_INPUT; /* Set the clock to input */ SCL_INPUT; /* Set the clock to input */
while(!SCL); /* and wait for the MAS to release it */ while(!SCL) /* and wait for the MAS to release it */
yield();
DELAY; DELAY;
SCL_OUTPUT; SCL_OUTPUT;
@ -114,8 +116,9 @@ int i2c_getack(void)
SDA_INPUT; /* And set to input */ SDA_INPUT; /* And set to input */
SCL_LO; /* Set the clock low */ SCL_LO; /* Set the clock low */
SCL_INPUT; /* Set the clock to input */ SCL_INPUT; /* Set the clock to input */
while(!SCL); /* and wait for the MAS to release it */ while(!SCL) /* and wait for the MAS to release it */
yield();
x = SDA; x = SDA;
if (x) if (x)
/* ack failed */ /* ack failed */