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

Adds definition for WIRE_INTERFACES_COUNT #1182 #1921

Merged
merged 2 commits into from Jan 2, 2024

Conversation

freespace
Copy link
Contributor

so those libraries which rely on it can detect and use Wire1. e.g. u8g2 will not use Wire1 unless this is (a) defined and (b) >1. This constant is defined on other cores, e.g. for SAMD based boards.

This should resolve situations like that reported in #1182.

I am not entirely sure if WIRE_INTERFACES_COUNT should be defined in common.h, as in other cores it is defined in variant-specific headers, e.g.

https://github.com/search?q=repo%3Aarduino%2FArduinoCore-samd%20WIRE_INTERFACES_COUNT&type=code

However given that generic/pins_arduino.h defines pins for both I2C0 and I2C1, this doesn't seem unreasonable. i.e. the generic variant already assumes the presence of 2 I2C peripherals.

…ly on it can detect and use...

Wire1. e.g. u8g2 will not use Wire1 unless this is (a) defined and (b) >1. This constant is defined
on other cores, e.g. for SAMD based boards.
Copy link
Owner

@earlephilhower earlephilhower left a comment

Choose a reason for hiding this comment

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

Thanks for this, but we already have a per-device flag that should be used instead of a fixed 2, WIRE_HOWMANY. Can you change the (2) to (WIRE_HOWMANY) please?

@freespace
Copy link
Contributor Author

@earlephilhower thanks for letting me know! I will make the change, test and update :)

…RE_HOWMANY which is set by...

variants to indicate the number of I2Cs available to the user.
Copy link
Owner

@earlephilhower earlephilhower left a comment

Choose a reason for hiding this comment

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

Great, thanks!

@earlephilhower earlephilhower merged commit 0425552 into earlephilhower:master Jan 2, 2024
12 checks passed
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