diff options
Diffstat (limited to 'src/libs/lvgl/patches')
3 files changed, 173 insertions, 0 deletions
diff --git a/src/libs/lvgl b/src/libs/lvgl deleted file mode 160000 -Subproject b89c30eafe1397a778ae5d65f108a0ef820de12 diff --git a/src/libs/lvgl/patches/0001-lv_refr-add-support-for-selecting-render-direction.patch b/src/libs/lvgl/patches/0001-lv_refr-add-support-for-selecting-render-direction.patch new file mode 100644 index 0000000..2996c06 --- /dev/null +++ b/src/libs/lvgl/patches/0001-lv_refr-add-support-for-selecting-render-direction.patch @@ -0,0 +1,122 @@ +From 1f57703589c6d202d9f6259f1d0fefe7bfd39061 Mon Sep 17 00:00:00 2001 +From: Koen Zandberg <koen@bergzand.net> +Date: Thu, 27 Feb 2020 16:33:06 +0100 +Subject: [PATCH] lv_refr: add support for selecting render direction + +--- + src/lv_core/lv_refr.c | 71 ++++++++++++++++++++++++++++------------ + src/lv_hal/lv_hal_disp.h | 6 ++++ + 2 files changed, 56 insertions(+), 21 deletions(-) + +diff --git a/src/lv_core/lv_refr.c b/src/lv_core/lv_refr.c +index 5ee3fbb2..e71e1629 100644 +--- a/src/lv_core/lv_refr.c ++++ b/src/lv_core/lv_refr.c +@@ -339,30 +339,59 @@ static void lv_refr_area(const lv_area_t * area_p) + } + } + +- /*Always use the full row*/ +- lv_coord_t row; +- lv_coord_t row_last = 0; +- for(row = area_p->y1; row + max_row - 1 <= y2; row += max_row) { +- /*Calc. the next y coordinates of VDB*/ +- vdb->area.x1 = area_p->x1; +- vdb->area.x2 = area_p->x2; +- vdb->area.y1 = row; +- vdb->area.y2 = row + max_row - 1; +- if(vdb->area.y2 > y2) vdb->area.y2 = y2; +- row_last = vdb->area.y2; +- lv_refr_area_part(area_p); ++ if (disp_refr->render_direction) { ++ /*Always use the full row*/ ++ lv_coord_t row; ++ lv_coord_t row_last = y2; ++ for(row = area_p->y2; row > max_row - 1 + area_p->y1; row -= max_row) { ++ /*Calc. the next y coordinates of VDB*/ ++ vdb->area.x1 = area_p->x1; ++ vdb->area.x2 = area_p->x2; ++ vdb->area.y1 = row - max_row + 1; ++ vdb->area.y2 = row; ++ if(vdb->area.y2 > y2) vdb->area.y2 = y2; ++ row_last = vdb->area.y1; ++ lv_refr_area_part(area_p); ++ } ++ ++ /*If the last (first) y coordinates are not handled yet ...*/ ++ if(area_p->y1 != row_last) { ++ /*Calc. the next y coordinates of VDB*/ ++ vdb->area.x1 = area_p->x1; ++ vdb->area.x2 = area_p->x2; ++ vdb->area.y1 = area_p->y1; ++ vdb->area.y2 = row; ++ ++ /*Refresh this part too*/ ++ lv_refr_area_part(area_p); ++ } + } ++ else { ++ /*Always use the full row*/ ++ lv_coord_t row; ++ lv_coord_t row_last = 0; ++ for(row = area_p->y1; row + max_row - 1 <= y2; row += max_row) { ++ /*Calc. the next y coordinates of VDB*/ ++ vdb->area.x1 = area_p->x1; ++ vdb->area.x2 = area_p->x2; ++ vdb->area.y1 = row; ++ vdb->area.y2 = row + max_row - 1; ++ if(vdb->area.y2 > y2) vdb->area.y2 = y2; ++ row_last = vdb->area.y2; ++ lv_refr_area_part(area_p); ++ } + +- /*If the last y coordinates are not handled yet ...*/ +- if(y2 != row_last) { +- /*Calc. the next y coordinates of VDB*/ +- vdb->area.x1 = area_p->x1; +- vdb->area.x2 = area_p->x2; +- vdb->area.y1 = row; +- vdb->area.y2 = y2; ++ /*If the last y coordinates are not handled yet ...*/ ++ if(y2 != row_last) { ++ /*Calc. the next y coordinates of VDB*/ ++ vdb->area.x1 = area_p->x1; ++ vdb->area.x2 = area_p->x2; ++ vdb->area.y1 = row; ++ vdb->area.y2 = y2; + +- /*Refresh this part too*/ +- lv_refr_area_part(area_p); ++ /*Refresh this part too*/ ++ lv_refr_area_part(area_p); ++ } + } + } + } +diff --git a/src/lv_hal/lv_hal_disp.h b/src/lv_hal/lv_hal_disp.h +index 8db692a0..eef22d98 100644 +--- a/src/lv_hal/lv_hal_disp.h ++++ b/src/lv_hal/lv_hal_disp.h +@@ -143,6 +143,7 @@ typedef struct _disp_t + uint8_t inv_area_joined[LV_INV_BUF_SIZE]; + uint32_t inv_p : 10; + ++ int render_direction; /**< 0 when rendering down, 1 when rendering up */ + /*Miscellaneous data*/ + uint32_t last_activity_time; /**< Last time there was activity on this display */ + } lv_disp_t; +@@ -230,6 +231,11 @@ lv_coord_t lv_disp_get_ver_res(lv_disp_t * disp); + */ + bool lv_disp_get_antialiasing(lv_disp_t * disp); + ++static inline void lv_disp_set_direction(lv_disp_t * disp, int direction) ++{ ++ disp->render_direction = direction; ++} ++ + //! @cond Doxygen_Suppress + + /** +-- +2.24.1 + diff --git a/src/libs/lvgl/patches/0002-fix_bug_in_animation_management_for_lv_label.patch b/src/libs/lvgl/patches/0002-fix_bug_in_animation_management_for_lv_label.patch new file mode 100644 index 0000000..7b4c204 --- /dev/null +++ b/src/libs/lvgl/patches/0002-fix_bug_in_animation_management_for_lv_label.patch @@ -0,0 +1,51 @@ +Index: src/libs/lvgl/src/lv_misc/lv_anim.c +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/src/libs/lvgl/src/lv_misc/lv_anim.c b/src/libs/lvgl/src/lv_misc/lv_anim.c +--- a/src/libs/lvgl/src/lv_misc/lv_anim.c (revision 12a3b6cc8ec1fd6b951c353ab3a5fbbb9934fdd4) ++++ b/src/libs/lvgl/src/lv_misc/lv_anim.c (date 1610901672072) +@@ -158,12 +158,12 @@ + * @param end end value of the animation + * @return the required time [ms] for the animation with the given parameters + */ +-uint16_t lv_anim_speed_to_time(uint16_t speed, lv_anim_value_t start, lv_anim_value_t end) ++uint32_t lv_anim_speed_to_time(uint16_t speed, lv_anim_value_t start, lv_anim_value_t end) + { + int32_t d = LV_MATH_ABS((int32_t)start - end); + uint32_t time = (int32_t)((int32_t)(d * 1000) / speed); + +- if(time > UINT16_MAX) time = UINT16_MAX; ++ if(time > UINT32_MAX) time = UINT32_MAX; + + if(time == 0) { + time++; +Index: src/libs/lvgl/src/lv_misc/lv_anim.h +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/src/libs/lvgl/src/lv_misc/lv_anim.h b/src/libs/lvgl/src/lv_misc/lv_anim.h +--- a/src/libs/lvgl/src/lv_misc/lv_anim.h (revision 12a3b6cc8ec1fd6b951c353ab3a5fbbb9934fdd4) ++++ b/src/libs/lvgl/src/lv_misc/lv_anim.h (date 1610901672076) +@@ -73,8 +73,8 @@ + lv_anim_ready_cb_t ready_cb; /**< Call it when the animation is ready*/ + int32_t start; /**< Start value*/ + int32_t end; /**< End value*/ +- uint16_t time; /**< Animation time in ms*/ +- int16_t act_time; /**< Current time in animation. Set to negative to make delay.*/ ++ uint32_t time; /**< Animation time in ms*/ ++ int32_t act_time; /**< Current time in animation. Set to negative to make delay.*/ + uint16_t playback_pause; /**< Wait before play back*/ + uint16_t repeat_pause; /**< Wait before repeat*/ + #if LV_USE_USER_DATA +@@ -266,7 +266,7 @@ + * @param end end value of the animation + * @return the required time [ms] for the animation with the given parameters + */ +-uint16_t lv_anim_speed_to_time(uint16_t speed, lv_anim_value_t start, lv_anim_value_t end); ++uint32_t lv_anim_speed_to_time(uint16_t speed, lv_anim_value_t start, lv_anim_value_t end); + + /** + * Calculate the current value of an animation applying linear characteristic |
