From fc5f86d696a18651a7fe296e248449bf4fa9c549 Mon Sep 17 00:00:00 2001 From: Amir Gonnen Date: Mon, 18 Mar 2019 01:04:20 +0200 Subject: [PATCH 1/6] Fixed gc issues LV_GC_INCLUDE must be included where LV_GC_ROOT is used pointer to LV_GV_ROOT must come before LV_GC_ROOT macro --- lv_core/lv_group.c | 4 ++++ lv_core/lv_refr.c | 4 ++++ lv_hal/lv_hal_indev.c | 4 ++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lv_core/lv_group.c b/lv_core/lv_group.c index 49e065c69..db799e18e 100644 --- a/lv_core/lv_group.c +++ b/lv_core/lv_group.c @@ -12,6 +12,10 @@ #include #include "../lv_misc/lv_gc.h" +#if defined(LV_GC_INCLUDE) +# include LV_GC_INCLUDE +#endif /* LV_ENABLE_GC */ + /********************* * DEFINES *********************/ diff --git a/lv_core/lv_refr.c b/lv_core/lv_refr.c index e3145751c..307ae8484 100644 --- a/lv_core/lv_refr.c +++ b/lv_core/lv_refr.c @@ -15,6 +15,10 @@ #include "../lv_misc/lv_mem.h" #include "../lv_misc/lv_gc.h" +#if defined(LV_GC_INCLUDE) +# include LV_GC_INCLUDE +#endif /* LV_ENABLE_GC */ + /********************* * DEFINES *********************/ diff --git a/lv_hal/lv_hal_indev.c b/lv_hal/lv_hal_indev.c index 2b1d0d279..1200a88b0 100644 --- a/lv_hal/lv_hal_indev.c +++ b/lv_hal/lv_hal_indev.c @@ -94,8 +94,8 @@ lv_indev_t * lv_indev_drv_register(lv_indev_drv_t * driver) */ lv_indev_t * lv_indev_next(lv_indev_t * indev) { - if(indev == NULL) return lv_ll_get_head(LV_GC_ROOT(&_lv_indev_ll)); - else return lv_ll_get_next(LV_GC_ROOT(&_lv_indev_ll), indev); + if(indev == NULL) return lv_ll_get_head(&LV_GC_ROOT(_lv_indev_ll)); + else return lv_ll_get_next(&LV_GC_ROOT(_lv_indev_ll), indev); } /** From 85442c25c0d5bce5c490dfb0022da96f66b95fe9 Mon Sep 17 00:00:00 2001 From: Amir Gonnen Date: Mon, 18 Mar 2019 01:27:06 +0200 Subject: [PATCH 2/6] commented out functions without definition Functions that are declared but not defined will cause the micropython build to fail, since it would assume, from file header, that these functions are available and will try to call them (linker error) --- .gitignore | 1 + src/lv_core/lv_refr.h | 4 ++-- src/lv_objx/lv_spinbox.h | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index fcf2481f3..8ea2e138e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ **/*.o **/*.swp **/*.swo +tags diff --git a/src/lv_core/lv_refr.h b/src/lv_core/lv_refr.h index 2bd7d2b63..300a93599 100644 --- a/src/lv_core/lv_refr.h +++ b/src/lv_core/lv_refr.h @@ -63,14 +63,14 @@ void lv_inv_area(lv_disp_t * disp, const lv_area_t * area_p); /** * Get the number of areas in the buffer * @return number of invalid areas - */ uint16_t lv_refr_get_buf_size(void); + */ /** * Pop (delete) the last 'num' invalidated areas from the buffer * @param num number of areas to delete - */ void lv_refr_pop_from_buf(uint16_t num); + */ /** * Get the display which is being refreshed diff --git a/src/lv_objx/lv_spinbox.h b/src/lv_objx/lv_spinbox.h index ab2e6d1ad..cb3b4f3a0 100644 --- a/src/lv_objx/lv_spinbox.h +++ b/src/lv_objx/lv_spinbox.h @@ -126,8 +126,8 @@ void lv_spinbox_set_range(lv_obj_t * spinbox, int32_t range_min, int32_t range_m * Set spinbox callback on calue change * @param spinbox pointer to spinbox * @param cb Callback function called on value change event - */ void lv_spinbox_set_value_changed_cb(lv_obj_t * spinbox, lv_spinbox_value_changed_cb_t cb); + */ /** * Set spinbox left padding in digits count (added between sign and first digit) From 53b720cff785cb6bae7ed15e4f2a5eb1b5097ab9 Mon Sep 17 00:00:00 2001 From: manison Date: Mon, 18 Mar 2019 08:30:49 +0100 Subject: [PATCH 3/6] fix error on compiler without VLA support --- src/lv_draw/lv_draw_img.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lv_draw/lv_draw_img.c b/src/lv_draw/lv_draw_img.c index 504c63063..b2bbb0315 100644 --- a/src/lv_draw/lv_draw_img.c +++ b/src/lv_draw/lv_draw_img.c @@ -630,7 +630,7 @@ static lv_res_t lv_img_built_in_decoder_line_alpha(lv_coord_t x, lv_coord_t y, l # if LV_COMPILER_VLA_SUPPORTED uint8_t fs_buf[w]; # else - uint8_t fs_buf[LV_HOR_RES]; + uint8_t fs_buf[LV_HOR_RES_MAX]; # endif #endif const uint8_t * data_tmp = NULL; @@ -717,7 +717,7 @@ static lv_res_t lv_img_built_in_decoder_line_indexed(lv_coord_t x, lv_coord_t y, # if LV_COMPILER_VLA_SUPPORTED uint8_t fs_buf[w]; # else - uint8_t fs_buf[LV_HOR_RES]; + uint8_t fs_buf[LV_HOR_RES_MAX]; # endif #endif const uint8_t * data_tmp = NULL; From a9f807ac9971ab7c67d4e9c525064ee36de4c71c Mon Sep 17 00:00:00 2001 From: Amir Gonnen Date: Mon, 18 Mar 2019 10:00:09 +0200 Subject: [PATCH 4/6] removed commented out function declarations --- src/lv_core/lv_refr.h | 12 ------------ src/lv_objx/lv_spinbox.h | 7 ------- 2 files changed, 19 deletions(-) diff --git a/src/lv_core/lv_refr.h b/src/lv_core/lv_refr.h index 300a93599..789d47889 100644 --- a/src/lv_core/lv_refr.h +++ b/src/lv_core/lv_refr.h @@ -60,18 +60,6 @@ void lv_refr_now(void); */ void lv_inv_area(lv_disp_t * disp, const lv_area_t * area_p); -/** - * Get the number of areas in the buffer - * @return number of invalid areas -uint16_t lv_refr_get_buf_size(void); - */ - -/** - * Pop (delete) the last 'num' invalidated areas from the buffer - * @param num number of areas to delete -void lv_refr_pop_from_buf(uint16_t num); - */ - /** * Get the display which is being refreshed * @return the display being refreshed diff --git a/src/lv_objx/lv_spinbox.h b/src/lv_objx/lv_spinbox.h index cb3b4f3a0..2203ae2e4 100644 --- a/src/lv_objx/lv_spinbox.h +++ b/src/lv_objx/lv_spinbox.h @@ -122,13 +122,6 @@ void lv_spinbox_set_step(lv_obj_t * spinbox, uint32_t step); */ void lv_spinbox_set_range(lv_obj_t * spinbox, int32_t range_min, int32_t range_max); -/** - * Set spinbox callback on calue change - * @param spinbox pointer to spinbox - * @param cb Callback function called on value change event -void lv_spinbox_set_value_changed_cb(lv_obj_t * spinbox, lv_spinbox_value_changed_cb_t cb); - */ - /** * Set spinbox left padding in digits count (added between sign and first digit) * @param spinbox pointer to spinbox From cc8119d0a7b7040c87f45835c19b1ce451e36510 Mon Sep 17 00:00:00 2001 From: manison Date: Mon, 18 Mar 2019 10:50:54 +0100 Subject: [PATCH 5/6] lv_btnm: fix function name typo --- src/lv_objx/lv_btnm.c | 2 +- src/lv_objx/lv_btnm.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lv_objx/lv_btnm.c b/src/lv_objx/lv_btnm.c index c9a525608..3f88a7a2a 100644 --- a/src/lv_objx/lv_btnm.c +++ b/src/lv_objx/lv_btnm.c @@ -590,7 +590,7 @@ const char * lv_btnm_get_btn_text(const lv_obj_t * btnm, uint16_t btn_id) * @param btn_index the index a button not counting new line characters. (The return value of lv_btnm_get_pressed/released) * @return true: long press repeat is disabled; false: long press repeat enabled */ -bool lv_btnm_get_btn_no_repeate(lv_obj_t * btnm, uint16_t btn_id) +bool lv_btnm_get_btn_no_repeat(lv_obj_t * btnm, uint16_t btn_id) { lv_btnm_ext_t * ext = lv_obj_get_ext_attr(btnm); return button_is_repeat_disabled(ext->ctrl_bits[btn_id]); diff --git a/src/lv_objx/lv_btnm.h b/src/lv_objx/lv_btnm.h index b1e0f043b..5d04cec41 100644 --- a/src/lv_objx/lv_btnm.h +++ b/src/lv_objx/lv_btnm.h @@ -264,7 +264,7 @@ const char * lv_btnm_get_btn_text(const lv_obj_t * btnm, uint16_t btn_id); * @param btn_index the index a button not counting new line characters. (The return value of lv_btnm_get_pressed/released) * @return true: long press repeat is disabled; false: long press repeat enabled */ -bool lv_btnm_get_btn_no_repeate(lv_obj_t * btnm, uint16_t btn_id); +bool lv_btnm_get_btn_no_repeat(lv_obj_t * btnm, uint16_t btn_id); /** * Check whether a button for a button is hidden or not. From 7af68188971ad03628c4977e00c1bce82d4f25a1 Mon Sep 17 00:00:00 2001 From: Themba Dube Date: Mon, 18 Mar 2019 08:58:10 -0400 Subject: [PATCH 6/6] Fix remaining instances of LV_HOR_RES/LV_VER_RES in drawing code. Based on #957. --- src/lv_draw/lv_draw_rect.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lv_draw/lv_draw_rect.c b/src/lv_draw/lv_draw_rect.c index 1f0202797..917415eba 100644 --- a/src/lv_draw/lv_draw_rect.c +++ b/src/lv_draw/lv_draw_rect.c @@ -1088,7 +1088,7 @@ static void lv_draw_shadow_full(const lv_area_t * coords, const lv_area_t * mask #if LV_COMPILER_VLA_SUPPORTED lv_coord_t curve_x[radius + swidth + 1]; /*Stores the 'x' coordinates of a quarter circle.*/ #else -# if LV_HOR_RES > LV_VER_RES +# if LV_HOR_RES_MAX > LV_VER_RES_MAX lv_coord_t curve_x[LV_HOR_RES_MAX]; # else lv_coord_t curve_x[LV_VER_RES_MAX]; @@ -1109,7 +1109,7 @@ static void lv_draw_shadow_full(const lv_area_t * coords, const lv_area_t * mask #if LV_COMPILER_VLA_SUPPORTED uint32_t line_1d_blur[filter_width]; #else -# if LV_HOR_RES > LV_VER_RES +# if LV_HOR_RES_MAX > LV_VER_RES_MAX uint32_t line_1d_blur[LV_HOR_RES_MAX]; # else uint32_t line_1d_blur[LV_VER_RES_MAX]; @@ -1125,7 +1125,7 @@ static void lv_draw_shadow_full(const lv_area_t * coords, const lv_area_t * mask #if LV_COMPILER_VLA_SUPPORTED lv_opa_t line_2d_blur[radius + swidth + 1]; #else -# if LV_HOR_RES > LV_VER_RES +# if LV_HOR_RES_MAX > LV_VER_RES_MAX lv_opa_t line_2d_blur[LV_HOR_RES_MAX]; # else lv_opa_t line_2d_blur[LV_VER_RES_MAX]; @@ -1246,7 +1246,7 @@ static void lv_draw_shadow_bottom(const lv_area_t * coords, const lv_area_t * ma #if LV_COMPILER_VLA_SUPPORTED lv_coord_t curve_x[radius + 1]; /*Stores the 'x' coordinates of a quarter circle.*/ #else -# if LV_HOR_RES > LV_VER_RES +# if LV_HOR_RES_MAX > LV_VER_RES_MAX lv_coord_t curve_x[LV_HOR_RES_MAX]; # else lv_coord_t curve_x[LV_VER_RES_MAX]; @@ -1265,7 +1265,7 @@ static void lv_draw_shadow_bottom(const lv_area_t * coords, const lv_area_t * ma #if LV_COMPILER_VLA_SUPPORTED lv_opa_t line_1d_blur[swidth]; #else -# if LV_HOR_RES > LV_VER_RES +# if LV_HOR_RES_MAX > LV_VER_RES_MAX lv_opa_t line_1d_blur[LV_HOR_RES_MAX]; # else lv_opa_t line_1d_blur[LV_VER_RES_MAX];