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

I2C lock #27

Merged
merged 5 commits into from
May 11, 2024
Merged

I2C lock #27

merged 5 commits into from
May 11, 2024

Conversation

linguini1
Copy link
Collaborator

This PR implements the locking and unlocking of the I2C bus mutex to allow for the eventual implementation of multi-threading.

Certain functions in the sensor drivers that use the I2C bus do not lock it, simply because they are functions that are meant to be called in sequence or multiple times (i.e. multiple calls to read byte for extracting data). These functions are marked with WARNING in their docstrings so that callers are aware that they must lock the I2C bus before performing a collection of these calls. This reduces overhead.

@linguini1 linguini1 added the enhancement New feature or request label May 11, 2024
@linguini1 linguini1 self-assigned this May 11, 2024
@linguini1 linguini1 merged commit d76332a into main May 11, 2024
1 check passed
@linguini1 linguini1 deleted the i2c-lock branch May 11, 2024 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant