diff options
Diffstat (limited to 'os/hal/src/i2c.c')
-rw-r--r-- | os/hal/src/i2c.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/os/hal/src/i2c.c b/os/hal/src/i2c.c index b233764f5..9676a3250 100644 --- a/os/hal/src/i2c.c +++ b/os/hal/src/i2c.c @@ -178,7 +178,11 @@ void i2cMasterTransmit(I2CDriver *i2cp, i2cp->id_state = I2C_ACTIVE_TRANSMIT;
i2c_lld_master_transmit(i2cp, slave_addr, txbuf, txbytes, rxbuf, rxbytes);
+#if I2C_SUPPORTS_CALLBACKS
_i2c_wait_s(i2cp);
+#else
+ i2cp->id_state = I2C_READY;
+#endif /* I2C_SUPPORTS_CALLBACKS */
}
/**
@@ -216,7 +220,11 @@ void i2cMasterReceive(I2CDriver *i2cp, i2cp->id_state = I2C_ACTIVE_RECEIVE;
i2c_lld_master_receive(i2cp, slave_addr, rxbuf, rxbytes);
+#if I2C_SUPPORTS_CALLBACKS
_i2c_wait_s(i2cp);
+#else
+ i2cp->id_state = I2C_READY;
+#endif /* I2C_SUPPORTS_CALLBACKS */
}
|