Some delay while using lv groups

I created a project in which i use encoder, there is some delay that makes my working run slow. i have found where the problem is. i have attached the code in which i get that delay which makes my working slow. can anyone please give any idea for running my project clearly. The code is given below,

static void focus_next_core(lv_group_t * group, void * (*begin)(const lv_ll_t *),
void * (*move)(const lv_ll_t *, const void *))
{
if(group->frozen) return;

lv_obj_t ** obj_next     = group->obj_focus;
lv_obj_t ** obj_sentinel = NULL;
bool can_move            = true;
bool can_begin           = true;

for(;;) {
    if(obj_next == NULL) {
        if(group->wrap || obj_sentinel == NULL) {
            if(!can_begin) return;
            obj_next  = begin(&group->obj_ll);
            can_move  = false;
            can_begin = false;
        }
        else {
            /*Currently focused object is the last/first in the group, keep it that way*/
            return;
        }
    }

    if(obj_sentinel == NULL) {
        obj_sentinel = obj_next;
        if(obj_sentinel == NULL) return; /*Group is empty*/
    }

    if(can_move) {
        obj_next = move(&group->obj_ll, obj_next);

        /*Give up if we walked the entire list and haven't found another visible object*/
        if(obj_next == obj_sentinel) return;
    }

    can_move = true;

    if(obj_next == NULL) continue;

    /*Hidden objects don't receive focus*/
    if(!lv_obj_get_hidden(*obj_next)) break;
}

if(obj_next == group->obj_focus) return; /*There's only one visible object and it's already focused*/

if(group->obj_focus) {
    (*group->obj_focus)->signal_cb(*group->obj_focus, LV_SIGNAL_DEFOCUS, NULL);
    lv_res_t res = lv_event_send(*group->obj_focus, LV_EVENT_DEFOCUSED, NULL);
    if(res != LV_RES_OK) return;
    lv_obj_invalidate(*group->obj_focus);
}

group->obj_focus = obj_next;

(*group->obj_focus)->signal_cb(*group->obj_focus, LV_SIGNAL_FOCUS, NULL);
lv_res_t res = lv_event_send(*group->obj_focus, LV_EVENT_FOCUSED, NULL);
if(res != LV_RES_OK) return;

/*If the object or its parent has `top == true` bring it to the foreground*/
obj_to_foreground(*group->obj_focus);

lv_obj_invalidate(*group->obj_focus);

if(group->focus_cb) group->focus_cb(group);

}

How did you confirm that this function causes the slowdown?

Please also attach a code snippet with some widgets to reproduce the delay you mentioned.

I am use lv group in program.lv group add btn_1 and btn_2 and post lable_fmt(value integer). Using encoder to rotate continously one btn_1 to another btn_2 delay to be happened. Whenever i rotate encoder post data to be hang the process after i fix btn hang data to be release. Inside lvgl library focus_next_core() function create delay (in between one lv group to another lv group).

Thanks.

Please also add a simple code snippet to see the issue.

ezgif.com-gif-maker (1)

I am using lv_group . one icon to another icon change through encoder but some delay occur the above graph video.

homeGrp = lv_group_create();
lv_group_add_obj(homeGrp, arc_1);
lv_group_add_obj(homeGrp, arc_2);
lv_group_add_obj(homeGrp, arc_3);
lv_group_add_obj(homeGrp, arc_4);
lv_indev_set_group(enc_indev, homeGrp);

I posting graph data all time. whenever use encoder to rotate one arc_icon to another arc_icon graph freeze .

lv_group

Do you see the same issue if you change the value of the arcs?

No. Inside arc function not occur delay .Between one arc to another arc rotate through encoder create delay.

I see, please enable MASK_AREA_DEBUG in lv_core/lv_refr.c and make video. It will highlight which areas are redrawn.

I suspect that the issue is in not coming from the group because iterating through 4 elements should be very fast.

between_arcs

one arc to another arc rotation. enable MASK_AREA_DEBUG

arc_value_rotate

arc valve rotation with enable MASK_AREA_DEBUG

Enable mask_area_debug after updating graph data to be slow process.

Sorry, but could you send higher resolution videos, it’s very hard to see what’s happening.

arc

I enable mask_area_debug after color fade

IT’s strange because the chart’s area should show the random color very quickly as the chart is updated.

Can you share to code of the whole screen?

whole_screen