1
0
Fork 0
forked from len0rd/rockbox

Prevent unlikely endless loop.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10637 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Miika Pekkarinen 2006-08-17 18:23:50 +00:00
parent f70e45ac29
commit f5e78674ff

View file

@ -46,7 +46,7 @@
#define SCL ( 0x00001000 & GPIO_READ) #define SCL ( 0x00001000 & GPIO_READ)
#define SCL_OUT_LO and_l(~0x00001000, &GPIO_OUT) #define SCL_OUT_LO and_l(~0x00001000, &GPIO_OUT)
#define SCL_LO or_l( 0x00001000, &GPIO_ENABLE) #define SCL_LO or_l( 0x00001000, &GPIO_ENABLE)
#define SCL_HI and_l(~0x00001000, &GPIO_ENABLE); while(!SCL); #define SCL_HI and_l(~0x00001000, &GPIO_ENABLE)
/* SDA is GPIO1, 13 */ /* SDA is GPIO1, 13 */
#define SDA ( 0x00002000 & GPIO1_READ) #define SDA ( 0x00002000 & GPIO1_READ)
@ -92,6 +92,7 @@ static void sw_i2c_stop(void)
static void sw_i2c_ack(void) static void sw_i2c_ack(void)
{ {
SCL_LO; SCL_LO;
DELAY;
SDA_LO; SDA_LO;
DELAY; DELAY;
@ -105,6 +106,7 @@ static bool sw_i2c_getack(void)
int count = 10; int count = 10;
SCL_LO; SCL_LO;
DELAY;
SDA_HI; /* sets to input */ SDA_HI; /* sets to input */
DELAY; DELAY;
SCL_HI; SCL_HI;