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

Wire1 was not declared in this scope #49

Closed
troglodisme opened this issue Nov 11, 2024 · 5 comments
Closed

Wire1 was not declared in this scope #49

troglodisme opened this issue Nov 11, 2024 · 5 comments
Labels
invalid This doesn't seem right

Comments

@troglodisme
Copy link

troglodisme commented Nov 11, 2024

I have been using the below Tasmota platform in order to get my esp32-c6 to work

platform = https://github.com/tasmota/platform-espressif32/releases/download/2024.08.10/platform-espressif32.zip

I wanted to upgrade to pioarduino in order to use BLE but a lot of my existing libraries won't work as Wire1 seems to not be supported when using the pioarduino platformio? I could modify this library but it's literally the same issue on many i2c devices I use.

Can anyone advise?

pio/libdeps/platformio/M5GFX/src/lgfx/v1/platforms/esp32/common.cpp: In member function 'void lgfx::v1::i2c::i2c_context_t::setPins(i2c_dev_t*, gpio_num_t, gpio_num_t)': .pio/libdeps/platformio/M5GFX/src/lgfx/v1/platforms/esp32/common.cpp:794:51: error: 'Wire1' was not declared in this scope; did you mean 'Wire'? 794 | auto twowire = ((dev == &I2C0) ? &Wire : &Wire1); | ^~~~~ | Wire .pio/libdeps/platformio/M5GFX/src/lgfx/v1/platforms/esp32/common.cpp: In function 'cpp::bitwizeshift::result<void, lgfx::v1::error_t> lgfx::v1::i2c::release(int)': .pio/libdeps/platformio/M5GFX/src/lgfx/v1/platforms/esp32/common.cpp:1003:44: error: 'Wire1' was not declared in this scope; did you mean 'Wire'? 1003 | auto twowire = ((i2c_port == 1) ? &Wire1 : &Wire); | ^~~~~ | Wire .pio/libdeps/platformio/M5GFX/src/lgfx/v1/platforms/esp32/common.cpp: In function 'cpp::bitwizeshift::result<void, lgfx::v1::error_t> lgfx::v1::i2c::setPins(int, int, int)': .pio/libdeps/platformio/M5GFX/src/lgfx/v1/platforms/esp32/common.cpp:1049:42: error: 'Wire1' was not declared in this scope; did you mean 'Wire'? 1049 | auto twowire = ((i2c_port == 1) ? &Wire1 : &Wire); | ^~~~~ | Wire .pio/libdeps/platformio/M5GFX/src/lgfx/v1/platforms/esp32/common.cpp: In function 'cpp::bitwizeshift::result<void, lgfx::v1::error_t> lgfx::v1::i2c::init(int)': .pio/libdeps/platformio/M5GFX/src/lgfx/v1/platforms/esp32/common.cpp:1071:42: error: 'Wire1' was not declared in this scope; did you mean 'Wire'? 1071 | auto twowire = ((i2c_port == 1) ? &Wire1 : &Wire); | ^~~~~ | Wire

@TD-er
Copy link

TD-er commented Nov 11, 2024

Maybe this should include something like soc_caps.h ?
This file defines stuff like SOC_HP_I2C_NUM which is wrapped around the declaration of Wire1.

@sivar2311
Copy link

sivar2311 commented Nov 12, 2024

The LovyanGFX library must respect that the ESP32-C series has only one I2C interface (See espressif/arduino-esp32#10408)

Please file an issue to the LovyanGFX library.

@troglodisme
Copy link
Author

Thanks @sivar2311 the library worked completely fine before switching to pioarduino latest platform.

This happens on many Adafruit libraries as well, not just M5GFX.

Did you test on your end? Thank you!

@TD-er
Copy link

TD-er commented Nov 12, 2024

There has been a recent change in the Arduino code which does actually set the correct number of I2C busses for the C6.
So "worked before" was more like "compiled and didn't crash before as I didn't try to access I2C bus 2". :)

@Jason2866
Copy link

Closing since not an pioarduino issue

@Jason2866 Jason2866 added the invalid This doesn't seem right label Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

4 participants