Skip to content

Commit 211045f

Browse files
committed
Improve i2c waveforms
1 parent 6d0e7c9 commit 211045f

File tree

1 file changed

+1
-4
lines changed
  • hardware/arduino/esp8266/cores/esp8266

1 file changed

+1
-4
lines changed

hardware/arduino/esp8266/cores/esp8266/i2c.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ void i2c_set_ack(int ack)
132132

133133
int i2c_get_ack()
134134
{
135-
i2c_wait();
136135
i2c_set_scl(1);
137136
i2c_wait();
138137
int result = i2c_get_sda();
@@ -153,9 +152,7 @@ uint8_t i2c_read(void)
153152
i2c_wait();
154153
result <<= 1;
155154
result |= i2c_get_sda();
156-
i2c_wait(); // <- remove
157155
i2c_set_scl(0);
158-
i2c_wait();
159156
}
160157
return result;
161158
}
@@ -170,8 +167,8 @@ void i2c_write(uint8_t val)
170167
i2c_set_scl(1);
171168
i2c_wait();
172169
i2c_set_scl(0);
173-
i2c_wait();
174170
}
171+
i2c_wait();
175172
i2c_set_sda(1);
176173
}
177174

0 commit comments

Comments
 (0)