From 9fbb834dfb669885929e3a56181129086a2ab57f Mon Sep 17 00:00:00 2001 From: petrd Date: Tue, 18 Aug 2015 00:35:28 +0200 Subject: [PATCH] Update core_esp8266_si2c.c Repair I2C communication issue 698 https://github.com/esp8266/Arduino/issues/698 --- hardware/esp8266com/esp8266/cores/esp8266/core_esp8266_si2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hardware/esp8266com/esp8266/cores/esp8266/core_esp8266_si2c.c b/hardware/esp8266com/esp8266/cores/esp8266/core_esp8266_si2c.c index 1db11bb874..40c15edb86 100644 --- a/hardware/esp8266com/esp8266/cores/esp8266/core_esp8266_si2c.c +++ b/hardware/esp8266com/esp8266/cores/esp8266/core_esp8266_si2c.c @@ -150,7 +150,7 @@ static unsigned char twi_read_byte(bool nack) { unsigned char twi_writeTo(unsigned char address, unsigned char * buf, unsigned int len, unsigned char sendStop){ unsigned int i; if(!twi_write_start()) return 4;//line busy - if(!twi_write_byte(((address << 1) | 0) & 0xFF)) return 2;//received NACK on transmit of address + if(!twi_write_byte(((address << 1) | 0) & 0xFF)) {twi_write_stop();return 2;}//received NACK on transmit of address for(i=0; i