From 985b5ef3e7964077a70b097f2ba7d85d93ee81ed Mon Sep 17 00:00:00 2001 From: Peter Johanson Date: Wed, 15 Nov 2023 16:06:21 -0800 Subject: [PATCH] fix(shields): LVGL fixes for nice!view screen * Bump the LVGL mem pool size needed for custom screen. * Fixes for LVGL drawing/label usage. --- app/boards/shields/nice_view/Kconfig.defconfig | 3 +++ app/boards/shields/nice_view/widgets/status.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/boards/shields/nice_view/Kconfig.defconfig b/app/boards/shields/nice_view/Kconfig.defconfig index 84fdd7ccd69..c31cec89f0f 100644 --- a/app/boards/shields/nice_view/Kconfig.defconfig +++ b/app/boards/shields/nice_view/Kconfig.defconfig @@ -24,6 +24,9 @@ choice ZMK_DISPLAY_STATUS_SCREEN default ZMK_DISPLAY_STATUS_SCREEN_CUSTOM endchoice +config LV_Z_MEM_POOL_SIZE + default 4096 if ZMK_DISPLAY_STATUS_SCREEN_CUSTOM + config ZMK_DISPLAY_STATUS_SCREEN_CUSTOM imply NICE_VIEW_WIDGET_STATUS diff --git a/app/boards/shields/nice_view/widgets/status.c b/app/boards/shields/nice_view/widgets/status.c index 453fd650039..419b5174a8f 100644 --- a/app/boards/shields/nice_view/widgets/status.c +++ b/app/boards/shields/nice_view/widgets/status.c @@ -149,7 +149,7 @@ static void draw_middle(lv_obj_t *widget, lv_color_t cbuf[], const struct status for (int i = 0; i < 5; i++) { bool selected = i == state->active_profile_index; - lv_canvas_draw_arc(canvas, circle_offsets[i][0], circle_offsets[i][1], 13, 0, 359, + lv_canvas_draw_arc(canvas, circle_offsets[i][0], circle_offsets[i][1], 13, 0, 360, &arc_dsc); if (selected) { @@ -180,7 +180,7 @@ static void draw_bottom(lv_obj_t *widget, lv_color_t cbuf[], const struct status // Draw layer if (state->layer_label == NULL) { - char text[9] = {}; + char text[10] = {}; sprintf(text, "LAYER %i", state->layer_index);