Skip to content

I2C multi instances: Remove static qualifier on TwoWire attributes #888

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

Merged
merged 2 commits into from
Jan 31, 2020

Conversation

ABOSTM
Copy link
Contributor

@ABOSTM ABOSTM commented Jan 24, 2020

Summary

I2C buffers, as well as some other attributes of the TwoWire class,
should not be static (shared between instances),
otherwise multi instance I2C doesn't work properly.
For example when MCU is master on one instance and slave on the other,
Slave reception under interruption can happen in the middle of master transmission,
and there is conflict on the shared resources.

fixes #699

I2C buffers, as well as some other attributes of the TwoWire class,
should not be static (shared between instances),
otherwise multi instance I2C doesn't work properly.
For example when MCU is master on one instance and slave on the other,
Slave reception under interruption can happen in the middle of master transmission,
and there is conflict on the shared resources.

fixes stm32duino#699
@fpistm fpistm added the fix 🩹 Bug fix label Jan 24, 2020
@fpistm fpistm added this to the 1.9.0 milestone Jan 24, 2020
@fpistm fpistm self-requested a review January 30, 2020 09:13
With introduction of 'I2C multi instances: Remove static qualifier on TwoWire attributes'
parameters 'inBytes' and 'numBytes' become useless as they are part of new obj structure parameter.
@fpistm fpistm merged commit 97aaf65 into stm32duino:master Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix 🩹 Bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using both I2C lines on STM32F103C8 results in NACKs after some time.
2 participants