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

Add support for second I2C port #7878

Open
wants to merge 3 commits into
base: 2027
Choose a base branch
from

Conversation

ThadHouse
Copy link
Member

No description provided.

@ThadHouse ThadHouse requested review from a team as code owners March 21, 2025 01:51
@github-actions github-actions bot added component: wpilibj WPILib Java component: wpilibc WPILib C++ component: hal Hardware Abstraction Layer component: examples 2027 2027 target labels Mar 21, 2025
constexpr const char* physicalPorts[] = {"/dev/i2c-1", "/dev/i2c-10"};

struct I2C {
std::mutex initMutex;
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
std::mutex initMutex;
wpi::mutex initMutex;

int fd = -1;
};

static I2C i2cObjs[2];
Copy link
Member

Choose a reason for hiding this comment

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

Probably should make "2" a constant? There's some range checks elsewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2027 2027 target component: examples component: hal Hardware Abstraction Layer component: wpilibc WPILib C++ component: wpilibj WPILib Java
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants