We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 96e4e8c commit 3624374Copy full SHA for 3624374
libraries/Wire/src/utility/twi.c
@@ -981,6 +981,11 @@ void i2c_attachSlaveTxEvent(i2c_t *obj, void (*function)(i2c_t *))
981
void HAL_I2C_AddrCallback(I2C_HandleTypeDef *hi2c, uint8_t TransferDirection, uint16_t AddrMatchCode)
982
{
983
i2c_t *obj = get_i2c_obj(hi2c);
984
+ if ((obj->slaveMode == SLAVE_MODE_RECEIVE) && (obj->slaveRxNbData != 0)) {
985
+ obj->i2c_onSlaveReceive(obj);
986
+ obj->slaveMode = SLAVE_MODE_LISTEN;
987
+ obj->slaveRxNbData = 0;
988
+ }
989
990
if (AddrMatchCode == hi2c->Init.OwnAddress1) {
991
if (TransferDirection == I2C_DIRECTION_RECEIVE) {
0 commit comments