GOB52 / gob_unifiedButton

Add software touch buttons for CoreS3 and Tough, and commonality with conventional buttons (M5.BtnX)
https://gob52.github.io/gob_unifiedButton/
MIT License
10 stars 0 forks source link

Arduino core for the ESP32 3.0.1 problem #2

Closed GrandeRipper closed 4 months ago

GrandeRipper commented 4 months ago

Hello, which board manager are you using? So far I have used the toolchains from M5 Stack: https://static-cdn.m5stack.com/resource/arduino/package_m5stack_index.json

However, this uses the ESP32 tool version 2.1.1. For various reasons, I would like to switch to the Arduino core for the ESP32 https://espressif.github.io/arduino-esp32/package_esp32_index.json. It also offers the M5 stack as a board definition. But now I get the following error:

Documents\Arduino\libraries\gob_unifiedButton\src\gob_unifiedButton.cpp: In member function 'void goblib::UnifiedButton::create_buttons(appearance_t)': Documents\Arduino\libraries\gob_unifiedButton\src\gob_unifiedButton.cpp:61:30: error: no matching function for call to 'lgfx::v1::LGFX_Button::initButtonUL(LovyanGFX&, long unsigned int, int32_t&, int32_t&, int32_t&, const int32_t&, const int&, const int&, const char const&)' 61 | _btns[i].initButtonUL(_gfx, left + w i, top, w, h, olClr, TFT_DARKGRAY, TFT_BLACK,label_table[i]); | ~~~~~^~~~~~~~~~~~~~~~~~ In file included from Documents\Arduino\libraries\M5GFX\src/M5GFX.h:24, from Documents\Arduino\libraries\M5Unified\src/M5Unified.hpp:19: Documents\Arduino\libraries\M5GFX\src/lgfx/v1/LGFX_Button.hpp:45:10: note: candidate: 'template void lgfx::v1::LGFX_Button::initButtonUL(lgfx::v1::LovyanGFX, int16_t, int16_t, uint16_t, uint16_t, const T&, const T&, const T&, const char, float, float)' 45 | void initButtonUL( LovyanGFX gfx, int16_t x, int16_t y, uint16_t w, uint16_t h | ^~~~ Documents\Arduino\libraries\M5GFX\src/lgfx/v1/LGFX_Button.hpp:45:10: note: template argument deduction/substitution failed: \Arduino\libraries\gob_unifiedButton\src\gob_unifiedButton.cpp:61:30: note: deduced conflicting types for parameter 'const T' ('long int' and 'int') 61 | _btns[i].initButtonUL(_gfx, left + w * i, top, w, h, olClr, TFT_DARKGRAY, TFT_BLACK,label_table[i]);

Compilation error: exit status 1

Do you have an idea? Best regards

GOB52 commented 4 months ago

This library relies on M5Unified/M5GFX. rather than M5Core or other libraries.

See also https://github.com/m5stack/M5Unified https://docs.m5stack.com/en/arduino/m5unified/migration

GOB52 commented 4 months ago

If you have a small source that can reproduce the situation, please write it down or give us the URL if it is on GitHub or elsewhere.

GrandeRipper commented 4 months ago

if i use your example @https://github.com/GOB52/gob_unifiedButton/tree/master/examples/simple i got these: Error

M5Unified/M5GFX is installed

GOB52 commented 4 months ago

Thank you for reply. I will investigate, but just to be sure, check the versions of M5Unified and M5GFX in the Library Manager.

GrandeRipper commented 4 months ago

M5Unified = 0.1.16 M5GFX = 0.1.16

Thanks

GOB52 commented 4 months ago

[FYI] My board manager URL

https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/arduino/package_m5stack_index.json
GOB52 commented 4 months ago

Compilation succeeds in ArduinoIDE in my environment.

log https://gist.github.com/GOB52/3c42347e46aad9f08b233b6f783ba022

Please paste your full log (If it's too long to paste, use e.g. Gist)

gob_unifiedButton_issue2_000

GrandeRipper commented 4 months ago

[FYI] My board manager URL

https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/arduino/package_m5stack_index.json

Hello and thank you for your effort, you are right, your library works with this version. However, if I see correctly, it uses an old Arduino ESP32 core: package_m5stack_index.json "name": "M5Stack" "architecture": "esp32" "version": "2.1.1" I came across this because I wanted to use timers and the esp32-hal-timer.h includes other functions than are used in examples on the internet. I therefore tried to include the current ESP32 core and found that the various board definitions for M5Stack are already available in the Arduino core from espressif. Therefore I think that the M5 website link might not be up to date anymore. Also M5Unified.h does not seem to use the current core yet, see #warning "This set of I2S APIs has been deprecated" and so on.

Logfile: https://gist.github.com/GrandeRipper/66e47dfea1f565284282a752abc4fa5a

GOB52 commented 4 months ago

Thanks for the information, it helped me understand the situation. I will also discuss this with the M5Unified maintainer.

GOB52 commented 4 months ago

Fixed type inference in templates to work correctly. Please try develop branch.

GrandeRipper commented 4 months ago

I checked your develop branch and it worked fine. Thanks

GOB52 commented 2 weeks ago

@GrandeRipper A late but supported version 0.1.6 has been officially released.