Fix compilation error on ESP32C3 #424
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes the issue #419 & #370 when using the library targeting an ESP32C3 which has only one i2c interface.
The original code has a compilation directive for ESP32 to allow using
Wire
orWire1
interface butWire1
is not present in the SDK of the ESP32C3, resulting in a compilation error.In the issue #419 it was suggested to adapt the constructor by passing the bus as argument but I could not find a way to pass it and setting a specific geometry.
This solution uses the constant
CONFIG_IDF_TARGET_ESP32C3
to prevent the use ofWire1
.Tested on y program on which the build failed, now build and runs perfectly.
I implemented the fix for SSD1306 class because I use this kind of display, but I did the same for SH1106 class, without being able to test it.