summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/drivers/i2c.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/firmware/drivers/i2c.c b/firmware/drivers/i2c.c
index 3ef2f48a6b..e9b06edb42 100644
--- a/firmware/drivers/i2c.c
+++ b/firmware/drivers/i2c.c
@@ -105,7 +105,7 @@ void i2c_ack(int bit)
105 105
106int i2c_getack(void) 106int i2c_getack(void)
107{ 107{
108 unsigned short x; 108 int ret = 1;
109 109
110 /* Here's the deal. The MAS is slow, and sometimes needs to wait 110 /* Here's the deal. The MAS is slow, and sometimes needs to wait
111 before it can send the acknowledge. Therefore it forces the clock 111 before it can send the acknowledge. Therefore it forces the clock
@@ -119,15 +119,15 @@ int i2c_getack(void)
119 while(!SCL) /* and wait for the MAS to release it */ 119 while(!SCL) /* and wait for the MAS to release it */
120 yield(); 120 yield();
121 121
122 x = SDA; 122 if (SDA)
123 if (x)
124 /* ack failed */ 123 /* ack failed */
125 return 0; 124 ret = 0;
125
126 SCL_OUTPUT; 126 SCL_OUTPUT;
127 SCL_LO; 127 SCL_LO;
128 SDA_HI; 128 SDA_HI;
129 SDA_OUTPUT; 129 SDA_OUTPUT;
130 return 1; 130 return ret;
131} 131}
132 132
133void i2c_outb(unsigned char byte) 133void i2c_outb(unsigned char byte)