From eb67692baa8dfb7e2f324c36375dfe6d7a8bdcd8 Mon Sep 17 00:00:00 2001 From: Deon Marais Date: Wed, 29 Jan 2020 17:43:36 +0200 Subject: [PATCH 1/8] Removed incorrect assert Removed incorrect assert in lv_label_set_static_text --- src/lv_objx/lv_label.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lv_objx/lv_label.c b/src/lv_objx/lv_label.c index aa677b094..c4e408707 100644 --- a/src/lv_objx/lv_label.c +++ b/src/lv_objx/lv_label.c @@ -308,7 +308,6 @@ void lv_label_set_array_text(lv_obj_t * label, const char * array, uint16_t size void lv_label_set_static_text(lv_obj_t * label, const char * text) { LV_ASSERT_OBJ(label, LV_OBJX_NAME); - LV_ASSERT_STR(text); lv_label_ext_t * ext = lv_obj_get_ext_attr(label); if(ext->static_txt == 0 && ext->text != NULL) { From 1765dde018cf6d084d3a48371eca54e1bdfb668f Mon Sep 17 00:00:00 2001 From: Deon Marais Date: Wed, 29 Jan 2020 17:47:20 +0200 Subject: [PATCH 2/8] Fix compiler warning in lv_color_to16 --- src/lv_misc/lv_color.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lv_misc/lv_color.h b/src/lv_misc/lv_color.h index 94f6c8c1a..05f6e320a 100644 --- a/src/lv_misc/lv_color.h +++ b/src/lv_misc/lv_color.h @@ -373,9 +373,10 @@ static inline uint16_t lv_color_to16(lv_color_t color) #endif LV_COLOR_SET_B16(ret, LV_COLOR_GET_B(color) >> 3); /* 8 - 5 = 3*/ return ret.full; -#endif - +#else return 0; +#endif + } static inline uint32_t lv_color_to32(lv_color_t color) From 708d68eac129746ddedd72eeaa94d4a17750be47 Mon Sep 17 00:00:00 2001 From: Deon Marais Date: Thu, 30 Jan 2020 14:58:14 +0200 Subject: [PATCH 3/8] Update lv_label.c --- src/lv_objx/lv_label.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/lv_objx/lv_label.c b/src/lv_objx/lv_label.c index c4e408707..5c870d05f 100644 --- a/src/lv_objx/lv_label.c +++ b/src/lv_objx/lv_label.c @@ -1302,10 +1302,18 @@ static void lv_label_refr_text(lv_obj_t * label) p.y -= style->text.line_space; /*Trim the last line space*/ uint32_t letter_id = lv_label_get_letter_on(label, &p); - /*Save letters under the dots and replace them with dots*/ - uint32_t i; + + /*Be sure there is space for the dots*/ + size_t txt_len = strlen(ext->text); uint32_t byte_id = lv_txt_encoded_get_byte_id(ext->text, letter_id); + while(byte_id + LV_LABEL_DOT_NUM > txt_len) { + byte_id -= lv_txt_encoded_size(&ext->text[byte_id]); + letter_id--; + } + + /*Save letters under the dots and replace them with dots*/ uint32_t byte_id_ori = byte_id; + uint32_t i; uint8_t len = 0; for(i = 0; i <= LV_LABEL_DOT_NUM; i++) { len += lv_txt_encoded_size(&ext->text[byte_id]); From 6fbc9f3400bcf3cf39582caa7f5768c84adfaf0d Mon Sep 17 00:00:00 2001 From: Deon Marais Date: Thu, 30 Jan 2020 15:00:42 +0200 Subject: [PATCH 4/8] Update lv_color.h --- src/lv_misc/lv_color.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/lv_misc/lv_color.h b/src/lv_misc/lv_color.h index 05f6e320a..1febbdcea 100644 --- a/src/lv_misc/lv_color.h +++ b/src/lv_misc/lv_color.h @@ -344,7 +344,6 @@ static inline uint8_t lv_color_to8(lv_color_t color) static inline uint16_t lv_color_to16(lv_color_t color) { - #if LV_COLOR_DEPTH == 1 if(color.full == 0) return 0; @@ -373,10 +372,7 @@ static inline uint16_t lv_color_to16(lv_color_t color) #endif LV_COLOR_SET_B16(ret, LV_COLOR_GET_B(color) >> 3); /* 8 - 5 = 3*/ return ret.full; -#else - return 0; -#endif - +#endif } static inline uint32_t lv_color_to32(lv_color_t color) From e60439a9e798f53b917871fbb5034c21c2ca8642 Mon Sep 17 00:00:00 2001 From: Deon Marais Date: Thu, 30 Jan 2020 15:02:46 +0200 Subject: [PATCH 5/8] Update lv_symbol_def.h --- src/lv_font/lv_symbol_def.h | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/lv_font/lv_symbol_def.h b/src/lv_font/lv_symbol_def.h index 6fe823b72..a111ec39c 100644 --- a/src/lv_font/lv_symbol_def.h +++ b/src/lv_font/lv_symbol_def.h @@ -12,12 +12,12 @@ extern "C" { #endif /* In the font converter use this list as range: - 61441, 61448, 61451, 61452, 61452, 61453, 61457, 61459, 61461, 61465, - 61468, 61473, 61478, 61479, 61480, 61502, 61512, 61515, 61516, 61517, - 61521, 61522, 61523, 61524, 61543, 61544, 61550, 61552, 61553, 61556, - 61559, 61560, 61561, 61563, 61587, 61589, 61636, 61637, 61639, 61671, - 61674, 61683, 61724, 61732, 61787, 61931, 62016, 62017, 62018, 62019, - 62020, 62087, 62099, 62212, 62189, 62810, 63426, 63650 + 61441, 61448, 61451, 61452, 61453, 61457, 61459, 61461, 61465, 61468, + 61473, 61478, 61479, 61480, 61502, 61512, 61515, 61516, 61517, 61521, + 61522, 61523, 61524, 61543, 61544, 61550, 61552, 61553, 61556, 61559, + 61560, 61561, 61563, 61587, 61589, 61636, 61637, 61639, 61671, 61674, + 61683, 61724, 61732, 61787, 61931, 62016, 62017, 62018, 62019, 62020, + 62087, 62099, 62212, 62189, 62810, 63426, 63650 */ #define LV_SYMBOL_AUDIO "\xef\x80\x81" /*61441, 0xF001*/ @@ -93,7 +93,6 @@ enum { _LV_STR_SYMBOL_CLOSE, _LV_STR_SYMBOL_POWER, _LV_STR_SYMBOL_SETTINGS, - _LV_STR_SYMBOL_TRASH, _LV_STR_SYMBOL_HOME, _LV_STR_SYMBOL_DOWNLOAD, _LV_STR_SYMBOL_DRIVE, @@ -113,6 +112,8 @@ enum { _LV_STR_SYMBOL_RIGHT, _LV_STR_SYMBOL_PLUS, _LV_STR_SYMBOL_MINUS, + _LV_STR_SYMBOL_EYE_OPEN, + _LV_STR_SYMBOL_EYE_CLOSE, _LV_STR_SYMBOL_WARNING, _LV_STR_SYMBOL_SHUFFLE, _LV_STR_SYMBOL_UP, @@ -125,6 +126,7 @@ enum { _LV_STR_SYMBOL_COPY, _LV_STR_SYMBOL_SAVE, _LV_STR_SYMBOL_CHARGE, + _LV_STR_SYMBOL_PASTE, _LV_STR_SYMBOL_BELL, _LV_STR_SYMBOL_KEYBOARD, _LV_STR_SYMBOL_GPS, @@ -135,7 +137,12 @@ enum { _LV_STR_SYMBOL_BATTERY_2, _LV_STR_SYMBOL_BATTERY_1, _LV_STR_SYMBOL_BATTERY_EMPTY, + _LV_STR_SYMBOL_USB, _LV_STR_SYMBOL_BLUETOOTH, + _LV_STR_SYMBOL_TRASH, + _LV_STR_SYMBOL_BACKSPACE, + _LV_STR_SYMBOL_SD_CARD, + _LV_STR_SYMBOL_NEW_LINE, _LV_STR_SYMBOL_DUMMY, }; From 0065992fcd7eaa874efa281801eb136a1ca67cc9 Mon Sep 17 00:00:00 2001 From: Deon Marais Date: Thu, 30 Jan 2020 15:06:43 +0200 Subject: [PATCH 6/8] Update lv_symbol_def.h --- src/lv_font/lv_symbol_def.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lv_font/lv_symbol_def.h b/src/lv_font/lv_symbol_def.h index a111ec39c..026f4a600 100644 --- a/src/lv_font/lv_symbol_def.h +++ b/src/lv_font/lv_symbol_def.h @@ -140,9 +140,9 @@ enum { _LV_STR_SYMBOL_USB, _LV_STR_SYMBOL_BLUETOOTH, _LV_STR_SYMBOL_TRASH, - _LV_STR_SYMBOL_BACKSPACE, - _LV_STR_SYMBOL_SD_CARD, - _LV_STR_SYMBOL_NEW_LINE, + _LV_STR_SYMBOL_BACKSPACE, + _LV_STR_SYMBOL_SD_CARD, + _LV_STR_SYMBOL_NEW_LINE, _LV_STR_SYMBOL_DUMMY, }; From 603786f969b0d96bcbff25a8395509a88e0e5adc Mon Sep 17 00:00:00 2001 From: Deon Marais Date: Thu, 30 Jan 2020 15:15:36 +0200 Subject: [PATCH 7/8] Update lv_label.c --- src/lv_objx/lv_label.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lv_objx/lv_label.c b/src/lv_objx/lv_label.c index 5c870d05f..6fc211bd4 100644 --- a/src/lv_objx/lv_label.c +++ b/src/lv_objx/lv_label.c @@ -308,6 +308,7 @@ void lv_label_set_array_text(lv_obj_t * label, const char * array, uint16_t size void lv_label_set_static_text(lv_obj_t * label, const char * text) { LV_ASSERT_OBJ(label, LV_OBJX_NAME); + LV_ASSERT_STR(text); lv_label_ext_t * ext = lv_obj_get_ext_attr(label); if(ext->static_txt == 0 && ext->text != NULL) { From 4bf228ca2c120a7f541b478923afbfeab15d19d4 Mon Sep 17 00:00:00 2001 From: Deon Marais Date: Thu, 30 Jan 2020 15:17:02 +0200 Subject: [PATCH 8/8] Remove incorrect assert --- src/lv_objx/lv_label.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lv_objx/lv_label.c b/src/lv_objx/lv_label.c index 6fc211bd4..5c870d05f 100644 --- a/src/lv_objx/lv_label.c +++ b/src/lv_objx/lv_label.c @@ -308,7 +308,6 @@ void lv_label_set_array_text(lv_obj_t * label, const char * array, uint16_t size void lv_label_set_static_text(lv_obj_t * label, const char * text) { LV_ASSERT_OBJ(label, LV_OBJX_NAME); - LV_ASSERT_STR(text); lv_label_ext_t * ext = lv_obj_get_ext_attr(label); if(ext->static_txt == 0 && ext->text != NULL) {