From ec9de515b36641be565d7bace5863ab631ce3b69 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 16 Mar 2021 16:31:32 +0100 Subject: [PATCH] Release v7.11.0 --- Kconfig | 2 +- lv_conf_template.h | 2 +- lvgl.h | 2 +- src/lv_core/lv_indev.c | 2 +- src/lv_core/lv_refr.c | 59 ++++++++++++++++++++++-------------- src/lv_core/lv_style.c | 2 +- src/lv_core/lv_style.h | 2 +- src/lv_draw/lv_img_cache.c | 2 +- src/lv_draw/lv_img_decoder.c | 6 ++-- src/lv_hal/lv_hal_disp.c | 4 +-- src/lv_widgets/lv_bar.c | 3 +- src/lv_widgets/lv_label.c | 8 ++--- 12 files changed, 54 insertions(+), 40 deletions(-) diff --git a/Kconfig b/Kconfig index 1d97cadaa..0e48abbb9 100644 --- a/Kconfig +++ b/Kconfig @@ -1,4 +1,4 @@ -# Kconfig file for LVGL v7.10.1 +# Kconfig file for LVGL v7.11.0 menu "LVGL configuration" diff --git a/lv_conf_template.h b/lv_conf_template.h index dc1881bf2..ebcab297f 100644 --- a/lv_conf_template.h +++ b/lv_conf_template.h @@ -1,6 +1,6 @@ /** * @file lv_conf.h - * Configuration file for v7.10.1 + * Configuration file for v7.11.0 */ /* diff --git a/lvgl.h b/lvgl.h index 02ace0af0..4aa1d7e2b 100644 --- a/lvgl.h +++ b/lvgl.h @@ -16,7 +16,7 @@ extern "C" { #define LVGL_VERSION_MAJOR 7 #define LVGL_VERSION_MINOR 11 #define LVGL_VERSION_PATCH 0 -#define LVGL_VERSION_INFO "dev" +#define LVGL_VERSION_INFO "" /********************* * INCLUDES diff --git a/src/lv_core/lv_indev.c b/src/lv_core/lv_indev.c index 30afaa048..a58ea3937 100644 --- a/src/lv_core/lv_indev.c +++ b/src/lv_core/lv_indev.c @@ -413,7 +413,7 @@ lv_task_t * lv_indev_get_read_task(lv_disp_t * indev) */ static void indev_pointer_proc(lv_indev_t * i, lv_indev_data_t * data) { - lv_disp_t *disp = i->driver.disp; + lv_disp_t * disp = i->driver.disp; if(disp->driver.rotated == LV_DISP_ROT_180 || disp->driver.rotated == LV_DISP_ROT_270) { data->point.x = disp->driver.hor_res - data->point.x - 1; data->point.y = disp->driver.ver_res - data->point.y - 1; diff --git a/src/lv_core/lv_refr.c b/src/lv_core/lv_refr.c index 22e585a4b..8199f4eac 100644 --- a/src/lv_core/lv_refr.c +++ b/src/lv_core/lv_refr.c @@ -741,7 +741,8 @@ static void lv_refr_obj(lv_obj_t * obj, const lv_area_t * mask_ori_p) } } -static void lv_refr_vdb_rotate_180(lv_disp_drv_t *drv, lv_area_t *area, lv_color_t *color_p) { +static void lv_refr_vdb_rotate_180(lv_disp_drv_t * drv, lv_area_t * area, lv_color_t * color_p) +{ lv_coord_t area_w = lv_area_get_width(area); lv_coord_t area_h = lv_area_get_height(area); uint32_t total = area_w * area_h; @@ -764,8 +765,10 @@ static void lv_refr_vdb_rotate_180(lv_disp_drv_t *drv, lv_area_t *area, lv_color area->x1 = drv->hor_res - tmp_coord - 1; } -static LV_ATTRIBUTE_FAST_MEM void lv_refr_vdb_rotate_90(bool invert_i, lv_coord_t area_w, lv_coord_t area_h, lv_color_t *orig_color_p, lv_color_t *rot_buf) { - +static LV_ATTRIBUTE_FAST_MEM void lv_refr_vdb_rotate_90(bool invert_i, lv_coord_t area_w, lv_coord_t area_h, + lv_color_t * orig_color_p, lv_color_t * rot_buf) +{ + uint32_t invert = (area_w * area_h) - 1; uint32_t initial_i = ((area_w - 1) * area_h); for(lv_coord_t y = 0; y < area_h; y++) { @@ -785,7 +788,8 @@ static LV_ATTRIBUTE_FAST_MEM void lv_refr_vdb_rotate_90(bool invert_i, lv_coord_ /** * Helper function for lv_refr_vdb_rotate_90_sqr. Given a list of four numbers, rotate the entire list to the left. */ -static inline void lv_vdb_rotate4(lv_color_t *a, lv_color_t *b, lv_color_t * c, lv_color_t * d) { +static inline void lv_vdb_rotate4(lv_color_t * a, lv_color_t * b, lv_color_t * c, lv_color_t * d) +{ lv_color_t tmp; tmp = *a; *a = *b; @@ -798,9 +802,10 @@ static inline void lv_vdb_rotate4(lv_color_t *a, lv_color_t *b, lv_color_t * c, * Rotate a square image 90/270 degrees in place. * @note inspired by https://stackoverflow.com/a/43694906 */ -static void lv_refr_vdb_rotate_90_sqr(bool is_270, lv_coord_t w, lv_color_t * color_p) { - for(lv_coord_t i = 0; i < w/2; i++) { - for(lv_coord_t j = 0; j < (w + 1)/2; j++) { +static void lv_refr_vdb_rotate_90_sqr(bool is_270, lv_coord_t w, lv_color_t * color_p) +{ + for(lv_coord_t i = 0; i < w / 2; i++) { + for(lv_coord_t j = 0; j < (w + 1) / 2; j++) { lv_coord_t inv_i = (w - 1) - i; lv_coord_t inv_j = (w - 1) - j; if(is_270) { @@ -810,7 +815,8 @@ static void lv_refr_vdb_rotate_90_sqr(bool is_270, lv_coord_t w, lv_color_t * co &color_p[inv_i * w + inv_j], &color_p[j * w + inv_i] ); - } else { + } + else { lv_vdb_rotate4( &color_p[i * w + j], &color_p[j * w + inv_i], @@ -818,7 +824,7 @@ static void lv_refr_vdb_rotate_90_sqr(bool is_270, lv_coord_t w, lv_color_t * co &color_p[inv_j * w + i] ); } - + } } } @@ -826,7 +832,8 @@ static void lv_refr_vdb_rotate_90_sqr(bool is_270, lv_coord_t w, lv_color_t * co /** * Rotate the VDB to the display's native orientation. */ -static void lv_refr_vdb_rotate(lv_area_t *area, lv_color_t *color_p) { +static void lv_refr_vdb_rotate(lv_area_t * area, lv_color_t * color_p) +{ lv_disp_drv_t * drv = &disp_refr->driver; if(lv_disp_is_true_double_buf(disp_refr) && drv->sw_rotate) { LV_LOG_ERROR("cannot rotate a true double-buffered display!"); @@ -835,20 +842,22 @@ static void lv_refr_vdb_rotate(lv_area_t *area, lv_color_t *color_p) { if(drv->rotated == LV_DISP_ROT_180) { lv_refr_vdb_rotate_180(drv, area, color_p); drv->flush_cb(drv, area, color_p); - } else if(drv->rotated == LV_DISP_ROT_90 || drv->rotated == LV_DISP_ROT_270) { + } + else if(drv->rotated == LV_DISP_ROT_90 || drv->rotated == LV_DISP_ROT_270) { /*Allocate a temporary buffer to store rotated image */ - lv_color_t * rot_buf = NULL; + lv_color_t * rot_buf = NULL; lv_disp_buf_t * vdb = lv_disp_get_buf(disp_refr); lv_coord_t area_w = lv_area_get_width(area); lv_coord_t area_h = lv_area_get_height(area); /*Determine the maximum number of rows that can be rotated at a time*/ - lv_coord_t max_row = LV_MATH_MIN((lv_coord_t)((LV_DISP_ROT_MAX_BUF/sizeof(lv_color_t)) / area_w), area_h); + lv_coord_t max_row = LV_MATH_MIN((lv_coord_t)((LV_DISP_ROT_MAX_BUF / sizeof(lv_color_t)) / area_w), area_h); lv_coord_t init_y_off; init_y_off = area->y1; if(drv->rotated == LV_DISP_ROT_90) { area->y2 = drv->ver_res - area->x1 - 1; area->y1 = area->y2 - area_w + 1; - } else { + } + else { area->y1 = area->x1; area->y2 = area->y1 + area_w - 1; } @@ -856,7 +865,7 @@ static void lv_refr_vdb_rotate(lv_area_t *area, lv_color_t *color_p) { /*Rotate the screen in chunks, flushing after each one*/ lv_coord_t row = 0; while(row < area_h) { - lv_coord_t height = LV_MATH_MIN(max_row, area_h-row); + lv_coord_t height = LV_MATH_MIN(max_row, area_h - row); vdb->flushing = 1; if((row == 0) && (area_h >= area_w)) { /*Rotate the initial area as a square*/ @@ -864,21 +873,24 @@ static void lv_refr_vdb_rotate(lv_area_t *area, lv_color_t *color_p) { lv_refr_vdb_rotate_90_sqr(drv->rotated == LV_DISP_ROT_270, area_w, color_p); if(drv->rotated == LV_DISP_ROT_90) { area->x1 = init_y_off; - area->x2 = init_y_off+area_w-1; - } else { + area->x2 = init_y_off + area_w - 1; + } + else { area->x2 = drv->hor_res - 1 - init_y_off; area->x1 = area->x2 - area_w + 1; } - } else { + } + else { /*Rotate other areas using a maximum buffer size*/ if(rot_buf == NULL) rot_buf = _lv_mem_buf_get(LV_DISP_ROT_MAX_BUF); lv_refr_vdb_rotate_90(drv->rotated == LV_DISP_ROT_270, area_w, height, color_p, rot_buf); - + if(drv->rotated == LV_DISP_ROT_90) { - area->x1 = init_y_off+row; - area->x2 = init_y_off+row+height-1; - } else { + area->x1 = init_y_off + row; + area->x2 = init_y_off + row + height - 1; + } + else { area->x2 = drv->hor_res - 1 - init_y_off - row; area->x1 = area->x2 - height + 1; } @@ -927,7 +939,8 @@ static void lv_refr_vdb_flush(void) /*Rotate the buffer to the display's native orientation if necessary*/ if(disp->driver.rotated != LV_DISP_ROT_NONE && disp->driver.sw_rotate) { lv_refr_vdb_rotate(&vdb->area, vdb->buf_act); - } else { + } + else { disp->driver.flush_cb(&disp->driver, &vdb->area, color_p); } } diff --git a/src/lv_core/lv_style.c b/src/lv_core/lv_style.c index 762e5338e..387b4da88 100644 --- a/src/lv_core/lv_style.c +++ b/src/lv_core/lv_style.c @@ -171,7 +171,7 @@ void lv_style_list_copy(lv_style_list_t * list_dest, const lv_style_list_t * lis } lv_style_t * local_style = get_alloc_local_style(list_dest); - if (local_style) + if(local_style) lv_style_copy(local_style, get_alloc_local_style((lv_style_list_t *)list_src)); } } diff --git a/src/lv_core/lv_style.h b/src/lv_core/lv_style.h index 0ed1d2962..3ac80eb37 100644 --- a/src/lv_core/lv_style.h +++ b/src/lv_core/lv_style.h @@ -145,7 +145,7 @@ enum { LV_STYLE_PROP_INIT(LV_STYLE_PATTERN_REPEAT, 0x6, LV_STYLE_ID_VALUE + 1, LV_STYLE_ATTR_NONE), LV_STYLE_PROP_INIT(LV_STYLE_PATTERN_RECOLOR, 0x6, LV_STYLE_ID_COLOR + 0, LV_STYLE_ATTR_NONE), LV_STYLE_PROP_INIT(LV_STYLE_PATTERN_OPA, 0x6, LV_STYLE_ID_OPA + 0, LV_STYLE_ATTR_NONE), - LV_STYLE_PROP_INIT(LV_STYLE_PATTERN_RECOLOR_OPA,0x6, LV_STYLE_ID_OPA + 1, LV_STYLE_ATTR_NONE), + LV_STYLE_PROP_INIT(LV_STYLE_PATTERN_RECOLOR_OPA, 0x6, LV_STYLE_ID_OPA + 1, LV_STYLE_ATTR_NONE), LV_STYLE_PROP_INIT(LV_STYLE_PATTERN_IMAGE, 0x6, LV_STYLE_ID_PTR + 0, LV_STYLE_ATTR_NONE), LV_STYLE_PROP_INIT(LV_STYLE_VALUE_LETTER_SPACE, 0x7, LV_STYLE_ID_VALUE + 0, LV_STYLE_ATTR_NONE), diff --git a/src/lv_draw/lv_img_cache.c b/src/lv_draw/lv_img_cache.c index dfc9b690b..364fdebf5 100644 --- a/src/lv_draw/lv_img_cache.c +++ b/src/lv_draw/lv_img_cache.c @@ -34,7 +34,7 @@ * STATIC PROTOTYPES **********************/ #if LV_IMG_CACHE_DEF_SIZE -static bool lv_img_cache_match(const void * src1, const void * src2); + static bool lv_img_cache_match(const void * src1, const void * src2); #endif #if LV_IMG_CACHE_DEF_SIZE == 0 diff --git a/src/lv_draw/lv_img_decoder.c b/src/lv_draw/lv_img_decoder.c index 05e379484..2a6aeb1bd 100644 --- a/src/lv_draw/lv_img_decoder.c +++ b/src/lv_draw/lv_img_decoder.c @@ -83,7 +83,7 @@ void _lv_img_decoder_init(void) */ lv_res_t lv_img_decoder_get_info(const char * src, lv_img_header_t * header) { - _lv_memset_00(header, sizeof(lv_img_header_t)); + _lv_memset_00(header, sizeof(lv_img_header_t)); lv_res_t res = LV_RES_INV; lv_img_decoder_t * d; @@ -629,7 +629,7 @@ static lv_res_t lv_img_decoder_built_in_line_alpha(lv_img_decoder_dsc_t * dsc, l #if LV_USE_FILESYSTEM lv_img_decoder_built_in_data_t * user_data = dsc->user_data; uint8_t * fs_buf = _lv_mem_buf_get(w); - if (fs_buf == NULL) return LV_RES_INV; + if(fs_buf == NULL) return LV_RES_INV; #endif const uint8_t * data_tmp = NULL; @@ -713,7 +713,7 @@ static lv_res_t lv_img_decoder_built_in_line_indexed(lv_img_decoder_dsc_t * dsc, #if LV_USE_FILESYSTEM uint8_t * fs_buf = _lv_mem_buf_get(w); - if (fs_buf == NULL) return LV_RES_INV; + if(fs_buf == NULL) return LV_RES_INV; #endif const uint8_t * data_tmp = NULL; if(dsc->src_type == LV_IMG_SRC_VARIABLE) { diff --git a/src/lv_hal/lv_hal_disp.c b/src/lv_hal/lv_hal_disp.c index c77bec21f..bd31f3e31 100644 --- a/src/lv_hal/lv_hal_disp.c +++ b/src/lv_hal/lv_hal_disp.c @@ -178,10 +178,10 @@ lv_disp_t * lv_disp_drv_register(lv_disp_drv_t * driver) * @param new_drv pointer to the new driver */ void lv_disp_drv_update(lv_disp_t * disp, lv_disp_drv_t * new_drv) -{ +{ if(new_drv != &disp->driver) memcpy(&disp->driver, new_drv, sizeof(lv_disp_drv_t)); - + lv_obj_t * scr; _LV_LL_READ(disp->scr_ll, scr) { lv_obj_set_size(scr, lv_disp_get_hor_res(disp), lv_disp_get_ver_res(disp)); diff --git a/src/lv_widgets/lv_bar.c b/src/lv_widgets/lv_bar.c index c9d96cb78..0e1723dbc 100644 --- a/src/lv_widgets/lv_bar.c +++ b/src/lv_widgets/lv_bar.c @@ -545,7 +545,8 @@ static void draw_indic(lv_obj_t * bar, const lv_area_t * clip_area) *axis1 = *axis2; *axis2 = zero; } - } else { + } + else { zero = *axis2 - shift + 1; if(*axis1 > zero) *axis2 = zero; diff --git a/src/lv_widgets/lv_label.c b/src/lv_widgets/lv_label.c index 74d791dcf..8c0a6c4b0 100644 --- a/src/lv_widgets/lv_label.c +++ b/src/lv_widgets/lv_label.c @@ -1038,10 +1038,10 @@ void lv_label_refr_text(lv_obj_t * label) lv_anim_value_t start, end; lv_bidi_dir_t base_dir = lv_obj_get_base_dir(label); - if (base_dir == LV_BIDI_DIR_AUTO) + if(base_dir == LV_BIDI_DIR_AUTO) base_dir = _lv_bidi_detect_base_dir(ext->text); - if (base_dir == LV_BIDI_DIR_RTL) { + if(base_dir == LV_BIDI_DIR_RTL) { start = lv_area_get_width(&txt_coords) - size.x; end = 0; } @@ -1136,10 +1136,10 @@ void lv_label_refr_text(lv_obj_t * label) lv_anim_value_t start, end; lv_bidi_dir_t base_dir = lv_obj_get_base_dir(label); - if (base_dir == LV_BIDI_DIR_AUTO) + if(base_dir == LV_BIDI_DIR_AUTO) base_dir = _lv_bidi_detect_base_dir(ext->text); - if (base_dir == LV_BIDI_DIR_RTL) { + if(base_dir == LV_BIDI_DIR_RTL) { start = -size.x - lv_font_get_glyph_width(font, ' ', ' ') * LV_LABEL_WAIT_CHAR_COUNT; end = 0; }