Skip to content

Commit f3af437

Browse files
committed
I2C SDA should properly register the ACK bit from some slaves
1 parent cc3c55b commit f3af437

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cores/esp32/esp32-hal-i2c.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
void i2cAttachSCL(i2c_t * i2c, int8_t scl)
2828
{
29-
pinMode(scl, INPUT);
29+
pinMode(scl, OUTPUT_OPEN_DRAIN);
3030
pinMatrixOutAttach(scl, I2C_SCL_IDX(i2c->num), false, false);
3131
pinMatrixInAttach(scl, I2C_SCL_IDX(i2c->num), false);
3232
}
@@ -40,7 +40,7 @@ void i2cDetachSCL(i2c_t * i2c, int8_t scl)
4040

4141
void i2cAttachSDA(i2c_t * i2c, int8_t sda)
4242
{
43-
pinMode(sda, INPUT);
43+
pinMode(sda, OUTPUT_OPEN_DRAIN);
4444
pinMatrixOutAttach(sda, I2C_SDA_IDX(i2c->num), false, false);
4545
pinMatrixInAttach(sda, I2C_SDA_IDX(i2c->num), false);
4646
}

0 commit comments

Comments
 (0)