Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(wire): ensure i2c bus is ready #1775

Merged
merged 1 commit into from
Jul 29, 2022
Merged

fix(wire): ensure i2c bus is ready #1775

merged 1 commit into from
Jul 29, 2022

Conversation

fpistm
Copy link
Member

@fpistm fpistm commented Jul 26, 2022

Previously, i2c_master_write and i2c_master_read returned I2C_OK if first HAL call returned HAL_BUSY which was not correct.
Now make sure the i2c is ready, which guarantees a good initialization of the read or write sequence.

Validation

  • i2c scanner
  • i2c memory device (eeprom)
  • temperature sensor (LM75B)
  • Master Reader Writer / Slave Sender Receiver

Fixes #1774

@fpistm fpistm added this to the 2.3.1/2.4.0 milestone Jul 26, 2022
@fpistm fpistm requested a review from ABOSTM July 26, 2022 09:38
@fpistm fpistm added this to In progress in STM32 core based on ST HAL via automation Jul 26, 2022
libraries/Wire/src/utility/twi.c Outdated Show resolved Hide resolved
STM32 core based on ST HAL automation moved this from In progress to Needs review Jul 28, 2022
Previously, i2c_master_write and i2c_master_read returned I2C_OK if
first HAL call returned HAL_BUSY which was not correct.
Now make sure the i2c is ready, which guarantees a good
initialization of the read or write sequence.

Fixes stm32duino#1774

Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Copy link
Contributor

@ABOSTM ABOSTM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

STM32 core based on ST HAL automation moved this from Needs review to Reviewer approved Jul 29, 2022
@fpistm fpistm merged commit e3808a2 into stm32duino:main Jul 29, 2022
STM32 core based on ST HAL automation moved this from Reviewer approved to Done Jul 29, 2022
@fpistm fpistm deleted the i2c_err branch July 29, 2022 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

wrong error management in i2C functions?
2 participants