From 4b2c3e560b1c3b9705858ce6889ddd17d06b1e47 Mon Sep 17 00:00:00 2001 From: Petri HARRI Date: Wed, 1 Jul 2020 17:14:14 +0300 Subject: [PATCH 01/30] lv_slider: add knob-only feature and fix bug with symmetrical slider (#1578) --- src/lv_widgets/lv_slider.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/lv_widgets/lv_slider.c b/src/lv_widgets/lv_slider.c index d7efb7469..b9ce83cf3 100644 --- a/src/lv_widgets/lv_slider.c +++ b/src/lv_widgets/lv_slider.c @@ -260,15 +260,30 @@ static lv_res_t lv_slider_signal(lv_obj_t * slider, lv_signal_t sign, void * par if(res != LV_RES_OK) return res; if(sign == LV_SIGNAL_GET_TYPE) return lv_obj_handle_get_type_signal(param, LV_OBJX_NAME); + lv_slider_type_t type = lv_slider_get_type(slider); lv_slider_ext_t * ext = lv_obj_get_ext_attr(slider); + + /* Advanced hit testing: react only on dragging the knob(s) */ + if (sign == LV_SIGNAL_HIT_TEST) { + lv_hit_test_info_t *info = param; + + /* Ordinary slider: was the knob area hit? */ + info->result = _lv_area_is_point_on(&ext->right_knob_area, info->point, 0); + + /* There's still a change we have a hit, if we have another knob */ + if ((info->result == false) && (type == LV_SLIDER_TYPE_RANGE)) { + info->result = _lv_area_is_point_on(&ext->left_knob_area, info->point, 0); + } + } + lv_point_t p; if(sign == LV_SIGNAL_PRESSED) { ext->dragging = true; - if(lv_slider_get_type(slider) == LV_SLIDER_TYPE_NORMAL) { + if(type == LV_SLIDER_TYPE_NORMAL || type == LV_SLIDER_TYPE_SYMMETRICAL) { ext->value_to_set = &ext->bar.cur_value; } - else if(lv_slider_get_type(slider) == LV_SLIDER_TYPE_RANGE) { + else if(type == LV_SLIDER_TYPE_RANGE) { lv_indev_get_point(param, &p); bool hor = lv_obj_get_width(slider) >= lv_obj_get_height(slider); lv_bidi_dir_t base_dir = lv_obj_get_base_dir(slider); From fd186eeb1522ff32ad957914bbdaa77acae5d45a Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Fri, 3 Jul 2020 14:24:13 +0200 Subject: [PATCH 02/30] roller: fix copy --- src/lv_widgets/lv_roller.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/lv_widgets/lv_roller.c b/src/lv_widgets/lv_roller.c index 07c89e6c2..066d3c29a 100644 --- a/src/lv_widgets/lv_roller.c +++ b/src/lv_widgets/lv_roller.c @@ -123,7 +123,10 @@ lv_obj_t * lv_roller_create(lv_obj_t * par, const lv_obj_t * copy) lv_label_create(roller, get_label(copy)); lv_roller_ext_t * copy_ext = lv_obj_get_ext_attr(copy); - lv_roller_set_options(roller, lv_roller_get_options(copy), copy_ext->mode); + ext->mode = copy_ext->mode; + ext->option_cnt = copy_ext->option_cnt; + ext->sel_opt_id = copy_ext->sel_opt_id; + ext->sel_opt_id_ori = copy_ext->sel_opt_id; ext->auto_fit = copy_ext->auto_fit; lv_obj_t * scrl = lv_page_get_scrollable(roller); lv_obj_set_signal_cb(scrl, lv_roller_scrl_signal); @@ -185,7 +188,7 @@ void lv_roller_set_options(lv_obj_t * roller, const char * options, lv_roller_mo lv_label_set_text(label, opt_extra); _lv_mem_buf_release(opt_extra); - ext->sel_opt_id = ((LV_ROLLER_INF_PAGES / 2) + 1) * ext->option_cnt; + ext->sel_opt_id = ((LV_ROLLER_INF_PAGES / 2) + 0) * ext->option_cnt; ext->option_cnt = ext->option_cnt * LV_ROLLER_INF_PAGES; } @@ -908,11 +911,12 @@ static void inf_normalize(void * scrl) if(ext->mode == LV_ROLLER_MODE_INIFINITE) { uint16_t real_id_cnt = ext->option_cnt / LV_ROLLER_INF_PAGES; - ext->sel_opt_id = ext->sel_opt_id % real_id_cnt; - ext->sel_opt_id += (LV_ROLLER_INF_PAGES / 2) * real_id_cnt; /*Select the middle page*/ + ext->sel_opt_id_ori = ext->sel_opt_id % real_id_cnt; + ext->sel_opt_id_ori += (LV_ROLLER_INF_PAGES / 2) * real_id_cnt; /*Select the middle page*/ + /*Move to the new id*/ const lv_font_t * font = lv_obj_get_style_text_font(roller, LV_ROLLER_PART_BG); lv_style_int_t line_space = lv_obj_get_style_text_line_space(roller, LV_ROLLER_PART_BG); From e9d3001dbff21ce1658d76b91033392fe5884fad Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Fri, 3 Jul 2020 14:48:54 +0200 Subject: [PATCH 03/30] img: improve hit test for transformed images --- CHANGELOG.md | 1 + src/lv_widgets/lv_img.c | 27 +++++++++++++++------------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f31d2b820..9b02dddc5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,7 @@ - `tabview` by default allow auto expanding the page only to right and bottom (#1573) - fix crash when drawing gradient to the same color - chart: fix memory leak +- `img`: improve hit test for transformed images ## v7.0.1 (01.06.2020) diff --git a/src/lv_widgets/lv_img.c b/src/lv_widgets/lv_img.c index 3acb7cab3..6c6f65791 100644 --- a/src/lv_widgets/lv_img.c +++ b/src/lv_widgets/lv_img.c @@ -793,21 +793,24 @@ static lv_res_t lv_img_signal(lv_obj_t * img, lv_signal_t sign, void * param) } else if(sign == LV_SIGNAL_HIT_TEST) { lv_hit_test_info_t * info = param; - if(ext->zoom != 256 && ext->angle == 0) { - lv_coord_t origin_width = lv_area_get_width(&img->coords); - lv_coord_t origin_height = lv_area_get_height(&img->coords); - lv_coord_t scaled_width = (origin_width * ext->zoom + 255) / 256; - lv_coord_t scaled_height = (origin_height * ext->zoom + 255) / 256; + lv_style_int_t zoom = lv_obj_get_style_transform_zoom(img, LV_IMG_PART_MAIN); + zoom = (zoom * ext->zoom) >> 8; - lv_coord_t width_offset = (origin_width - scaled_width) / 2; - lv_coord_t height_offset = (origin_height - scaled_height) / 2; + lv_style_int_t angle = lv_obj_get_style_transform_angle(img, LV_IMG_PART_MAIN); + angle += ext->angle; + + /* If the object is exactly image sized (not cropped, not mosaic) and transformed + * perform hit test on it's transformed area */ + if(ext->w == lv_obj_get_width(img) && ext->h == lv_obj_get_height(img) && + (zoom != LV_IMG_ZOOM_NONE || angle != 0 || ext->pivot.x != ext->w / 2 || ext->pivot.y != ext->h / 2)) { lv_area_t coords; - lv_area_copy(&coords, &img->coords); - coords.x1 += width_offset; - coords.x2 -= width_offset; - coords.y1 += height_offset; - coords.y2 -= height_offset; + _lv_img_buf_get_transformed_area(&coords, ext->w, ext->h, angle, zoom, &ext->pivot); + coords.x1 += img->coords.x1; + coords.y1 += img->coords.y1; + coords.x2 += img->coords.x1; + coords.y2 += img->coords.y1; + info->result = _lv_area_is_point_on(&coords, info->point, 0); } else From e6fe8436f4104df3f6fe41377cc5e1ddebd0a5ce Mon Sep 17 00:00:00 2001 From: guoweilkd <35251456+guoweilkd@users.noreply.github.com> Date: Sat, 4 Jul 2020 19:30:07 +0800 Subject: [PATCH 04/30] Fix #1634: bug in `lv_tileview_scrl_signal` (#1636) --- src/lv_widgets/lv_tileview.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lv_widgets/lv_tileview.c b/src/lv_widgets/lv_tileview.c index 9755b9756..9d1fec097 100644 --- a/src/lv_widgets/lv_tileview.c +++ b/src/lv_widgets/lv_tileview.c @@ -376,7 +376,7 @@ static lv_res_t lv_tileview_scrl_signal(lv_obj_t * scrl, lv_signal_t sign, void if(!ext->drag_right_en && indev->proc.types.pointer.vect.x < 0 && x < -(ext->act_id.x * w)) { lv_page_start_edge_flash(tileview, LV_PAGE_EDGE_RIGHT); - lv_obj_set_x(scrl, -ext->act_id.x * w + top); + lv_obj_set_x(scrl, -ext->act_id.x * w + left); } /*Apply the drag constraints*/ From 9e56f750a7f424d0cd52ce5ba3d4ccfa82a97866 Mon Sep 17 00:00:00 2001 From: Amir Gonnen Date: Sun, 5 Jul 2020 02:50:14 +0300 Subject: [PATCH 05/30] Prevent compiler warning in lv_draw_rect.c (#1637) --- src/lv_draw/lv_draw_rect.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lv_draw/lv_draw_rect.c b/src/lv_draw/lv_draw_rect.c index d813ca3be..161b8e433 100644 --- a/src/lv_draw/lv_draw_rect.c +++ b/src/lv_draw/lv_draw_rect.c @@ -1111,7 +1111,7 @@ LV_ATTRIBUTE_FAST_MEM static void shadow_draw_corner_buf(const lv_area_t * coord _lv_mem_buf_release(mask_line); if(sw == 1) { - uint32_t i; + int32_t i; lv_opa_t * res_buf = (lv_opa_t *)sh_buf; for(i = 0; i < size * size; i++) { res_buf[i] = (sh_buf[i] >> SHADOW_UPSACALE_SHIFT); @@ -1140,7 +1140,7 @@ LV_ATTRIBUTE_FAST_MEM static void shadow_draw_corner_buf(const lv_area_t * coord shadow_blur_corner(size, sw, sh_buf); } - uint32_t x; + int32_t x; lv_opa_t * res_buf = (lv_opa_t *)sh_buf; for(x = 0; x < size * size; x++) { res_buf[x] = sh_buf[x]; From d8585d2ea3c11ae08964e0ab3ba395b1124b55b2 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 7 Jul 2020 09:32:21 +0200 Subject: [PATCH 06/30] update release.py --- scripts/release.py | 38 ++++++++++++-------------------------- 1 file changed, 12 insertions(+), 26 deletions(-) diff --git a/scripts/release.py b/scripts/release.py index 1f97e885b..61b04745f 100644 --- a/scripts/release.py +++ b/scripts/release.py @@ -11,18 +11,10 @@ def title(t): def cmd(c): print("\n" + c) - os.system(c) - - -def increment(s): - """ look for the last sequence of number(s) in a string and increment """ - m = lastNum.search(s) - if m: - next = str(int(m.group(1))+1) - start, end = m.span(1) - s = s[:max(end-len(next), start)] + next + s[end:] - return s, str(next) - + r = os.system(c) + if r: + print("Exit due to previous error") + exit(r) def lvgl_clone(): title("lvgl: Clone") @@ -179,14 +171,16 @@ def drivers_merge_to_release_branch(v): def docs_clone(): title("docs: Clone") cmd("git clone --recursive https://github.com/lvgl/docs.git") - os.chdir("./docs/v7") - cmd("git co master") + os.chdir("./docs") def docs_get_api(): title("docs: Get API files") + cmd("git co latest") cmd("rm -rf xml"); cmd("cp -r ../../lvgl/docs/api_doc/xml ."); + cmd("git add xml"); + cmd('git commit -m "update API"') def docs_update_version(v): title("docs: Update version number") @@ -212,6 +206,8 @@ def docs_update_version(v): f.write(outbuf) f.close() + cmd("git add conf.py") + cmd('git ci -m "update conf.py to ' + v '"') def docs_update_trans(): title("docs: Update translations") @@ -219,17 +215,8 @@ def docs_update_trans(): def docs_build(): title("docs: Build") - cmd("./build.py clean") - - -def docs_commit_push(v): - title("docs: Commit release") - - cmd('git add .') - cmd('git ci -am "Release ' + v + '"') - cmd('git tag -a ' + v + ' -m "Release ' + v +'"') - cmd('git push origin master') - cmd('git push origin ' + v) + cmd("git checkout master") + cmd("./update.py latest") def clean_up(): title("Clean up repos") @@ -258,6 +245,5 @@ docs_get_api() docs_update_version(ver_str) #docs_update_trans() # Zanata is not working now docs_build() -docs_commit_push(ver_str) clean_up() From 43f5e4d2e0bfe140b37297ac165d40d398052e77 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 7 Jul 2020 09:36:59 +0200 Subject: [PATCH 07/30] Run code formatter --- src/lv_api_map.h | 2 +- src/lv_core/lv_indev.c | 186 ++++++++++++++++---------------- src/lv_core/lv_obj.c | 34 +++--- src/lv_core/lv_obj_style_dec.h | 9 +- src/lv_core/lv_style.c | 20 ++-- src/lv_draw/lv_draw_blend.c | 2 +- src/lv_draw/lv_img_buf.h | 2 +- src/lv_font/lv_font.h | 2 +- src/lv_gpu/lv_gpu_stm32_dma2d.c | 8 +- src/lv_misc/lv_mem.c | 23 ++-- src/lv_widgets/lv_btnmatrix.c | 20 ++-- src/lv_widgets/lv_btnmatrix.h | 10 +- src/lv_widgets/lv_label.c | 18 ++-- src/lv_widgets/lv_list.c | 2 +- src/lv_widgets/lv_roller.c | 6 +- src/lv_widgets/lv_slider.c | 6 +- src/lv_widgets/lv_textarea.c | 8 +- src/lv_widgets/lv_win.c | 30 +++--- 18 files changed, 200 insertions(+), 188 deletions(-) diff --git a/src/lv_api_map.h b/src/lv_api_map.h index cc3f245e8..dd2eb129a 100644 --- a/src/lv_api_map.h +++ b/src/lv_api_map.h @@ -180,7 +180,7 @@ static inline lv_obj_t * lv_page_get_scrl(lv_obj_t * page) static inline lv_obj_t * lv_win_add_btn(lv_obj_t * win, const void * img_src) { - return lv_win_add_btn_right(win, img_src); + return lv_win_add_btn_right(win, img_src); } #endif diff --git a/src/lv_core/lv_indev.c b/src/lv_core/lv_indev.c index a491c0996..98461f5ed 100644 --- a/src/lv_core/lv_indev.c +++ b/src/lv_core/lv_indev.c @@ -609,7 +609,7 @@ static void indev_encoder_proc(lv_indev_t * i, lv_indev_data_t * data) /*Process the steps they are valid only with released button*/ if(data->state != LV_INDEV_STATE_REL) { - data->enc_diff = 0; + data->enc_diff = 0; } /*Refresh the focused object. It might change due to lv_group_focus_prev/next*/ @@ -619,71 +619,74 @@ static void indev_encoder_proc(lv_indev_t * i, lv_indev_data_t * data) /*Button press happened*/ if(data->state == LV_INDEV_STATE_PR && last_state == LV_INDEV_STATE_REL) { - i->proc.pr_timestamp = lv_tick_get(); + i->proc.pr_timestamp = lv_tick_get(); - if (data->key == LV_KEY_ENTER) { - bool editable = false; - indev_obj_act->signal_cb(indev_obj_act, LV_SIGNAL_GET_EDITABLE, &editable); + if(data->key == LV_KEY_ENTER) { + bool editable = false; + indev_obj_act->signal_cb(indev_obj_act, LV_SIGNAL_GET_EDITABLE, &editable); - if(lv_group_get_editing(g) == true || editable == false) { - indev_obj_act->signal_cb(indev_obj_act, LV_SIGNAL_PRESSED, NULL); - if(indev_reset_check(&i->proc)) return; + if(lv_group_get_editing(g) == true || editable == false) { + indev_obj_act->signal_cb(indev_obj_act, LV_SIGNAL_PRESSED, NULL); + if(indev_reset_check(&i->proc)) return; - lv_event_send(indev_obj_act, LV_EVENT_PRESSED, NULL); - if(indev_reset_check(&i->proc)) return; - } - } else if(data->key == LV_KEY_LEFT) { - /*emulate encoder left*/ - data->enc_diff--; - } else if(data->key == LV_KEY_RIGHT) { - /*emulate encoder right*/ - data->enc_diff++; - } else if(data->key == LV_KEY_ESC) { + lv_event_send(indev_obj_act, LV_EVENT_PRESSED, NULL); + if(indev_reset_check(&i->proc)) return; + } + } + else if(data->key == LV_KEY_LEFT) { + /*emulate encoder left*/ + data->enc_diff--; + } + else if(data->key == LV_KEY_RIGHT) { + /*emulate encoder right*/ + data->enc_diff++; + } + else if(data->key == LV_KEY_ESC) { /*Send the ESC as a normal KEY*/ lv_group_send_data(g, LV_KEY_ESC); lv_event_send(indev_obj_act, LV_EVENT_CANCEL, NULL); if(indev_reset_check(&i->proc)) return; } - /*Just send other keys to the object (e.g. 'A' or `LV_GROUP_KEY_RIGHT`)*/ + /*Just send other keys to the object (e.g. 'A' or `LV_GROUP_KEY_RIGHT`)*/ else { lv_group_send_data(g, data->key); } } /*Pressing*/ else if(data->state == LV_INDEV_STATE_PR && last_state == LV_INDEV_STATE_PR) { - /* Long press*/ + /* Long press*/ if(i->proc.long_pr_sent == 0 && lv_tick_elaps(i->proc.pr_timestamp) > i->driver.long_press_time) { - i->proc.long_pr_sent = 1; - i->proc.longpr_rep_timestamp = lv_tick_get(); + i->proc.long_pr_sent = 1; + i->proc.longpr_rep_timestamp = lv_tick_get(); - if (data->key == LV_KEY_ENTER) { - bool editable = false; - indev_obj_act->signal_cb(indev_obj_act, LV_SIGNAL_GET_EDITABLE, &editable); + if(data->key == LV_KEY_ENTER) { + bool editable = false; + indev_obj_act->signal_cb(indev_obj_act, LV_SIGNAL_GET_EDITABLE, &editable); - /*On enter long press toggle edit mode.*/ - if(editable) { - /*Don't leave edit mode if there is only one object (nowhere to navigate)*/ - if(_lv_ll_is_empty(&g->obj_ll) == false) { - lv_group_set_editing(g, lv_group_get_editing(g) ? false : true); /*Toggle edit mode on long press*/ - } - } - /*If not editable then just send a long press signal*/ - else { - indev_obj_act->signal_cb(indev_obj_act, LV_SIGNAL_LONG_PRESS, NULL); - if(indev_reset_check(&i->proc)) return; - lv_event_send(indev_obj_act, LV_EVENT_LONG_PRESSED, NULL); - if(indev_reset_check(&i->proc)) return; - } - } + /*On enter long press toggle edit mode.*/ + if(editable) { + /*Don't leave edit mode if there is only one object (nowhere to navigate)*/ + if(_lv_ll_is_empty(&g->obj_ll) == false) { + lv_group_set_editing(g, lv_group_get_editing(g) ? false : true); /*Toggle edit mode on long press*/ + } + } + /*If not editable then just send a long press signal*/ + else { + indev_obj_act->signal_cb(indev_obj_act, LV_SIGNAL_LONG_PRESS, NULL); + if(indev_reset_check(&i->proc)) return; + lv_event_send(indev_obj_act, LV_EVENT_LONG_PRESSED, NULL); + if(indev_reset_check(&i->proc)) return; + } + } - i->proc.long_pr_sent = 1; + i->proc.long_pr_sent = 1; } /*Long press repeated time has elapsed?*/ - else if(i->proc.long_pr_sent != 0 && lv_tick_elaps(i->proc.longpr_rep_timestamp) > i->driver.long_press_rep_time) { + else if(i->proc.long_pr_sent != 0 && lv_tick_elaps(i->proc.longpr_rep_timestamp) > i->driver.long_press_rep_time) { - i->proc.longpr_rep_timestamp = lv_tick_get(); + i->proc.longpr_rep_timestamp = lv_tick_get(); if(data->key == LV_KEY_ENTER) { indev_obj_act->signal_cb(indev_obj_act, LV_SIGNAL_LONG_PRESS_REP, NULL); @@ -692,12 +695,14 @@ static void indev_encoder_proc(lv_indev_t * i, lv_indev_data_t * data) if(indev_reset_check(&i->proc)) return; } else if(data->key == LV_KEY_LEFT) { - /*emulate encoder left*/ - data->enc_diff--; - } else if(data->key == LV_KEY_RIGHT) { - /*emulate encoder right*/ - data->enc_diff++; - } else { + /*emulate encoder left*/ + data->enc_diff--; + } + else if(data->key == LV_KEY_RIGHT) { + /*emulate encoder right*/ + data->enc_diff++; + } + else { lv_group_send_data(g, data->key); if(indev_reset_check(&i->proc)) return; } @@ -708,49 +713,49 @@ static void indev_encoder_proc(lv_indev_t * i, lv_indev_data_t * data) /*Release happened*/ else if(data->state == LV_INDEV_STATE_REL && last_state == LV_INDEV_STATE_PR) { - if (data->key == LV_KEY_ENTER) { - bool editable = false; - indev_obj_act->signal_cb(indev_obj_act, LV_SIGNAL_GET_EDITABLE, &editable); + if(data->key == LV_KEY_ENTER) { + bool editable = false; + indev_obj_act->signal_cb(indev_obj_act, LV_SIGNAL_GET_EDITABLE, &editable); - /*The button was released on a non-editable object. Just send enter*/ - if(editable == false) { - indev_obj_act->signal_cb(indev_obj_act, LV_SIGNAL_RELEASED, NULL); - if(indev_reset_check(&i->proc)) return; + /*The button was released on a non-editable object. Just send enter*/ + if(editable == false) { + indev_obj_act->signal_cb(indev_obj_act, LV_SIGNAL_RELEASED, NULL); + if(indev_reset_check(&i->proc)) return; - if(i->proc.long_pr_sent == 0) lv_event_send(indev_obj_act, LV_EVENT_SHORT_CLICKED, NULL); - if(indev_reset_check(&i->proc)) return; + if(i->proc.long_pr_sent == 0) lv_event_send(indev_obj_act, LV_EVENT_SHORT_CLICKED, NULL); + if(indev_reset_check(&i->proc)) return; - lv_event_send(indev_obj_act, LV_EVENT_CLICKED, NULL); - if(indev_reset_check(&i->proc)) return; + lv_event_send(indev_obj_act, LV_EVENT_CLICKED, NULL); + if(indev_reset_check(&i->proc)) return; - lv_event_send(indev_obj_act, LV_EVENT_RELEASED, NULL); - if(indev_reset_check(&i->proc)) return; - } - /*An object is being edited and the button is released. */ - else if(g->editing) { - /*Ignore long pressed enter release because it comes from mode switch*/ - if(!i->proc.long_pr_sent || _lv_ll_is_empty(&g->obj_ll)) { - indev_obj_act->signal_cb(indev_obj_act, LV_SIGNAL_RELEASED, NULL); - if(indev_reset_check(&i->proc)) return; + lv_event_send(indev_obj_act, LV_EVENT_RELEASED, NULL); + if(indev_reset_check(&i->proc)) return; + } + /*An object is being edited and the button is released. */ + else if(g->editing) { + /*Ignore long pressed enter release because it comes from mode switch*/ + if(!i->proc.long_pr_sent || _lv_ll_is_empty(&g->obj_ll)) { + indev_obj_act->signal_cb(indev_obj_act, LV_SIGNAL_RELEASED, NULL); + if(indev_reset_check(&i->proc)) return; - lv_event_send(indev_obj_act, LV_EVENT_SHORT_CLICKED, NULL); - if(indev_reset_check(&i->proc)) return; + lv_event_send(indev_obj_act, LV_EVENT_SHORT_CLICKED, NULL); + if(indev_reset_check(&i->proc)) return; - lv_event_send(indev_obj_act, LV_EVENT_CLICKED, NULL); - if(indev_reset_check(&i->proc)) return; + lv_event_send(indev_obj_act, LV_EVENT_CLICKED, NULL); + if(indev_reset_check(&i->proc)) return; - lv_event_send(indev_obj_act, LV_EVENT_RELEASED, NULL); - if(indev_reset_check(&i->proc)) return; + lv_event_send(indev_obj_act, LV_EVENT_RELEASED, NULL); + if(indev_reset_check(&i->proc)) return; - lv_group_send_data(g, LV_KEY_ENTER); - } - } - /*If the focused object is editable and now in navigate mode then on enter switch edit - mode*/ - else if(editable && !g->editing && !i->proc.long_pr_sent) { - lv_group_set_editing(g, true); /*Set edit mode*/ - } - } + lv_group_send_data(g, LV_KEY_ENTER); + } + } + /*If the focused object is editable and now in navigate mode then on enter switch edit + mode*/ + else if(editable && !g->editing && !i->proc.long_pr_sent) { + lv_group_set_editing(g, true); /*Set edit mode*/ + } + } i->proc.pr_timestamp = 0; i->proc.long_pr_sent = 0; @@ -758,7 +763,7 @@ static void indev_encoder_proc(lv_indev_t * i, lv_indev_data_t * data) indev_obj_act = NULL; /*if encoder steps or simulated steps via left/right keys*/ - if (data->enc_diff != 0) { + if(data->enc_diff != 0) { /*In edit mode send LEFT/RIGHT keys*/ if(lv_group_get_editing(g)) { int32_t s; @@ -1211,15 +1216,16 @@ static void indev_click_focus(lv_indev_proc_t * proc) } /*Focus to the act. in its group*/ - if(g_act) { - lv_group_focus_obj(indev_obj_act); - if(indev_reset_check(proc)) return; - } else { + if(g_act) { + lv_group_focus_obj(indev_obj_act); + if(indev_reset_check(proc)) return; + } + else { lv_signal_send(indev_obj_act, LV_SIGNAL_FOCUS, NULL); if(indev_reset_check(proc)) return; lv_event_send(indev_obj_act, LV_EVENT_FOCUSED, NULL); if(indev_reset_check(proc)) return; - } + } } #else if(proc->types.pointer.last_pressed) { diff --git a/src/lv_core/lv_obj.c b/src/lv_core/lv_obj.c index 9259d3325..059d3d78b 100644 --- a/src/lv_core/lv_obj.c +++ b/src/lv_core/lv_obj.c @@ -39,7 +39,7 @@ #include LV_THEME_DEFAULT_INCLUDE #if LV_USE_GPU_STM32_DMA2D -#include "../lv_gpu/lv_gpu_stm32_dma2d.h" + #include "../lv_gpu/lv_gpu_stm32_dma2d.h" #endif /********************* @@ -1570,21 +1570,21 @@ void lv_obj_set_gesture_parent(lv_obj_t * obj, bool en) */ void lv_obj_set_focus_parent(lv_obj_t * obj, bool en) { - if (lv_obj_is_focused(obj)) { - if (en) { - obj->focus_parent = 1; - lv_obj_clear_state(obj, LV_STATE_FOCUSED | LV_STATE_EDITED); - lv_obj_set_state(lv_obj_get_focused_obj(obj), LV_STATE_FOCUSED); - } - else { - lv_obj_clear_state(lv_obj_get_focused_obj(obj), LV_STATE_FOCUSED | LV_STATE_EDITED); - lv_obj_set_state(obj, LV_STATE_FOCUSED); - obj->focus_parent = 0; - } + if(lv_obj_is_focused(obj)) { + if(en) { + obj->focus_parent = 1; + lv_obj_clear_state(obj, LV_STATE_FOCUSED | LV_STATE_EDITED); + lv_obj_set_state(lv_obj_get_focused_obj(obj), LV_STATE_FOCUSED); + } + else { + lv_obj_clear_state(lv_obj_get_focused_obj(obj), LV_STATE_FOCUSED | LV_STATE_EDITED); + lv_obj_set_state(obj, LV_STATE_FOCUSED); + obj->focus_parent = 0; + } + } + else { + obj->focus_parent = (en == true ? 1 : 0); } - else { - obj->focus_parent = (en == true ? 1 : 0); - } } /** @@ -3704,10 +3704,10 @@ lv_obj_t * lv_obj_get_focused_obj(const lv_obj_t * obj) if(obj == NULL) return NULL; const lv_obj_t * focus_obj = obj; while(lv_obj_get_focus_parent(focus_obj) != false && focus_obj != NULL) { - focus_obj = lv_obj_get_parent(focus_obj); + focus_obj = lv_obj_get_parent(focus_obj); } - return (lv_obj_t*)focus_obj; + return (lv_obj_t *)focus_obj; } /** diff --git a/src/lv_core/lv_obj_style_dec.h b/src/lv_core/lv_obj_style_dec.h index e1b65f720..47751597e 100644 --- a/src/lv_core/lv_obj_style_dec.h +++ b/src/lv_core/lv_obj_style_dec.h @@ -246,7 +246,8 @@ static inline void lv_style_set_pad_ver(lv_style_t * style, lv_state_t state, lv } -static inline void lv_obj_set_style_local_margin_all(lv_obj_t * obj, uint8_t part, lv_state_t state, lv_style_int_t value) +static inline void lv_obj_set_style_local_margin_all(lv_obj_t * obj, uint8_t part, lv_state_t state, + lv_style_int_t value) { lv_obj_set_style_local_margin_top(obj, part, state, value); lv_obj_set_style_local_margin_bottom(obj, part, state, value); @@ -264,7 +265,8 @@ static inline void lv_style_set_margin_all(lv_style_t * style, lv_state_t state, } -static inline void lv_obj_set_style_local_margin_hor(lv_obj_t * obj, uint8_t part, lv_state_t state, lv_style_int_t value) +static inline void lv_obj_set_style_local_margin_hor(lv_obj_t * obj, uint8_t part, lv_state_t state, + lv_style_int_t value) { lv_obj_set_style_local_margin_left(obj, part, state, value); lv_obj_set_style_local_margin_right(obj, part, state, value); @@ -278,7 +280,8 @@ static inline void lv_style_set_margin_hor(lv_style_t * style, lv_state_t state, } -static inline void lv_obj_set_style_local_margin_ver(lv_obj_t * obj, uint8_t part, lv_state_t state, lv_style_int_t value) +static inline void lv_obj_set_style_local_margin_ver(lv_obj_t * obj, uint8_t part, lv_state_t state, + lv_style_int_t value) { lv_obj_set_style_local_margin_top(obj, part, state, value); lv_obj_set_style_local_margin_bottom(obj, part, state, value); diff --git a/src/lv_core/lv_style.c b/src/lv_core/lv_style.c index 1be4e3dbe..ce3665e0d 100644 --- a/src/lv_core/lv_style.c +++ b/src/lv_core/lv_style.c @@ -36,10 +36,10 @@ **********************/ LV_ATTRIBUTE_FAST_MEM static inline int32_t get_property_index(const lv_style_t * style, lv_style_property_t prop); static lv_style_t * get_alloc_local_style(lv_style_list_t * list); -static inline void style_resize(lv_style_t *style, size_t sz); -static inline lv_style_property_t get_style_prop(const lv_style_t *style, size_t idx); -static inline uint8_t get_style_prop_id(const lv_style_t *style, size_t idx); -static inline uint8_t get_style_prop_attr(const lv_style_t *style, size_t idx); +static inline void style_resize(lv_style_t * style, size_t sz); +static inline lv_style_property_t get_style_prop(const lv_style_t * style, size_t idx); +static inline uint8_t get_style_prop_id(const lv_style_t * style, size_t idx); +static inline uint8_t get_style_prop_attr(const lv_style_t * style, size_t idx); static inline size_t get_prop_size(uint8_t prop_id); static inline size_t get_next_prop_index(uint8_t prop_id, size_t id); @@ -1065,7 +1065,7 @@ LV_ATTRIBUTE_FAST_MEM static inline int32_t get_property_index(const lv_style_t size_t i = 0; - uint8_t prop_id; + uint8_t prop_id; while((prop_id = get_style_prop_id(style, i)) != _LV_STYLE_CLOSEING_PROP) { if(prop_id == id_to_find) { lv_style_attr_t attr_i; @@ -1124,7 +1124,7 @@ static lv_style_t * get_alloc_local_style(lv_style_list_t * list) * @param style pointer to the style to be resized. * @param size new size */ -static inline void style_resize(lv_style_t *style, size_t sz) +static inline void style_resize(lv_style_t * style, size_t sz) { style->map = lv_mem_realloc(style->map, sz); } @@ -1135,10 +1135,10 @@ static inline void style_resize(lv_style_t *style, size_t sz) * @param idx index of the style in style->map * @return property in style->map + idx */ -static inline lv_style_property_t get_style_prop(const lv_style_t *style, size_t idx) +static inline lv_style_property_t get_style_prop(const lv_style_t * style, size_t idx) { lv_style_property_t prop; - uint8_t *prop_p = (uint8_t*)∝ + uint8_t * prop_p = (uint8_t *)∝ prop_p[0] = style->map[idx]; prop_p[1] = style->map[idx + 1]; return prop; @@ -1150,7 +1150,7 @@ static inline lv_style_property_t get_style_prop(const lv_style_t *style, size_t * @param idx index of the style in style->map * @return id of property in style->map + idx */ -static inline uint8_t get_style_prop_id(const lv_style_t *style, size_t idx) +static inline uint8_t get_style_prop_id(const lv_style_t * style, size_t idx) { return get_style_prop(style, idx) & 0xFF; } @@ -1161,7 +1161,7 @@ static inline uint8_t get_style_prop_id(const lv_style_t *style, size_t idx) * @param idx index of the style in style->map * @return attribute of property in style->map + idx */ -static inline uint8_t get_style_prop_attr(const lv_style_t *style, size_t idx) +static inline uint8_t get_style_prop_attr(const lv_style_t * style, size_t idx) { return ((get_style_prop(style, idx) >> 8) & 0xFFU); } diff --git a/src/lv_draw/lv_draw_blend.c b/src/lv_draw/lv_draw_blend.c index 3b94c3c78..375bee819 100644 --- a/src/lv_draw/lv_draw_blend.c +++ b/src/lv_draw/lv_draw_blend.c @@ -61,7 +61,7 @@ static inline lv_color_t color_blend_true_color_subtractive(lv_color_t fg, lv_co **********************/ #if LV_USE_GPU || LV_USE_GPU_STM32_DMA2D -LV_ATTRIBUTE_DMA static lv_color_t blend_buf[LV_HOR_RES_MAX]; + LV_ATTRIBUTE_DMA static lv_color_t blend_buf[LV_HOR_RES_MAX]; #endif /********************** diff --git a/src/lv_draw/lv_img_buf.h b/src/lv_draw/lv_img_buf.h index 4b6db2b87..204f3c1d8 100644 --- a/src/lv_draw/lv_img_buf.h +++ b/src/lv_draw/lv_img_buf.h @@ -103,7 +103,7 @@ typedef uint8_t lv_img_cf_t; * LVGL image header */ /* The first 8 bit is very important to distinguish the different source types. - * For more info see `lv_img_get_src_type()` in lv_img.c + * For more info see `lv_img_get_src_type()` in lv_img.c * On big endian systems the order is reversed so cf and always_zero must be at * the end of the struct. * */ diff --git a/src/lv_font/lv_font.h b/src/lv_font/lv_font.h index b319158c1..041211acd 100644 --- a/src/lv_font/lv_font.h +++ b/src/lv_font/lv_font.h @@ -174,7 +174,7 @@ LV_FONT_DECLARE(lv_font_montserrat_32) #if LV_FONT_MONTSERRAT_34 LV_FONT_DECLARE(lv_font_montserrat_34) #endif - + #if LV_FONT_MONTSERRAT_36 LV_FONT_DECLARE(lv_font_montserrat_36) #endif diff --git a/src/lv_gpu/lv_gpu_stm32_dma2d.c b/src/lv_gpu/lv_gpu_stm32_dma2d.c index 9810587dd..d5c8e40dc 100644 --- a/src/lv_gpu/lv_gpu_stm32_dma2d.c +++ b/src/lv_gpu/lv_gpu_stm32_dma2d.c @@ -194,10 +194,10 @@ void lv_gpu_stm32_dma2d_blend(lv_color_t * buf, lv_coord_t buf_w, const lv_color DMA2D->BGOR = buf_w - copy_w; DMA2D->FGPFCCR = (uint32_t)LV_DMA2D_COLOR_FORMAT - /* alpha mode 2, replace with foreground * alpha value */ - | (2 << DMA2D_FGPFCCR_AM_Pos) - /* alpha value */ - | (opa << DMA2D_FGPFCCR_ALPHA_Pos); + /* alpha mode 2, replace with foreground * alpha value */ + | (2 << DMA2D_FGPFCCR_AM_Pos) + /* alpha value */ + | (opa << DMA2D_FGPFCCR_ALPHA_Pos); DMA2D->FGMAR = (uint32_t)map; DMA2D->FGOR = map_w - copy_w; diff --git a/src/lv_misc/lv_mem.c b/src/lv_misc/lv_mem.c index 331771d7e..8775f39da 100644 --- a/src/lv_misc/lv_mem.c +++ b/src/lv_misc/lv_mem.c @@ -87,7 +87,7 @@ typedef struct { static uint32_t zero_mem; /*Give the address of this variable if 0 byte should be allocated*/ #if LV_MEM_CUSTOM == 0 -static uint32_t mem_max_size; /*Tracks the maximum total size of memory ever used from the internal heap*/ + static uint32_t mem_max_size; /*Tracks the maximum total size of memory ever used from the internal heap*/ #endif static uint8_t mem_buf1_32[MEM_BUF_SMALL_SIZE]; @@ -125,7 +125,7 @@ void _lv_mem_init(void) #else work_mem = (uint8_t *)LV_MEM_ADR; #endif - + lv_mem_ent_t * full = (lv_mem_ent_t *)work_mem; full->header.s.used = 0; /*The total mem size id reduced by the first header and the close patterns */ @@ -205,16 +205,17 @@ void * lv_mem_alloc(size_t size) #endif if(alloc == NULL) { - LV_LOG_WARN("Couldn't allocate memory"); - }else{ - #if LV_MEM_CUSTOM == 0 - /* just a safety check, should always be true */ - if ((uintptr_t) alloc > (uintptr_t) work_mem) { - if ((((uintptr_t) alloc - (uintptr_t) work_mem) + size) > mem_max_size) { - mem_max_size = ((uintptr_t) alloc - (uintptr_t) work_mem) + size; + LV_LOG_WARN("Couldn't allocate memory"); + } + else { +#if LV_MEM_CUSTOM == 0 + /* just a safety check, should always be true */ + if((uintptr_t) alloc > (uintptr_t) work_mem) { + if((((uintptr_t) alloc - (uintptr_t) work_mem) + size) > mem_max_size) { + mem_max_size = ((uintptr_t) alloc - (uintptr_t) work_mem) + size; + } } - } - #endif +#endif } return alloc; diff --git a/src/lv_widgets/lv_btnmatrix.c b/src/lv_widgets/lv_btnmatrix.c index d40880ce1..5501fcfa6 100644 --- a/src/lv_widgets/lv_btnmatrix.c +++ b/src/lv_widgets/lv_btnmatrix.c @@ -427,12 +427,12 @@ void lv_btnmatrix_set_one_check(lv_obj_t * btnm, bool one_chk) * @param btnm pointer to a btnmatrix object * @param align LV_LABEL_ALIGN_LEFT, LV_LABEL_ALIGN_RIGHT or LV_LABEL_ALIGN_CENTER */ -void lv_btnmatrix_set_align(lv_obj_t* btnm, lv_label_align_t align) +void lv_btnmatrix_set_align(lv_obj_t * btnm, lv_label_align_t align) { LV_ASSERT_OBJ(btnm, LV_OBJX_NAME); - lv_btnmatrix_ext_t* ext = lv_obj_get_ext_attr(btnm); - if (ext->align == align) return; + lv_btnmatrix_ext_t * ext = lv_obj_get_ext_attr(btnm); + if(ext->align == align) return; ext->align = align; @@ -585,18 +585,18 @@ bool lv_btnmatrix_get_one_check(const lv_obj_t * btnm) * @param btnm pointer to a btnmatrix object * @return LV_LABEL_ALIGN_LEFT, LV_LABEL_ALIGN_RIGHT or LV_LABEL_ALIGN_CENTER */ -lv_label_align_t lv_btnmatrix_get_align(const lv_obj_t* btnm) +lv_label_align_t lv_btnmatrix_get_align(const lv_obj_t * btnm) { LV_ASSERT_OBJ(btnm, LV_OBJX_NAME); - lv_btnmatrix_ext_t* ext = lv_obj_get_ext_attr(btnm); + lv_btnmatrix_ext_t * ext = lv_obj_get_ext_attr(btnm); lv_label_align_t align = ext->align; - if (align == LV_LABEL_ALIGN_AUTO) { + if(align == LV_LABEL_ALIGN_AUTO) { #if LV_USE_BIDI lv_bidi_dir_t base_dir = lv_obj_get_base_dir(btnm); - if (base_dir == LV_BIDI_DIR_RTL) align = LV_LABEL_ALIGN_RIGHT; + if(base_dir == LV_BIDI_DIR_RTL) align = LV_LABEL_ALIGN_RIGHT; else align = LV_LABEL_ALIGN_LEFT; #else align = LV_LABEL_ALIGN_LEFT; @@ -641,10 +641,10 @@ static lv_design_res_t lv_btnmatrix_design(lv_obj_t * btnm, const lv_area_t * cl uint16_t btn_i = 0; uint16_t txt_i = 0; lv_txt_flag_t txt_flag = LV_TXT_FLAG_NONE; - if (ext->recolor) txt_flag |= LV_TXT_FLAG_RECOLOR; + if(ext->recolor) txt_flag |= LV_TXT_FLAG_RECOLOR; lv_label_align_t align = lv_btnmatrix_get_align(btnm); - if (align == LV_LABEL_ALIGN_CENTER) txt_flag |= LV_TXT_FLAG_CENTER; - if (align == LV_LABEL_ALIGN_RIGHT) txt_flag |= LV_TXT_FLAG_RIGHT; + if(align == LV_LABEL_ALIGN_CENTER) txt_flag |= LV_TXT_FLAG_CENTER; + if(align == LV_LABEL_ALIGN_RIGHT) txt_flag |= LV_TXT_FLAG_RIGHT; lv_draw_rect_dsc_t draw_rect_rel_dsc; lv_draw_label_dsc_t draw_label_rel_dsc; diff --git a/src/lv_widgets/lv_btnmatrix.h b/src/lv_widgets/lv_btnmatrix.h index f9d9b06a0..c30a959f0 100644 --- a/src/lv_widgets/lv_btnmatrix.h +++ b/src/lv_widgets/lv_btnmatrix.h @@ -170,13 +170,13 @@ void lv_btnmatrix_set_btn_width(lv_obj_t * btnm, uint16_t btn_id, uint8_t width) * @param one_chk Whether "one check" mode is enabled */ void lv_btnmatrix_set_one_check(lv_obj_t * btnm, bool one_chk); - + /** * Set the align of the map text (left, right or center) * @param btnm pointer to a btnmatrix object * @param align LV_LABEL_ALIGN_LEFT, LV_LABEL_ALIGN_RIGHT or LV_LABEL_ALIGN_CENTER */ -void lv_btnmatrix_set_align(lv_obj_t* btnm, lv_label_align_t align); +void lv_btnmatrix_set_align(lv_obj_t * btnm, lv_label_align_t align); /*===================== * Getter functions @@ -244,14 +244,14 @@ bool lv_btnmatrix_get_btn_ctrl(lv_obj_t * btnm, uint16_t btn_id, lv_btnmatrix_ct * @return whether "one toggle" mode is enabled */ bool lv_btnmatrix_get_one_check(const lv_obj_t * btnm); - + /** * Get the align attribute * @param btnm pointer to a btnmatrix object * @return LV_LABEL_ALIGN_LEFT, LV_LABEL_ALIGN_RIGHT or LV_LABEL_ALIGN_CENTER */ -lv_label_align_t lv_btnmatrix_get_align(const lv_obj_t* btnm); - +lv_label_align_t lv_btnmatrix_get_align(const lv_obj_t * btnm); + /********************** * MACROS **********************/ diff --git a/src/lv_widgets/lv_label.c b/src/lv_widgets/lv_label.c index da8b6d308..1113a6b10 100644 --- a/src/lv_widgets/lv_label.c +++ b/src/lv_widgets/lv_label.c @@ -577,15 +577,15 @@ void lv_label_get_letter_pos(const lv_obj_t * label, uint32_t char_id, lv_point_ if(txt[0] == '\0') { pos->y = 0; switch(align) { - case LV_LABEL_ALIGN_LEFT: - pos->x = 0; - break; - case LV_LABEL_ALIGN_RIGHT: - pos->x = lv_obj_get_width(label); - break; - case LV_LABEL_ALIGN_CENTER: - pos->x = lv_obj_get_width(label) / 2; - break; + case LV_LABEL_ALIGN_LEFT: + pos->x = 0; + break; + case LV_LABEL_ALIGN_RIGHT: + pos->x = lv_obj_get_width(label); + break; + case LV_LABEL_ALIGN_CENTER: + pos->x = lv_obj_get_width(label) / 2; + break; } return; } diff --git a/src/lv_widgets/lv_list.c b/src/lv_widgets/lv_list.c index 9df0d621d..76ba666ff 100644 --- a/src/lv_widgets/lv_list.c +++ b/src/lv_widgets/lv_list.c @@ -470,7 +470,7 @@ int32_t lv_list_get_btn_index(const lv_obj_t * list, const lv_obj_t * btn) list = lv_obj_get_parent(lv_obj_get_parent(btn)); } LV_ASSERT_OBJ(list, LV_OBJX_NAME); - + lv_obj_t * e = lv_list_get_next_btn(list, NULL); while(e != NULL) { if(e == btn) { diff --git a/src/lv_widgets/lv_roller.c b/src/lv_widgets/lv_roller.c index 066d3c29a..41874af52 100644 --- a/src/lv_widgets/lv_roller.c +++ b/src/lv_widgets/lv_roller.c @@ -196,9 +196,9 @@ void lv_roller_set_options(lv_obj_t * roller, const char * options, lv_roller_mo ext->sel_opt_id_ori = ext->sel_opt_id; - refr_height(roller); - refr_width(roller); -// refr_position(roller, LV_ANIM_OFF); + refr_height(roller); + refr_width(roller); + // refr_position(roller, LV_ANIM_OFF); } /** diff --git a/src/lv_widgets/lv_slider.c b/src/lv_widgets/lv_slider.c index b9ce83cf3..bb83f9298 100644 --- a/src/lv_widgets/lv_slider.c +++ b/src/lv_widgets/lv_slider.c @@ -264,14 +264,14 @@ static lv_res_t lv_slider_signal(lv_obj_t * slider, lv_signal_t sign, void * par lv_slider_ext_t * ext = lv_obj_get_ext_attr(slider); /* Advanced hit testing: react only on dragging the knob(s) */ - if (sign == LV_SIGNAL_HIT_TEST) { - lv_hit_test_info_t *info = param; + if(sign == LV_SIGNAL_HIT_TEST) { + lv_hit_test_info_t * info = param; /* Ordinary slider: was the knob area hit? */ info->result = _lv_area_is_point_on(&ext->right_knob_area, info->point, 0); /* There's still a change we have a hit, if we have another knob */ - if ((info->result == false) && (type == LV_SLIDER_TYPE_RANGE)) { + if((info->result == false) && (type == LV_SLIDER_TYPE_RANGE)) { info->result = _lv_area_is_point_on(&ext->left_knob_area, info->point, 0); } } diff --git a/src/lv_widgets/lv_textarea.c b/src/lv_widgets/lv_textarea.c index 182ac55da..9cf859f82 100644 --- a/src/lv_widgets/lv_textarea.c +++ b/src/lv_widgets/lv_textarea.c @@ -231,16 +231,16 @@ void lv_textarea_add_char(lv_obj_t * ta, uint32_t c) lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); - const char *letter_buf; + const char * letter_buf; uint32_t u32_buf[2]; u32_buf[0] = c; u32_buf[1] = 0; - - letter_buf = (char*)&u32_buf; + + letter_buf = (char *)&u32_buf; #if LV_BIG_ENDIAN_SYSTEM - if (c != 0) while (*letter_buf == 0) ++letter_buf; + if(c != 0) while(*letter_buf == 0) ++letter_buf; #endif ta_insert_replace = NULL; diff --git a/src/lv_widgets/lv_win.c b/src/lv_widgets/lv_win.c index 6b825c168..20fbb7426 100644 --- a/src/lv_widgets/lv_win.c +++ b/src/lv_widgets/lv_win.c @@ -34,8 +34,8 @@ typedef struct { } lv_win_btn_ext_t; enum { - LV_WIN_BTN_ALIGN_RIGHT = 0, /**< Align button to right of the header */ - LV_WIN_BTN_ALIGN_LEFT /**< Align button to left of the header */ + LV_WIN_BTN_ALIGN_RIGHT = 0, /**< Align button to right of the header */ + LV_WIN_BTN_ALIGN_LEFT /**< Align button to left of the header */ }; typedef uint8_t lv_win_btn_align_t; @@ -559,7 +559,7 @@ static lv_design_res_t lv_win_header_design(lv_obj_t * header, const lv_area_t * lv_coord_t left_btn_offset = 0; btn = lv_obj_get_child_back(ext->header, NULL); while(btn != NULL) { - if (LV_WIN_BTN_ALIGN_LEFT == lv_win_btn_get_alignment(btn)) { + if(LV_WIN_BTN_ALIGN_LEFT == lv_win_btn_get_alignment(btn)) { left_btn_offset += btn_w + header_inner; } @@ -716,26 +716,28 @@ static void lv_win_realign(lv_obj_t * win) lv_obj_set_size(btn, btn_w, btn_h); uint8_t btn_alignment = lv_win_btn_get_alignment(btn); - if (LV_WIN_BTN_ALIGN_RIGHT == btn_alignment) { - if (is_header_right_side_empty) { + if(LV_WIN_BTN_ALIGN_RIGHT == btn_alignment) { + if(is_header_right_side_empty) { /* Align the button to the right of the header */ lv_obj_align(btn, ext->header, LV_ALIGN_IN_RIGHT_MID, -header_right, 0); is_header_right_side_empty = false; - } else { + } + else { /* Align the button to the left of the previous button */ - lv_obj_align(btn, btn_prev_at_right, LV_ALIGN_OUT_LEFT_MID, -header_inner, 0); + lv_obj_align(btn, btn_prev_at_right, LV_ALIGN_OUT_LEFT_MID, -header_inner, 0); } btn_prev_at_right = btn; } - else if (LV_WIN_BTN_ALIGN_LEFT == btn_alignment) { - if (is_header_left_side_empty) { + else if(LV_WIN_BTN_ALIGN_LEFT == btn_alignment) { + if(is_header_left_side_empty) { /* Align the button to the right of the header */ lv_obj_align(btn, ext->header, LV_ALIGN_IN_LEFT_MID, header_left, 0); is_header_left_side_empty = false; - } else { + } + else { /* Align the button to the right of the previous button */ lv_obj_align(btn, btn_prev_at_left, LV_ALIGN_OUT_RIGHT_MID, header_inner, 0); } @@ -754,11 +756,11 @@ static void lv_win_realign(lv_obj_t * win) static lv_obj_t * lv_win_btn_create(lv_obj_t * par, const void * img_src) { - LV_LOG_TRACE("win btn create started"); + LV_LOG_TRACE("win btn create started"); - lv_obj_t * win_btn; + lv_obj_t * win_btn; - win_btn = lv_btn_create(par, NULL); + win_btn = lv_btn_create(par, NULL); LV_ASSERT_MEM(win_btn); if(win_btn == NULL) return NULL; @@ -785,7 +787,7 @@ static lv_obj_t * lv_win_btn_create(lv_obj_t * par, const void * img_src) LV_LOG_INFO("win btn created"); - return win_btn; + return win_btn; } static void lv_win_btn_set_alignment(lv_obj_t * win_btn, const uint8_t alignment) From e30efb716fe2ae0eb385ea9efa1f3b742b180cb5 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 7 Jul 2020 09:37:00 +0200 Subject: [PATCH 08/30] Release v7.1.0 --- library.json | 2 +- lv_conf_template.h | 2 +- lvgl.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/library.json b/library.json index 233aa99d5..faa8db1f7 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "lvgl", - "version": "v7.0.2", + "version": "v7.1.0", "keywords": "graphics, gui, embedded, littlevgl", "description": "Graphics library to create embedded GUI with easy-to-use graphical elements, beautiful visual effects and low memory footprint. It offers anti-aliasing, opacity, and animations using only one frame buffer.", "repository": diff --git a/lv_conf_template.h b/lv_conf_template.h index 828413eab..4db0f7bb0 100644 --- a/lv_conf_template.h +++ b/lv_conf_template.h @@ -1,6 +1,6 @@ /** * @file lv_conf.h - * Configuration file for LVGL v7.0.2 + * Configuration file for LVGL v7.1.0 */ /* diff --git a/lvgl.h b/lvgl.h index 5165a598b..6146d7120 100644 --- a/lvgl.h +++ b/lvgl.h @@ -79,7 +79,7 @@ extern "C" { #define LVGL_VERSION_MAJOR 7 #define LVGL_VERSION_MINOR 1 #define LVGL_VERSION_PATCH 0 -#define LVGL_VERSION_INFO "dev" +#define LVGL_VERSION_INFO "" /********************** * TYPEDEFS From a117b3cead6523a955c3991ff0e8f30a86b3cb8b Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 7 Jul 2020 10:00:38 +0200 Subject: [PATCH 09/30] update relaese script --- scripts/release.py | 310 ++++++++++++++++++++++----------------------- 1 file changed, 153 insertions(+), 157 deletions(-) mode change 100644 => 100755 scripts/release.py diff --git a/scripts/release.py b/scripts/release.py old mode 100644 new mode 100755 index 61b04745f..568bfeab2 --- a/scripts/release.py +++ b/scripts/release.py @@ -1,227 +1,224 @@ +#!/usr/bin/env python + import re import os lastNum = re.compile(r'(?:[^\d]*(\d+)[^\d]*)+') def title(t): - print("\n---------------------------------") - print(t) - print("---------------------------------") + print("\n---------------------------------") + print(t) + print("---------------------------------") def cmd(c): - print("\n" + c) - r = os.system(c) + print("\n" + c) + r = os.system(c) if r: - print("Exit due to previous error") - exit(r) + print("### Error: " + str(r)) def lvgl_clone(): - title("lvgl: Clone") - cmd("git clone https://github.com/lvgl/lvgl.git") - os.chdir("./lvgl") - cmd("git co master") + title("lvgl: Clone") + cmd("git clone https://github.com/lvgl/lvgl.git") + os.chdir("./lvgl") + cmd("git co master") def lvgl_format(): title("lvgl: Run code formatter") os.chdir("./scripts") cmd("./code-format.sh") - cmd("git ci -am 'Run code formatter'") + os.system("git ci -am 'Run code formatter'") os.chdir("..") def lvgl_update_version(): - title("lvgl: Update version number") + title("lvgl: Update version number") - f = open("./lvgl.h", "r") - - outbuf = "" - major_ver = -1 - minor_ver = -1 - patch_ver = -1 - - for i in f.read().splitlines(): - r = re.search(r'^#define LVGL_VERSION_MAJOR ', i) - if r: - m = lastNum.search(i) - if m: major_ver = m.group(1) + f = open("./lvgl.h", "r") + + outbuf = "" + major_ver = -1 + minor_ver = -1 + patch_ver = -1 + + for i in f.read().splitlines(): + r = re.search(r'^#define LVGL_VERSION_MAJOR ', i) + if r: + m = lastNum.search(i) + if m: major_ver = m.group(1) - r = re.search(r'^#define LVGL_VERSION_MINOR ', i) - if r: - m = lastNum.search(i) - if m: minor_ver = m.group(1) - - r = re.search(r'^#define LVGL_VERSION_PATCH ', i) - if r: - m = lastNum.search(i) - if m: patch_ver = m.group(1) - - - r = re.search(r'^#define LVGL_VERSION_INFO ', i) - if r: - i = "#define LVGL_VERSION_INFO \"\"" - - outbuf += i + '\n' - - f.close() + r = re.search(r'^#define LVGL_VERSION_MINOR ', i) + if r: + m = lastNum.search(i) + if m: minor_ver = m.group(1) + + r = re.search(r'^#define LVGL_VERSION_PATCH ', i) + if r: + m = lastNum.search(i) + if m: patch_ver = m.group(1) + + + r = re.search(r'^#define LVGL_VERSION_INFO ', i) + if r: + i = "#define LVGL_VERSION_INFO \"\"" + + outbuf += i + '\n' + + f.close() - f = open("./lvgl.h", "w") - - f.write(outbuf) - f.close() + f = open("./lvgl.h", "w") + + f.write(outbuf) + f.close() - s = "v" + str(major_ver) + "." + str(minor_ver) + "." + str(patch_ver) - print("New version:" + s) - return s + s = "v" + str(major_ver) + "." + str(minor_ver) + "." + str(patch_ver) + print("New version:" + s) + return s def lvgl_update_library_json(v): - title("lvgl: Update version number in library.json") + title("lvgl: Update version number in library.json") - f = open("./library.json", "r") - - outbuf = "" - - for i in f.read().splitlines(): - r = re.search(r'"version": ', i) - if r: - i = ' "version": "' + v + '",' - - outbuf += i + '\n' - - f.close() + f = open("./library.json", "r") + + outbuf = "" + + for i in f.read().splitlines(): + r = re.search(r'"version": ', i) + if r: + i = ' "version": "' + v + '",' + + outbuf += i + '\n' + + f.close() - f = open("./library.json", "w") - - f.write(outbuf) - f.close() + f = open("./library.json", "w") + + f.write(outbuf) + f.close() def lvgl_update_lv_conf_templ(ver_str): - title("lvgl: Update version number in lv_conf_template.h") - cmd("sed -i -r 's/v[0-9]+\.[0-9]+\.[0-9]+/"+ ver_str +"/' lv_conf_template.h ") + title("lvgl: Update version number in lv_conf_template.h") + cmd("sed -i -r 's/v[0-9]+\.[0-9]+\.[0-9]+/"+ ver_str +"/' lv_conf_template.h ") def lvgl_commit_push(v): - title("lvgl: commit and push release") + title("lvgl: commit and push release") - cmd('git ci -am "Release ' + v + '"') - cmd('git tag -a ' + v + ' -m "Release ' + v +'"') - cmd('git push origin master') - cmd('git push origin ' + v) + os.system('git ci -am "Release ' + v + '"') + cmd('git tag -a ' + v + ' -m "Release ' + v +'"') + cmd('git push origin master') + cmd('git push origin ' + v) def lvgl_merge_to_release_branch(v): - title("lvgl: merge to release branch") - cmd('git co release/v7') - cmd('git merge master') - cmd('git push origin release/v7') - os.chdir("../") - - + title("lvgl: merge to release branch") + cmd('git co release/v7') + cmd('git merge master') + cmd('git push origin release/v7') + os.chdir("../") + + def lvgl_update_api_docs(): - title("lvgl: Update API with Doxygen") + title("lvgl: Update API with Doxygen") - cmd("cd scripts; doxygen"); + cmd("cd scripts; doxygen"); def examples_clone(): - title("examples: Clone") - cmd("git clone https://github.com/lvgl/lv_examples.git") - os.chdir("./lv_examples") - cmd("git co master") + title("examples: Clone") + cmd("git clone https://github.com/lvgl/lv_examples.git") + os.chdir("./lv_examples") + cmd("git co master") def examples_commit_push(v): - title("examples: commit and push release") + title("examples: commit and push release") - cmd('git ci -am "Release ' + v + '"') - cmd('git tag -a ' + v + ' -m "Release ' + v +'"') - cmd('git push origin master') - cmd('git push origin ' + v) + os.system('git ci -am "Release ' + v + '"') + cmd('git tag -a ' + v + ' -m "Release ' + v +'"') + cmd('git push origin master') + cmd('git push origin ' + v) def examples_merge_to_release_branch(v): - title("examples: merge to release branch") - cmd('git co release/v7') - cmd('git merge master') - cmd('git push origin release/v7') - os.chdir("../") - - + title("examples: merge to release branch") + cmd('git co release/v7') + cmd('git merge master') + cmd('git push origin release/v7') + os.chdir("../") + + def drivers_clone(): - title("drivers: Clone") - cmd("git clone https://github.com/lvgl/lv_drivers.git") - os.chdir("./lv_drivers") - cmd("git co master") + title("drivers: Clone") + cmd("git clone https://github.com/lvgl/lv_drivers.git") + os.chdir("./lv_drivers") + cmd("git co master") def drivers_commit_push(v): - title("drivers: commit and push release") + title("drivers: commit and push release") - cmd('git ci -am "Release ' + v + '"') - cmd('git tag -a ' + v + ' -m "Release ' + v +'"') - cmd('git push origin master') - cmd('git push origin ' + v) + os.system('git ci -am "Release ' + v + '"') + cmd('git tag -a ' + v + ' -m "Release ' + v +'"') + cmd('git push origin master') + cmd('git push origin ' + v) def drivers_merge_to_release_branch(v): - title("drivers: merge to release branch") - cmd('git co release/v7') - cmd('git merge master') - cmd('git push origin release/v7') - os.chdir("../") + title("drivers: merge to release branch") + cmd('git co release/v7') + cmd('git merge master') + cmd('git push origin release/v7') + os.chdir("../") def docs_clone(): - title("docs: Clone") - cmd("git clone --recursive https://github.com/lvgl/docs.git") - os.chdir("./docs") + title("docs: Clone") + #cmd("git clone --recursive https://github.com/lvgl/docs.git") + os.chdir("./docs") def docs_get_api(): - title("docs: Get API files") - - cmd("git co latest") - cmd("rm -rf xml"); - cmd("cp -r ../../lvgl/docs/api_doc/xml ."); - cmd("git add xml"); - cmd('git commit -m "update API"') + title("docs: Get API files") + + cmd("git co latest --") + cmd("rm -rf xml"); + cmd("cp -r ../lvgl/docs/api_doc/xml ."); + cmd("git add xml"); + cmd('git commit -m "update API"') def docs_update_version(v): - title("docs: Update version number") + title("docs: Update version number") - f = open("./conf.py", "r") - - outbuf = "" - - for i in f.read().splitlines(): - r = re.search(r'^version = ', i) - if r: - i = "version = '" + v + "'" + f = open("./conf.py", "r") + + outbuf = "" + + for i in f.read().splitlines(): + r = re.search(r'^version = ', i) + if r: + i = "version = '" + v + "'" - r = re.search(r'^release = ', i) - if r: - i = "version = '" + v + "'" - - outbuf += i + '\n' - - f.close() + r = re.search(r'^release = ', i) + if r: + i = "version = '" + v + "'" + + outbuf += i + '\n' + + f.close() - f = open("./conf.py", "w") - - f.write(outbuf) - f.close() - cmd("git add conf.py") - cmd('git ci -m "update conf.py to ' + v '"') - -def docs_update_trans(): - title("docs: Update translations") - cmd("cd en && ./trans_push.py && ./trans_pull.py") + f = open("./conf.py", "w") + + f.write(outbuf) + f.close() + cmd("git add conf.py") + cmd('git ci -m "update conf.py to ' + v + '"') def docs_build(): - title("docs: Build") - cmd("git checkout master") - cmd("./update.py latest") - + title("docs: Build") + cmd("git checkout master") + cmd("./update.py latest") + def clean_up(): - title("Clean up repos") - os.chdir("../..") - cmd("rm -rf lvgl docs lv_examples lv_drivers") + title("Clean up repos") + os.chdir("../") + cmd("rm -rf lvgl docs lv_examples lv_drivers") lvgl_clone() lvgl_format() @@ -243,7 +240,6 @@ drivers_merge_to_release_branch(ver_str) docs_clone() docs_get_api() docs_update_version(ver_str) -#docs_update_trans() # Zanata is not working now docs_build() clean_up() From 7e9cf858d69d581967d57edf3acd3da1ae01e7ef Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 7 Jul 2020 10:03:52 +0200 Subject: [PATCH 10/30] update version number --- lvgl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lvgl.h b/lvgl.h index 178811bc1..6e1c15e33 100644 --- a/lvgl.h +++ b/lvgl.h @@ -77,9 +77,9 @@ extern "C" { *********************/ /*Current version of LVGL*/ #define LVGL_VERSION_MAJOR 7 -#define LVGL_VERSION_MINOR 1 +#define LVGL_VERSION_MINOR 2 #define LVGL_VERSION_PATCH 0 -#define LVGL_VERSION_INFO "" +#define LVGL_VERSION_INFO "dev" /********************** * TYPEDEFS From 039080fc261176dc958a62cb8e8a1e162116f444 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 7 Jul 2020 10:05:29 +0200 Subject: [PATCH 11/30] update changlog --- CHANGELOG.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 94a25ce52..91a25df37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,11 @@ # Changelog -## v7.2.0 (planned on 04.08.2020) +## v7.3.0 (planned on 04.08.2020) Available in the `dev` branch +## v7.2.0 (planned on 21.07.2020) +*Available in the `master` branch* + ### New features - Add `LV_CALENDAR_WEEK_STARTS_MONDAY` - Add `lv_chart_set_x_start_point()` function - Set the index of the x-axis start point in the data array @@ -19,8 +22,7 @@ Available in the `dev` branch - Add `lv_obj_align_x()` and `lv_obj_align_y()` functions - Add `lv_obj_align_origo_x()` and `lv_obj_align_origo_y()` functions -## v7.1.0 (planned on 07.07.2020) -*Available in the `master` branch* +## v7.1.0 (07.07.2020) ### New features - Add `focus_parent` attribute to `lv_obj` From 38e68eeb7abe65dd26704f1167bffc9ec5e8cfa9 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 7 Jul 2020 10:06:49 +0200 Subject: [PATCH 12/30] update version number --- lvgl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lvgl.h b/lvgl.h index 6e1c15e33..f90729d7b 100644 --- a/lvgl.h +++ b/lvgl.h @@ -77,7 +77,7 @@ extern "C" { *********************/ /*Current version of LVGL*/ #define LVGL_VERSION_MAJOR 7 -#define LVGL_VERSION_MINOR 2 +#define LVGL_VERSION_MINOR 3 #define LVGL_VERSION_PATCH 0 #define LVGL_VERSION_INFO "dev" From b2d78dcca7b9d0567f992993a7a271236c3d6075 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 7 Jul 2020 11:29:20 +0200 Subject: [PATCH 13/30] Create auto-comment.yml --- .github/.github/auto-comment.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .github/.github/auto-comment.yml diff --git a/.github/.github/auto-comment.yml b/.github/.github/auto-comment.yml new file mode 100644 index 000000000..6683944f7 --- /dev/null +++ b/.github/.github/auto-comment.yml @@ -0,0 +1,11 @@ +# Comment to a new issue. +pullRequestOpened: > + Thank you for raising your pull request. + + To ensure that all licensing criteria is met all repositories of the LVGL project apply a process called DCO (Developer's Certificate of Origin).  +  + The text of DCO can be read here: https://developercertificate.org/ +  + By contributing to any repositories of the LVGL project you state that your contribution corresponds with the DCO. + + From faf56680f81adbdf37322fef56caf0f8458f3237 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 7 Jul 2020 11:29:41 +0200 Subject: [PATCH 14/30] Delete auto-comment.yml --- .github/.github/auto-comment.yml | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 .github/.github/auto-comment.yml diff --git a/.github/.github/auto-comment.yml b/.github/.github/auto-comment.yml deleted file mode 100644 index 6683944f7..000000000 --- a/.github/.github/auto-comment.yml +++ /dev/null @@ -1,11 +0,0 @@ -# Comment to a new issue. -pullRequestOpened: > - Thank you for raising your pull request. - - To ensure that all licensing criteria is met all repositories of the LVGL project apply a process called DCO (Developer's Certificate of Origin).  -  - The text of DCO can be read here: https://developercertificate.org/ -  - By contributing to any repositories of the LVGL project you state that your contribution corresponds with the DCO. - - From c97a0684cf99c3fd60b77133cca0a08a1460d8b6 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 7 Jul 2020 11:30:35 +0200 Subject: [PATCH 15/30] Create auto-comment.yml --- .github/auto-comment.yml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .github/auto-comment.yml diff --git a/.github/auto-comment.yml b/.github/auto-comment.yml new file mode 100644 index 000000000..f718c7913 --- /dev/null +++ b/.github/auto-comment.yml @@ -0,0 +1,9 @@ +# Comment to a new issue. +pullRequestOpened: > + Thank you for raising your pull request. + + To ensure that all licensing criteria is met all repositories of the LVGL project apply a process called DCO (Developer's Certificate of Origin). + + The text of DCO can be read here: https://developercertificate.org/ + + By contributing to any repositories of the LVGL project you state that your contribution corresponds with the DCO. From c599a59f056f79d72e34f2925b9ddd4f1cac568f Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 7 Jul 2020 11:31:00 +0200 Subject: [PATCH 16/30] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e7d193fb2..9ee6eb709 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@

LVGL - Light and Versatile Graphics Library

- +

From a6793b2695919798dc7ccf5bf492523ae0da249f Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 7 Jul 2020 12:44:42 +0200 Subject: [PATCH 17/30] Update auto-comment.yml --- .github/auto-comment.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/auto-comment.yml b/.github/auto-comment.yml index f718c7913..e28adfc22 100644 --- a/.github/auto-comment.yml +++ b/.github/auto-comment.yml @@ -1,5 +1,5 @@ # Comment to a new issue. -pullRequestOpened: > +pullRequestOpened: | Thank you for raising your pull request. To ensure that all licensing criteria is met all repositories of the LVGL project apply a process called DCO (Developer's Certificate of Origin). @@ -7,3 +7,5 @@ pullRequestOpened: > The text of DCO can be read here: https://developercertificate.org/ By contributing to any repositories of the LVGL project you state that your contribution corresponds with the DCO. + + No further action is required if your contribution fulfills the DCO. If you are not sure about it feel free to ask us in a comemnt. From 234e74202ca08166406c55269b61087ce980563b Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 7 Jul 2020 12:58:03 +0200 Subject: [PATCH 18/30] image decoder open bug described in #1638 --- src/lv_draw/lv_img_decoder.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/lv_draw/lv_img_decoder.c b/src/lv_draw/lv_img_decoder.c index 245ab4711..0c2f67d72 100644 --- a/src/lv_draw/lv_img_decoder.c +++ b/src/lv_draw/lv_img_decoder.c @@ -153,10 +153,6 @@ lv_res_t lv_img_decoder_open(lv_img_decoder_dsc_t * dsc, const void * src, lv_co if(res == LV_RES_OK) break; } - if(res == LV_RES_INV) { - _lv_memset_00(dsc, sizeof(lv_img_decoder_dsc_t)); - } - return res; } From aff7a22ac59e592f8f116ec476729620497c16dd Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 7 Jul 2020 13:03:30 +0200 Subject: [PATCH 19/30] Update auto-comment.yml --- .github/auto-comment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/auto-comment.yml b/.github/auto-comment.yml index e28adfc22..7596dc8b7 100644 --- a/.github/auto-comment.yml +++ b/.github/auto-comment.yml @@ -8,4 +8,4 @@ pullRequestOpened: | By contributing to any repositories of the LVGL project you state that your contribution corresponds with the DCO. - No further action is required if your contribution fulfills the DCO. If you are not sure about it feel free to ask us in a comemnt. + No further action is required if your contribution fulfills the DCO. If you are not sure about it feel free to ask us in a comment. From 2cecd01b30d32c6af1e45198ad4de6ba5fac0ad5 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 7 Jul 2020 13:07:02 +0200 Subject: [PATCH 20/30] Update auto-comment.yml --- .github/auto-comment.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/auto-comment.yml b/.github/auto-comment.yml index 7596dc8b7..dc35b2355 100644 --- a/.github/auto-comment.yml +++ b/.github/auto-comment.yml @@ -5,6 +5,7 @@ pullRequestOpened: | To ensure that all licensing criteria is met all repositories of the LVGL project apply a process called DCO (Developer's Certificate of Origin). The text of DCO can be read here: https://developercertificate.org/ + For a more detailed description see the [Documentation](https://docs.lvgl.io/latest/en/html/contributing/index.html#dco) site. By contributing to any repositories of the LVGL project you state that your contribution corresponds with the DCO. From 343b70b19c600d2ed4b4b1eb26b40ff7eea42611 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 7 Jul 2020 13:09:26 +0200 Subject: [PATCH 21/30] Update auto-comment.yml --- .github/auto-comment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/auto-comment.yml b/.github/auto-comment.yml index dc35b2355..8ff0cf1e6 100644 --- a/.github/auto-comment.yml +++ b/.github/auto-comment.yml @@ -5,7 +5,7 @@ pullRequestOpened: | To ensure that all licensing criteria is met all repositories of the LVGL project apply a process called DCO (Developer's Certificate of Origin). The text of DCO can be read here: https://developercertificate.org/ - For a more detailed description see the [Documentation](https://docs.lvgl.io/latest/en/html/contributing/index.html#dco) site. + For a more detailed description see the [Documentation](https://docs.lvgl.io/latest/en/html/contributing/index.html#developer-certification-of-origin-dco) site. By contributing to any repositories of the LVGL project you state that your contribution corresponds with the DCO. From 646cb71a9d17e0c394c3e23c13bc53e07cd9a0ce Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 7 Jul 2020 20:40:33 +0200 Subject: [PATCH 22/30] Update library.json --- library.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.json b/library.json index faa8db1f7..3e83c49d8 100644 --- a/library.json +++ b/library.json @@ -1,7 +1,7 @@ { "name": "lvgl", "version": "v7.1.0", - "keywords": "graphics, gui, embedded, littlevgl", + "keywords": "graphics, gui, embedded, tft, lvgl", "description": "Graphics library to create embedded GUI with easy-to-use graphical elements, beautiful visual effects and low memory footprint. It offers anti-aliasing, opacity, and animations using only one frame buffer.", "repository": { From 019042297d4a99711bf51a01b7ecd8bf07e46a60 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Wed, 8 Jul 2020 06:26:56 +0200 Subject: [PATCH 23/30] Update library.json --- library.json | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/library.json b/library.json index 3e83c49d8..ed34d7fff 100644 --- a/library.json +++ b/library.json @@ -1,14 +1,17 @@ { - "name": "lvgl", - "version": "v7.1.0", - "keywords": "graphics, gui, embedded, tft, lvgl", - "description": "Graphics library to create embedded GUI with easy-to-use graphical elements, beautiful visual effects and low memory footprint. It offers anti-aliasing, opacity, and animations using only one frame buffer.", - "repository": - { - "type": "git", - "url": "https://github.com/lvgl/lvgl.git" - }, - "build": { - "includeDir": "." - } + "name": "lvgl", + "version": "v7.1.0", + "keywords": "graphics, gui, embedded, tft, lvgl", + "description": "Graphics library to create embedded GUI with easy-to-use graphical elements, beautiful visual effects and low memory footprint. It offers anti-aliasing, opacity, and animations using only one frame buffer.", + "repository": { + "type": "git", + "url": "https://github.com/lvgl/lvgl.git" + }, + "build": { + "includeDir": "." + }, + "license": "MIT", + "homepage": "https://lvgl.io", + "frameworks": "*", + "platforms": "*" } From 843555a4b18e17797395e26760eaa70c32da4bcd Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Wed, 8 Jul 2020 09:28:35 +0200 Subject: [PATCH 24/30] Add lv_task_get_next --- src/lv_misc/lv_task.c | 11 +++++++++++ src/lv_misc/lv_task.h | 7 +++++++ 2 files changed, 18 insertions(+) diff --git a/src/lv_misc/lv_task.c b/src/lv_misc/lv_task.c index 1779a1272..c051d9faa 100644 --- a/src/lv_misc/lv_task.c +++ b/src/lv_misc/lv_task.c @@ -378,6 +378,17 @@ uint8_t lv_task_get_idle(void) return idle_last; } +/** + * Iterate through the tasks + * @param task NULL to start iteration or the previous return value to get the next task + * @return the next task or NULL if there is no more task + */ +lv_task_t * lv_task_get_next(lv_task_t * task) +{ + if(task == NULL) return _lv_ll_get_head(&LV_GC_ROOT(_lv_task_ll)); + else return _lv_ll_get_next(&LV_GC_ROOT(_lv_task_ll), task); +} + /********************** * STATIC FUNCTIONS **********************/ diff --git a/src/lv_misc/lv_task.h b/src/lv_misc/lv_task.h index bfd428369..d3dfc4adb 100644 --- a/src/lv_misc/lv_task.h +++ b/src/lv_misc/lv_task.h @@ -165,6 +165,13 @@ void lv_task_enable(bool en); */ uint8_t lv_task_get_idle(void); +/** + * Iterate through the tasks + * @param task NULL to start iteration or the previous return value to get the next task + * @return the next task or NULL if there is no more task + */ +lv_task_t * lv_task_get_next(lv_task_t * task); + /********************** * MACROS **********************/ From 15b7ea6614fa4ba383ed298e8b0886e4ed585eb0 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Wed, 8 Jul 2020 09:29:36 +0200 Subject: [PATCH 25/30] Add lv_event_send_refresh, lv_event_send_refresh_recursive, lv_event_queue_refresh_recursive Used to easily send LV_EVENT_REFRESH to objects --- CHANGELOG.md | 4 +++ src/lv_core/lv_obj.c | 71 ++++++++++++++++++++++++++++++++++++++++++++ src/lv_core/lv_obj.h | 22 ++++++++++++++ 3 files changed, 97 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91a25df37..04ec86cb9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ ## v7.3.0 (planned on 04.08.2020) Available in the `dev` branch +### New features +- Add `lv_task_get_next` +- Add `lv_event_send_refresh`, `lv_event_send_refresh_recursive`, `lv_event_queue_refresh_recursive` to easily send `LV_EVENT_REFRESH` to object + ## v7.2.0 (planned on 21.07.2020) *Available in the `master` branch* diff --git a/src/lv_core/lv_obj.c b/src/lv_core/lv_obj.c index 024216ce3..c11917d8d 100644 --- a/src/lv_core/lv_obj.c +++ b/src/lv_core/lv_obj.c @@ -98,6 +98,7 @@ static void opa_scale_anim(lv_obj_t * obj, lv_anim_value_t v); static void fade_in_anim_ready(lv_anim_t * a); #endif static void lv_event_mark_deleted(lv_obj_t * obj); +static void refresh_event_task_cb(lv_task_t * t); static bool obj_valid_child(const lv_obj_t * parent, const lv_obj_t * obj_to_find); static void lv_obj_del_async_cb(void * obj); static void obj_del_core(lv_obj_t * obj); @@ -1751,6 +1752,71 @@ lv_res_t lv_event_send(lv_obj_t * obj, lv_event_t event, const void * data) return res; } +/** + * Send LV_EVENT_REFRESH event to an object + * @param obj point to an obejct. (Can NOT be NULL) + * @return LV_RES_OK: success, LV_RES_INV: to object become invalid (e.g. deleted) due to this event. + */ +lv_res_t lv_event_send_refresh(lv_obj_t * obj) +{ + return lv_event_send(obj, LV_EVENT_REFRESH, NULL); +} + +/** + * Send LV_EVENT_REFRESH event to an object all of its children. + * @param obj pointer to an object or NULL to refresh all objects of all displays + */ +void lv_event_send_refresh_recursive(lv_obj_t * obj) +{ + if(obj == NULL) { + /*If no obj specified refresh all screen of all displays */ + lv_disp_t * d = lv_disp_get_next(NULL); + while(d) { + lv_obj_t * scr = _lv_ll_get_head(&d->scr_ll); + while(scr) { + lv_event_send_refresh_recursive(scr); + scr = _lv_ll_get_next(&d->scr_ll, scr); + } + lv_event_send_refresh_recursive(d->top_layer); + lv_event_send_refresh_recursive(d->sys_layer); + + d = lv_disp_get_next(d); + } + } else { + + lv_res_t res = lv_event_send_refresh(obj); + if(res != LV_RES_OK) return; /*If invalid returned do not check the children*/ + + lv_obj_t * child = lv_obj_get_child(obj, NULL); + while(child) { + lv_event_send_refresh_recursive(child); + + child = lv_obj_get_child(obj, child); + } + } +} + +/** + * Queue the sending of LV_EVENT_REFRESH event to an object all of its children. + * The events won't be sent immediately but after `LV_DISP_DEF_REFR_PERIOD` delay. + * It is useful to refresh object only on a reasonable rate if this function is called very often. + * @param obj pointer to an object or NULL to refresh all objects of all displays + */ +void lv_event_queue_refresh_recursive(lv_obj_t * obj) +{ + lv_task_t * t = lv_task_get_next(NULL); + while(t) { + /* REturn if a refresh is already queued for this object*/ + if(t->task_cb == refresh_event_task_cb && t->user_data == obj) return; + t = lv_task_get_next(t); + } + + /*No queued task for this object so create one now*/ + t = lv_task_create(refresh_event_task_cb, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, obj); + lv_task_set_repeat_count(t, 1); +} + + /** * Call an event function with an object, event, and data. * @param event_xcb an event callback function. If `NULL` `LV_RES_OK` will return without any actions. @@ -4231,6 +4297,11 @@ static void lv_event_mark_deleted(lv_obj_t * obj) } } +static void refresh_event_task_cb(lv_task_t * t) +{ + lv_event_send_refresh_recursive(t->user_data); +} + static bool obj_valid_child(const lv_obj_t * parent, const lv_obj_t * obj_to_find) { /*Check all children of `parent`*/ diff --git a/src/lv_core/lv_obj.h b/src/lv_core/lv_obj.h index ad438c399..e6113e0d5 100644 --- a/src/lv_core/lv_obj.h +++ b/src/lv_core/lv_obj.h @@ -823,6 +823,28 @@ void lv_obj_set_event_cb(lv_obj_t * obj, lv_event_cb_t event_cb); */ lv_res_t lv_event_send(lv_obj_t * obj, lv_event_t event, const void * data); + +/** + * Send LV_EVENT_REFRESH event to an object + * @param obj point to an obejct. (Can NOT be NULL) + * @return LV_RES_OK: success, LV_RES_INV: to object become invalid (e.g. deleted) due to this event. + */ +lv_res_t lv_event_send_refresh(lv_obj_t * obj); + +/** + * Send LV_EVENT_REFRESH event to an object all of its children + * @param obj pointer to an object or NULL to refresh all objects of all displays + */ +void lv_event_send_refresh_recursive(lv_obj_t * obj); + +/** + * Queue the sending of LV_EVENT_REFRESH event to an object all of its children. + * The events won't be sent immediately but after `LV_DISP_DEF_REFR_PERIOD` delay. + * It is useful to refresh object only on a reasonable rate if this function is called very often. + * @param obj pointer to an object or NULL to refresh all objects of all displays + */ +void lv_event_queue_refresh_recursive(lv_obj_t * obj); + /** * Call an event function with an object, event, and data. * @param event_xcb an event callback function. If `NULL` `LV_RES_OK` will return without any actions. From ec64820272c90d4901eeda4b343d7424c38e8271 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 7 Jul 2020 17:30:43 +0200 Subject: [PATCH 26/30] tileview: fix navigation when not screen sized --- CHANGELOG.md | 3 +++ src/lv_widgets/lv_tileview.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91a25df37..0a4986d5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,9 @@ Available in the `dev` branch - Add `lv_obj_align_x()` and `lv_obj_align_y()` functions - Add `lv_obj_align_origo_x()` and `lv_obj_align_origo_y()` functions +### Bugfixes +- `tileview` fix navigation when not screen sized + ## v7.1.0 (07.07.2020) ### New features diff --git a/src/lv_widgets/lv_tileview.c b/src/lv_widgets/lv_tileview.c index 9d1fec097..0ea0f8133 100644 --- a/src/lv_widgets/lv_tileview.c +++ b/src/lv_widgets/lv_tileview.c @@ -403,8 +403,8 @@ static void drag_end_handler(lv_obj_t * tileview) lv_obj_t * scrl = lv_page_get_scrollable(tileview); lv_point_t p; - p.x = -(scrl->coords.x1 - lv_obj_get_width(tileview) / 2); - p.y = -(scrl->coords.y1 - lv_obj_get_height(tileview) / 2); + p.x = -(lv_obj_get_x(scrl) - lv_obj_get_width(tileview) / 2); + p.y = -(lv_obj_get_y(scrl) - lv_obj_get_height(tileview) / 2); lv_drag_dir_t drag_dir = indev->proc.types.pointer.drag_dir; /*From the drag vector (drag throw) predict the end position*/ From cbc88285d3e1eb4a51520dab348d92fd6b9a5db7 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Wed, 8 Jul 2020 08:42:32 +0200 Subject: [PATCH 27/30] change default fot to 14 px for better compatibility with small displays Related to #1602 --- lv_conf_template.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lv_conf_template.h b/lv_conf_template.h index 9564f2769..7461dd9d7 100644 --- a/lv_conf_template.h +++ b/lv_conf_template.h @@ -348,8 +348,8 @@ typedef void * lv_indev_drv_user_data_t; /*Type of user data in the i /* Montserrat fonts with bpp = 4 * https://fonts.google.com/specimen/Montserrat */ #define LV_FONT_MONTSERRAT_12 0 -#define LV_FONT_MONTSERRAT_14 0 -#define LV_FONT_MONTSERRAT_16 1 +#define LV_FONT_MONTSERRAT_14 1 +#define LV_FONT_MONTSERRAT_16 0 #define LV_FONT_MONTSERRAT_18 0 #define LV_FONT_MONTSERRAT_20 0 #define LV_FONT_MONTSERRAT_22 0 @@ -431,10 +431,10 @@ typedef void * lv_font_user_data_t; #define LV_THEME_DEFAULT_COLOR_PRIMARY lv_color_hex(0x01a2b1) #define LV_THEME_DEFAULT_COLOR_SECONDARY lv_color_hex(0x44d1b6) #define LV_THEME_DEFAULT_FLAG LV_THEME_MATERIAL_FLAG_LIGHT -#define LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_16 -#define LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_16 -#define LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_16 -#define LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_16 +#define LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_14 +#define LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_14 +#define LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_14 +#define LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_14 /*================= * Text settings From b769463d398ae9cab11c576c3f788cf816fc6df5 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Wed, 8 Jul 2020 09:31:49 +0200 Subject: [PATCH 28/30] update CHANGELONG and lv_conf_internal.h --- CHANGELOG.md | 1 + src/lv_conf_internal.h | 15 ++++++--------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a4986d5f..e1a1ae061 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ Available in the `dev` branch ### Bugfixes - `tileview` fix navigation when not screen sized +- Use 14px font by default to for better compatibility with smaller displays ## v7.1.0 (07.07.2020) diff --git a/src/lv_conf_internal.h b/src/lv_conf_internal.h index b162f3c9e..52eb79990 100644 --- a/src/lv_conf_internal.h +++ b/src/lv_conf_internal.h @@ -294,9 +294,6 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */ #ifndef LV_USE_API_EXTENSION_V6 #define LV_USE_API_EXTENSION_V6 1 #endif -#ifndef LV_USE_API_EXTENSION_V7 -#define LV_USE_API_EXTENSION_V7 1 -#endif /*======================== * Image decoder and cache @@ -498,10 +495,10 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */ #define LV_FONT_MONTSERRAT_12 0 #endif #ifndef LV_FONT_MONTSERRAT_14 -#define LV_FONT_MONTSERRAT_14 0 +#define LV_FONT_MONTSERRAT_14 1 #endif #ifndef LV_FONT_MONTSERRAT_16 -#define LV_FONT_MONTSERRAT_16 1 +#define LV_FONT_MONTSERRAT_16 0 #endif #ifndef LV_FONT_MONTSERRAT_18 #define LV_FONT_MONTSERRAT_18 0 @@ -650,16 +647,16 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */ #define LV_THEME_DEFAULT_FLAG LV_THEME_MATERIAL_FLAG_LIGHT #endif #ifndef LV_THEME_DEFAULT_FONT_SMALL -#define LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_16 +#define LV_THEME_DEFAULT_FONT_SMALL &lv_font_montserrat_14 #endif #ifndef LV_THEME_DEFAULT_FONT_NORMAL -#define LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_16 +#define LV_THEME_DEFAULT_FONT_NORMAL &lv_font_montserrat_14 #endif #ifndef LV_THEME_DEFAULT_FONT_SUBTITLE -#define LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_16 +#define LV_THEME_DEFAULT_FONT_SUBTITLE &lv_font_montserrat_14 #endif #ifndef LV_THEME_DEFAULT_FONT_TITLE -#define LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_16 +#define LV_THEME_DEFAULT_FONT_TITLE &lv_font_montserrat_14 #endif /*================= From 1a3b6d4cb3f4288ef1a7786798d7466b24cd29b8 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Wed, 8 Jul 2020 09:35:25 +0200 Subject: [PATCH 29/30] update lv_conf_internal.h --- lv_conf_template.h | 1 + src/lv_conf_internal.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/lv_conf_template.h b/lv_conf_template.h index 7461dd9d7..36a55ee15 100644 --- a/lv_conf_template.h +++ b/lv_conf_template.h @@ -197,6 +197,7 @@ typedef void * lv_fs_drv_user_data_t; /*1: Use the functions and types from the older API if possible */ #define LV_USE_API_EXTENSION_V6 1 +#define LV_USE_API_EXTENSION_V7 1 /*======================== * Image decoder and cache diff --git a/src/lv_conf_internal.h b/src/lv_conf_internal.h index 52eb79990..135e8c374 100644 --- a/src/lv_conf_internal.h +++ b/src/lv_conf_internal.h @@ -294,6 +294,9 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h" */ #ifndef LV_USE_API_EXTENSION_V6 #define LV_USE_API_EXTENSION_V6 1 #endif +#ifndef LV_USE_API_EXTENSION_V7 +#define LV_USE_API_EXTENSION_V7 1 +#endif /*======================== * Image decoder and cache From a5de71933b60bf4971260dc762d23953b8f9289a Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Wed, 8 Jul 2020 10:31:36 +0200 Subject: [PATCH 30/30] fix typoe in comments --- src/lv_core/lv_obj.c | 4 ++-- src/lv_core/lv_obj.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lv_core/lv_obj.c b/src/lv_core/lv_obj.c index c11917d8d..e30520a0d 100644 --- a/src/lv_core/lv_obj.c +++ b/src/lv_core/lv_obj.c @@ -1763,7 +1763,7 @@ lv_res_t lv_event_send_refresh(lv_obj_t * obj) } /** - * Send LV_EVENT_REFRESH event to an object all of its children. + * Send LV_EVENT_REFRESH event to an object and all of its children. * @param obj pointer to an object or NULL to refresh all objects of all displays */ void lv_event_send_refresh_recursive(lv_obj_t * obj) @@ -1797,7 +1797,7 @@ void lv_event_send_refresh_recursive(lv_obj_t * obj) } /** - * Queue the sending of LV_EVENT_REFRESH event to an object all of its children. + * Queue the sending of LV_EVENT_REFRESH event to an object and all of its children. * The events won't be sent immediately but after `LV_DISP_DEF_REFR_PERIOD` delay. * It is useful to refresh object only on a reasonable rate if this function is called very often. * @param obj pointer to an object or NULL to refresh all objects of all displays diff --git a/src/lv_core/lv_obj.h b/src/lv_core/lv_obj.h index e6113e0d5..0f985ff83 100644 --- a/src/lv_core/lv_obj.h +++ b/src/lv_core/lv_obj.h @@ -832,13 +832,13 @@ lv_res_t lv_event_send(lv_obj_t * obj, lv_event_t event, const void * data); lv_res_t lv_event_send_refresh(lv_obj_t * obj); /** - * Send LV_EVENT_REFRESH event to an object all of its children + * Send LV_EVENT_REFRESH event to an object and all of its children * @param obj pointer to an object or NULL to refresh all objects of all displays */ void lv_event_send_refresh_recursive(lv_obj_t * obj); /** - * Queue the sending of LV_EVENT_REFRESH event to an object all of its children. + * Queue the sending of LV_EVENT_REFRESH event to an object and all of its children. * The events won't be sent immediately but after `LV_DISP_DEF_REFR_PERIOD` delay. * It is useful to refresh object only on a reasonable rate if this function is called very often. * @param obj pointer to an object or NULL to refresh all objects of all displays