We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 169f42d commit 65335d8Copy full SHA for 65335d8
libraries/Wire/src/utility/twi.c
@@ -980,6 +980,11 @@ void i2c_attachSlaveTxEvent(i2c_t *obj, void (*function)(i2c_t *))
980
void HAL_I2C_AddrCallback(I2C_HandleTypeDef *hi2c, uint8_t TransferDirection, uint16_t AddrMatchCode)
981
{
982
i2c_t *obj = get_i2c_obj(hi2c);
983
+ if ((obj->slaveMode == SLAVE_MODE_RECEIVE) && (obj->slaveRxNbData != 0)) {
984
+ obj->i2c_onSlaveReceive(obj);
985
+ obj->slaveMode = SLAVE_MODE_LISTEN;
986
+ obj->slaveRxNbData = 0;
987
+ }
988
989
if (AddrMatchCode == hi2c->Init.OwnAddress1) {
990
if (TransferDirection == I2C_DIRECTION_RECEIVE) {
0 commit comments