Skip to content

Commit

Permalink
[gen2] hal: Fixes I2C bus missing stretch configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugene committed Jun 17, 2019
1 parent f1d521d commit 1b3332e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hal/src/stm32f2xx/i2c_hal.c
Expand Up @@ -1026,6 +1026,9 @@ static void HAL_I2C_EV_InterruptHandler(HAL_I2C_Interface i2c)
// the device will continue pulling SCL low. To avoid that, disable clock stretching
// when the tx buffer is exhausted to release SCL.
I2C_StretchClockCmd(i2cMap[i2c]->I2C_Peripheral, DISABLE);
__DSB();
__ISB();
I2C_StretchClockCmd(i2cMap[i2c]->I2C_Peripheral, i2cMap[i2c]->clkStretchingEnabled ? ENABLE : DISABLE);
}
break;

Expand Down

0 comments on commit 1b3332e

Please sign in to comment.