Skip to content

fix(Wire): only recover bus when device is master #2758

New issue

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

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

Already on GitHub? # to your account

Merged
merged 1 commit into from
Jul 2, 2025

Conversation

dordnung
Copy link
Contributor

@dordnung dordnung commented Jun 27, 2025

Summary

Fixed an issue in Wire.begin() where the I2C bus recovery routine was always triggered, even when initializing as a slave device. This could lead to unintended manipulation of the SCL line while SDA is low - potentially during an active transmission from the master. Only the master should perform a bus recovery.

This PR fix ensures that the SCL line is not manipulated when Wire.begin() is called in slave mode.

Copy link
Member

@fpistm fpistm left a comment

Choose a reason for hiding this comment

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

LGTM

@fpistm fpistm requested a review from cparata June 27, 2025 15:44
@fpistm fpistm added the fix 🩹 Bug fix label Jun 27, 2025
@fpistm fpistm added this to the 2.11.0 milestone Jun 27, 2025
@github-project-automation github-project-automation bot moved this from In progress to Reviewer approved in STM32 core based on ST HAL Jul 2, 2025
@fpistm fpistm merged commit b6ee1c6 into stm32duino:main Jul 2, 2025
24 checks passed
@github-project-automation github-project-automation bot moved this from Reviewer approved to Done in STM32 core based on ST HAL Jul 2, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
fix 🩹 Bug fix
Projects
Development

Successfully merging this pull request may close these issues.

3 participants