Skip to content

Commit 9d02732

Browse files
esp32: Update machine_i2c.c.
Signed-off-by: Vincent1-python <pywei201209@163.com>
1 parent a7f69ab commit 9d02732

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ports/esp32/machine_i2c.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ static int machine_i2c_transfer_single(mp_obj_base_t *self_in, uint16_t addr, si
9595
// 3. Transfer data
9696
if (flags & MP_MACHINE_I2C_FLAG_READ) {
9797
err = i2c_master_receive(dev_handle, buf, len, self->timeout_us / 1000);
98-
} else if (len > 0) {
98+
} else {
9999
err = i2c_master_transmit(dev_handle, buf, len, self->timeout_us / 1000);
100100
}
101101
// 4. Destroy the temporary handle

0 commit comments

Comments
 (0)