Do LVGL label updates need to be wrapped in port lock/unlock? #232
Unanswered
mustafaakh10
asked this question in
Q&A
Replies: 1 comment
-
|
Hi @mustafaakh10, Yes, most of the APIs of LVGL are not thread-safe. In non-LVGL tasks, you need to lock/unlock before and after calling LVGL operations. However, in cases such as LVGL timers or other callbacks, since they are called within the LVGL task, there is no need to perform lock/unlock. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi ,
I wanted to ask what is the best approach regarding updating labels . i have an example below
if (objects.total_power_telemetry) {
// Format power as 3 digits with leading zeros (e.g., 020, 285, 001)
lv_label_set_text_fmt(objects.total_power_telemetry, "%03d", total_power);
}
if (objects.total_current_telemetry) {
// Format current as 2 digits with leading zeros (e.g., 08, 18, 05)
lv_label_set_text_fmt(objects.total_current_telemetry, "%02d", total_current);
}
}
before using the lv_label_set_text should i be wrapping these elements around in lvgl_port_lock(-1); and unlock?
Beta Was this translation helpful? Give feedback.
All reactions