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

Serialize requests to the ATECC508A #17

Merged
merged 3 commits into from
Feb 7, 2019
Merged

Serialize requests to the ATECC508A #17

merged 3 commits into from
Feb 7, 2019

Conversation

fhunleth
Copy link
Contributor

@fhunleth fhunleth commented Feb 5, 2019

No description provided.

Copy link
Contributor

@mobileoverlord mobileoverlord left a comment

Choose a reason for hiding this comment

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

Looks good. Just curious, is it problematic if two devices open the same i2c bus and talk to different devices or is it only if multiple processes try to talk to the same device?

@fhunleth
Copy link
Contributor Author

fhunleth commented Feb 6, 2019

Two devices on the same bus works. Linux will serialize the I2C commands on the bus.

This prevents multiple processes that are using the ATECC508A from
stepping on each other. The symptoms are usually that one process
crashes since the wakeup message will timeout if the chip is busy.

This commit refactors the I2C transport to start a named GenServer for
each unique ATECC508A. Requests are serialized through that GenServer.
The GenServer is supervised in the ATECC508A's supervision tree.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants