summaryrefslogtreecommitdiff
path: root/firmware/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers')
-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)
int i2c_getack(void)
{
- unsigned short x;
+ int ret = 1;
/* Here's the deal. The MAS is slow, and sometimes needs to wait
before it can send the acknowledge. Therefore it forces the clock
@@ -119,15 +119,15 @@ int i2c_getack(void)
while(!SCL) /* and wait for the MAS to release it */
yield();
- x = SDA;
- if (x)
+ if (SDA)
/* ack failed */
- return 0;
+ ret = 0;
+
SCL_OUTPUT;
SCL_LO;
SDA_HI;
SDA_OUTPUT;
- return 1;
+ return ret;
}
void i2c_outb(unsigned char byte)