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

Move to per i2c bus mutex in Qurt i2c driver #23531

Merged
merged 1 commit into from
Feb 19, 2025
Merged

Conversation

katzfey
Copy link
Contributor

@katzfey katzfey commented Aug 9, 2024

Solved Problem

The i2c driver for Qurt uses a single mutex for all buses. If a single bus has a long timeout it can hold up activity on the other buses needlessly. This PR changes the single mutex into a mutex for each bus to avoid that issue.

@@ -124,10 +124,18 @@ class __EXPORT I2C : public CDev
private:
uint32_t _frequency{0};
int _i2c_fd{-1};
pthread_mutex_t *_mutex;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
pthread_mutex_t *_mutex;
pthread_mutex_t *_mutex{nullptr};

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dagar Updated

@katzfey katzfey force-pushed the pr-qurt_i2c_mutex_per_bus branch from 20a218c to 000f7f2 Compare February 18, 2025 22:16
@dagar dagar merged commit 73dbeca into main Feb 19, 2025
63 checks passed
@dagar dagar deleted the pr-qurt_i2c_mutex_per_bus branch February 19, 2025 15:59
JoelJ18 pushed a commit to microstrain-robotics/PX4-Autopilot that referenced this pull request Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants