Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of mbed-dev by
Diff: targets/hal/TARGET_STM/TARGET_STM32F7/i2c_api.c
- Revision:
- 34:bb6061527455
- Parent:
- 0:9b334a45a8ff
- Child:
- 74:9322579e4309
--- a/targets/hal/TARGET_STM/TARGET_STM32F7/i2c_api.c Thu Dec 03 15:15:11 2015 +0000 +++ b/targets/hal/TARGET_STM/TARGET_STM32F7/i2c_api.c Mon Dec 07 08:00:11 2015 +0000 @@ -183,6 +183,14 @@ // Clear Acknowledge failure flag __HAL_I2C_CLEAR_FLAG(&I2cHandle, I2C_FLAG_AF); + // Wait the STOP condition has been previously correctly sent + timeout = FLAG_TIMEOUT; + while ((i2c->CR2 & I2C_CR2_STOP) == I2C_CR2_STOP){ + if ((timeout--) == 0) { + return 1; + } + } + // Generate the START condition i2c->CR2 |= I2C_CR2_START;