I am new to LVGL and may have misunderstood something. I am trying to use callbacks to increment and decrement a float when the button is pressed. The float does indeed increment and decrement correctly but it then crashes when you release the button. If you change LV_EVENTS_PRESSED to PRESSING it will continually change the float but again will crash the moment you release the button.
What MCU/Processor/Board and compiler are you using?
I am using a WT32 SC01 Plus display that has a ESP32S3 and PlatfromIO
Maybe your code crash on other place. And too your code is waste of res. Dont use userdata here. Simply manipulate in cb directly TargetTime global variable.
Found it. Hopefully this will help someone else that is also learning.
Short story, if you edit ui.events.c you must comment out the squareline created add event cb in ui.#insert screen name#.c
Long story
Squareline Studio creates a callback event in ui.#insert screen name#.c and it passes NULL. Untouched this is fine but when you edit the functions ui_events.c it is not fine. We have modified ui_events.c to do math on what is passed in and you obviously can’t add or subtract from NULL.
So why does it only crash when you release the button? In ui.c we have another bit of Squareline generated code