Closed lambrou closed 3 years ago
looks like something changed with lvgl in the last two months
@PaintYourDragon take a look some time this week?
I just found this: According to: https://github.com/lvgl/lvgl/blob/master/CHANGELOG.md There is a planned release on 07.07.2020 that will
- Add user_data to themes
It may get fixed on its own.
oki for now you can use an earlier version of lvgl
Confirmed, please use a 2.X release of lv_arduino for the time being.
Version 3 of lv_arduino introduced a number of breaking changes. Not just user_data, but some function names and very different behavior with styles. This is going to require changes to LvGL_Glue and all of the widget examples.
If you want to brave it on your own with 3.x, in lv_conf.h you must enable user_data explicitly (it's no longer the default, but LvGL_Glue requires it):
That’ll fix the user_data parts, and the “Hello” examples will compile and run. Beyond that it gets complicated. The btnm functions have been renamed btnmatrix (it’s possible other widget functions have been renamed, I haven’t gone through the whole set). Handling of styles is altogether different and is not a search-and-replace operation. Looking at newer LittlevGL examples might be helpful there, I don’t know.
Another thing that has changed: if you enable LV_USE_LOG
you will discover that the logging callback function prototype has changed.
Previously, it was:
typedef void (*lv_log_print_g_cb_t)(lv_log_level_t level, const char *, uint32_t, const char *);
Now, it is:
typedef void (*lv_log_print_g_cb_t)(lv_log_level_t level, const char *, uint32_t, const char *, const char *);
This results in compilation errors similar to below:
.pio/libdeps/featheresp32/Adafruit LittlevGL Glue Library/Adafruit_LvGL_Glue.cpp: In member function 'LvGLStatus Adafruit_LvGL_Glue::begin(Adafruit_SPITFT*, void*, bool)':
.pio/libdeps/featheresp32/Adafruit LittlevGL Glue Library/Adafruit_LvGL_Glue.cpp:324:38: error: invalid conversion from 'void (*)(lv_log_level_t, const char*, uint32_t, const char*) {aka void (*)(signed char, const char*, unsigned int, const char*)}' to 'lv_log_print_g_cb_t {aka void (*)(signed char, const char*, unsigned int, const char*, const char*)}' [-fpermissive]
lv_log_register_print_cb(lv_debug); // Register debug print function
Confirmed, please use a 2.X release of lv_arduino for the time being.
Version 3 of lv_arduino introduced a number of breaking changes. Not just user_data, but some function names and very different behavior with styles. This is going to require changes to LvGL_Glue and all of the widget examples.
If you want to brave it on your own with 3.x, in lv_conf.h you must enable user_data explicitly (it's no longer the default, but LvGL_Glue requires it):
define LV_USE_USER_DATA 1
That’ll fix the user_data parts, and the “Hello” examples will compile and run. Beyond that it gets complicated. The btnm functions have been renamed btnmatrix (it’s possible other widget functions have been renamed, I haven’t gone through the whole set). Handling of styles is altogether different and is not a search-and-replace operation. Looking at newer LittlevGL examples might be helpful there, I don’t know.
@PaintYourDragon, Apologies if there is another post answering this (I haven't been able to find anything recent) but I am trying to better understand myself the gaps between the 2.1.5 and updating to the 3.X version of lv-arduino.
I currently have an app working with 2.1.5, but there are a few things in the latest version of LVGL that i would love to take advantage of. If I were to upgrade to v3.X of lv_arduino, and I make that change you mention above to resolve the user_data change, are there a bunch of dependencies the the lvgl_Glue library has which i would also need to fix? I am not using any of the examples and so if those break that's OK, and I am also able to go and update my own app code to use the new LVGL v7 semantics (such as Styles), but where I am unsure of is if there is a whole bucket of other things that the Glue library does that I would be missing.
Thanks for the help.
if you are able to get it working with the latest version and submit a PR, we'd review it...however we'd not merge code that breaks any examples
I don’t recall any dependency changes…last I checked, it was just the required configuration and function name changes mentioned above. But it’s been a while.
The guide and examples will stick with 2.X for the time being. If you can get things to compile with 3.X, best bet might be to mash up LvGL_Glue examples for the display setup and code from the lv_examples (a separate download in the Library Manager) for the 3.X-ification.
@PaintYourDragon - you are correct. I went through and made the change you mentioned:
And that was all that was needed to get it working. I didn't make any other changes and I have been able to use v7 with the new lvgl style implementation.
The only issue I have seen is the one mentioned in this issue: https://github.com/lvgl/lvgl/issues/1241 where the placeholder alignment doesn't follow in an textarea.
Arduino board: ESP32S2
Arduino IDE version (found in Arduino -> About Arduino menu): 1.8.12
List the steps to reproduce the problem below (if possible attach a sketch or copy the sketch code in too):
Errors: