summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chip/stm32/i2c-stm32l15x.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/chip/stm32/i2c-stm32l15x.c b/chip/stm32/i2c-stm32l15x.c
index dc138ba107..8434db02f2 100644
--- a/chip/stm32/i2c-stm32l15x.c
+++ b/chip/stm32/i2c-stm32l15x.c
@@ -153,7 +153,9 @@ int i2c_xfer(int port, int slave_addr, const uint8_t *out, int out_bytes,
STM32_I2C_CR1_STOP |
STM32_I2C_CR1_POS |
STM32_I2C_CR1_ACK);
- if (out_bytes) {
+
+ /* No out bytes and no in bytes means just check for active */
+ if (out_bytes || !in_bytes) {
if (!started) {
rv = send_start(port, slave_addr);
if (rv)