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

Wire library: Add conditional compilation for second I2C interface based on SOC_I2C_NUM #10408

Merged
merged 2 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions libraries/Wire/src/Wire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,8 @@ void TwoWire::onRequestService(uint8_t num, void *arg) {
#endif /* SOC_I2C_SUPPORT_SLAVE */

TwoWire Wire = TwoWire(0);
#if SOC_I2C_NUM > 1
TwoWire Wire1 = TwoWire(1);
#endif /* SOC_I2C_NUM */

#endif /* SOC_I2C_SUPPORTED */
2 changes: 2 additions & 0 deletions libraries/Wire/src/Wire.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ class TwoWire : public HardwareI2C {
};

extern TwoWire Wire;
#if SOC_I2C_NUM > 1
extern TwoWire Wire1;
#endif /* SOC_I2C_NUM */

#endif /* SOC_I2C_SUPPORTED */
#endif /* TwoWire_h */
Loading