Description
Wanted to share my personal experience migrating from one version of LVGL v.8.3.x to v.9.0 in the Arduino environment. The lines of code outlined below resolved so many unusual behaviors and issues that surfaced from the migration. I hope that the code helps others so they don’t have to spend as much time as I did to resolve these matters.
What MCU/Processor/Board and compiler are you using?
ESP32C3 + Arduino 2.2.1
What LVGL version are you using?
v.9.0
What do you want to achieve?
What have you tried so far?
Code to reproduce
Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.
The code block(s) should be formatted like:
unsigned long prior_tick_Millis=millis();
// the following is a key element required for v9.0 vs v8.x
// you must keep track of the time otherwise really odd behavior will result from the widgets and device
void handleTicks(void){
lv_timer_handler(); /* let the GUI do its work */
unsigned long tickMillis = millis()-prior_tick_Millis;
prior_tick_Millis=millis();
lv_tick_inc(tickMillis);
yield();
}
//call the above function in the "loop" routine and at any point where you need to refresh screen.