From c3b428162fd03250f319509bcc81337887f34954 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Thu, 19 Mar 2015 23:45:03 +0300 Subject: [PATCH] Improve i2c waveforms --- cores/esp8266/i2c.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cores/esp8266/i2c.cpp b/cores/esp8266/i2c.cpp index 063593acb..a0f124ae4 100644 --- a/cores/esp8266/i2c.cpp +++ b/cores/esp8266/i2c.cpp @@ -132,7 +132,6 @@ void i2c_set_ack(int ack) int i2c_get_ack() { - i2c_wait(); i2c_set_scl(1); i2c_wait(); int result = i2c_get_sda(); @@ -153,9 +152,7 @@ uint8_t i2c_read(void) i2c_wait(); result <<= 1; result |= i2c_get_sda(); - i2c_wait(); // <- remove i2c_set_scl(0); - i2c_wait(); } return result; } @@ -170,8 +167,8 @@ void i2c_write(uint8_t val) i2c_set_scl(1); i2c_wait(); i2c_set_scl(0); - i2c_wait(); } + i2c_wait(); i2c_set_sda(1); }