From 3b4f648468bcc42c1fa829f37e8aba25649db605 Mon Sep 17 00:00:00 2001 From: Themba Dube Date: Tue, 10 Dec 2019 19:47:29 -0500 Subject: [PATCH 01/11] Make lv_task_handler() return time remaining till next task needs to be run --- src/lv_misc/lv_task.c | 37 ++++++++++++++++++++++++++++++------- src/lv_misc/lv_task.h | 5 ++++- 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/src/lv_misc/lv_task.c b/src/lv_misc/lv_task.c index 8a7bffca8..298a2ebcb 100644 --- a/src/lv_misc/lv_task.c +++ b/src/lv_misc/lv_task.c @@ -32,6 +32,7 @@ * STATIC PROTOTYPES **********************/ static bool lv_task_exec(lv_task_t * task); +static uint32_t lv_task_time_remaining(lv_task_t * task); /********************** * STATIC VARIABLES @@ -62,8 +63,9 @@ void lv_task_core_init(void) /** * Call it periodically to handle lv_tasks. + * @return the time after which it must be called again */ -LV_ATTRIBUTE_TASK_HANDLER void lv_task_handler(void) +LV_ATTRIBUTE_TASK_HANDLER uint32_t lv_task_handler(void) { @@ -71,16 +73,17 @@ LV_ATTRIBUTE_TASK_HANDLER void lv_task_handler(void) /*Avoid concurrent running of the task handler*/ static bool already_running = false; - if(already_running) return; + if(already_running) return 1; already_running = true; static uint32_t idle_period_start = 0; static uint32_t handler_start = 0; static uint32_t busy_time = 0; + static uint32_t time_till_next; if(lv_task_run == false) { already_running = false; /*Release mutex*/ - return; + return 1; } handler_start = lv_tick_get(); @@ -162,10 +165,18 @@ LV_ATTRIBUTE_TASK_HANDLER void lv_task_handler(void) busy_time = 0; idle_period_start = lv_tick_get(); } - + time_till_next = LV_NO_TASK_READY; + next = lv_ll_get_head(&LV_GC_ROOT(_lv_task_ll)); + while(next) { + uint32_t delay = lv_task_time_remaining(next); + if(delay < time_till_next) + time_till_next = delay; + next = lv_ll_get_next(&LV_GC_ROOT(_lv_task_ll), next); /*Find the next task*/ + } already_running = false; /*Release the mutex*/ LV_LOG_TRACE("lv_task_handler ready"); + return time_till_next; } /** * Create an "empty" task. It needs to initialzed with at least @@ -363,9 +374,7 @@ static bool lv_task_exec(lv_task_t * task) { bool exec = false; - /*Execute if at least 'period' time elapsed*/ - uint32_t elp = lv_tick_elaps(task->last_run); - if(elp >= task->period) { + if(lv_task_time_remaining(task) == 0) { task->last_run = lv_tick_get(); task_deleted = false; task_created = false; @@ -382,3 +391,17 @@ static bool lv_task_exec(lv_task_t * task) return exec; } + +/** + * Find out how much time remains before a task must be run. + * @param task pointer to lv_task + * @return the time remaining, or 0 if it needs to be run again + */ +static uint32_t lv_task_time_remaining(lv_task_t * task) +{ + /*Check if at least 'period' time elapsed*/ + uint32_t elp = lv_tick_elaps(task->last_run); + if(elp >= task->period) + return 0; + return task->period - elp; +} diff --git a/src/lv_misc/lv_task.h b/src/lv_misc/lv_task.h index 05ff02b60..dc7a11151 100644 --- a/src/lv_misc/lv_task.h +++ b/src/lv_misc/lv_task.h @@ -31,6 +31,8 @@ extern "C" { #ifndef LV_ATTRIBUTE_TASK_HANDLER #define LV_ATTRIBUTE_TASK_HANDLER #endif + +#define LV_NO_TASK_READY 0xFFFFFFFF /********************** * TYPEDEFS **********************/ @@ -84,8 +86,9 @@ void lv_task_core_init(void); /** * Call it periodically to handle lv_tasks. + * @return time till it needs to be run next (in ms) */ -LV_ATTRIBUTE_TASK_HANDLER void lv_task_handler(void); +LV_ATTRIBUTE_TASK_HANDLER uint32_t lv_task_handler(void); //! @endcond From d20c4bb26a9184f4d8459c0d725bc02448ad76ac Mon Sep 17 00:00:00 2001 From: Themba Dube Date: Tue, 10 Dec 2019 20:09:22 -0500 Subject: [PATCH 02/11] Consider LV_TASK_PRIO_OFF when finding the delay till next run required --- src/lv_misc/lv_task.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lv_misc/lv_task.c b/src/lv_misc/lv_task.c index 298a2ebcb..79e2f6908 100644 --- a/src/lv_misc/lv_task.c +++ b/src/lv_misc/lv_task.c @@ -168,9 +168,12 @@ LV_ATTRIBUTE_TASK_HANDLER uint32_t lv_task_handler(void) time_till_next = LV_NO_TASK_READY; next = lv_ll_get_head(&LV_GC_ROOT(_lv_task_ll)); while(next) { - uint32_t delay = lv_task_time_remaining(next); - if(delay < time_till_next) - time_till_next = delay; + if(next->prio != LV_TASK_PRIO_OFF) { + uint32_t delay = lv_task_time_remaining(next); + if(delay < time_till_next) + time_till_next = delay; + } + next = lv_ll_get_next(&LV_GC_ROOT(_lv_task_ll), next); /*Find the next task*/ } already_running = false; /*Release the mutex*/ From 4cb5ab4a039aceccd450eb901e7dfc4b4cf57fa2 Mon Sep 17 00:00:00 2001 From: Themba Dube Date: Tue, 10 Dec 2019 20:09:40 -0500 Subject: [PATCH 03/11] Suspend the refresh task if a refresh is not necessary --- src/lv_core/lv_refr.c | 8 ++++++++ src/lv_core/lv_refr.h | 2 ++ src/lv_hal/lv_hal_disp.c | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/lv_core/lv_refr.c b/src/lv_core/lv_refr.c index d8d4ce6c0..141ac5a07 100644 --- a/src/lv_core/lv_refr.c +++ b/src/lv_core/lv_refr.c @@ -131,6 +131,8 @@ void lv_inv_area(lv_disp_t * disp, const lv_area_t * area_p) lv_area_copy(&disp->inv_areas[disp->inv_p], &scr_area); } disp->inv_p++; + lv_task_set_prio(disp->refr_task, LV_REFR_TASK_PRIO); + dprintf("refr task enabled\n"); } } @@ -164,6 +166,12 @@ void lv_disp_refr_task(lv_task_t * task) uint32_t start = lv_tick_get(); + /* Ensure the task does not run again automatically. + * This is done before refreshing in case refreshing invalidates something else. + */ + lv_task_set_prio(task, LV_TASK_PRIO_OFF); + dprintf("refr task disabled\n"); + disp_refr = task->user_data; lv_refr_join_area(); diff --git a/src/lv_core/lv_refr.h b/src/lv_core/lv_refr.h index 8c0ed03ed..35f2791c8 100644 --- a/src/lv_core/lv_refr.h +++ b/src/lv_core/lv_refr.h @@ -20,6 +20,8 @@ extern "C" { * DEFINES *********************/ +#define LV_REFR_TASK_PRIO LV_TASK_PRIO_MID + /********************** * TYPEDEFS **********************/ diff --git a/src/lv_hal/lv_hal_disp.c b/src/lv_hal/lv_hal_disp.c index 11a3bbcb2..db5461447 100644 --- a/src/lv_hal/lv_hal_disp.c +++ b/src/lv_hal/lv_hal_disp.c @@ -147,7 +147,7 @@ lv_disp_t * lv_disp_drv_register(lv_disp_drv_t * driver) disp_def = disp_def_tmp; /*Revert the default display*/ /*Create a refresh task*/ - disp->refr_task = lv_task_create(lv_disp_refr_task, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, disp); + disp->refr_task = lv_task_create(lv_disp_refr_task, LV_DISP_DEF_REFR_PERIOD, LV_REFR_TASK_PRIO, disp); LV_ASSERT_MEM(disp->refr_task); if(disp->refr_task == NULL) return NULL; From 5cbff436b45b728f48cee94b64d134b8e218126c Mon Sep 17 00:00:00 2001 From: Themba Dube Date: Tue, 10 Dec 2019 20:10:35 -0500 Subject: [PATCH 04/11] Suspend the animation task if there are no running animations --- src/lv_misc/lv_anim.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/lv_misc/lv_anim.c b/src/lv_misc/lv_anim.c index 073ba7831..0d5a9bc65 100644 --- a/src/lv_misc/lv_anim.c +++ b/src/lv_misc/lv_anim.c @@ -26,6 +26,7 @@ *********************/ #define LV_ANIM_RESOLUTION 1024 #define LV_ANIM_RES_SHIFT 10 +#define LV_ANIM_TASK_PRIO LV_TASK_PRIO_MID /********************** * TYPEDEFS @@ -35,6 +36,7 @@ * STATIC PROTOTYPES **********************/ static void anim_task(lv_task_t * param); +static void anim_mark_list_change(void); static bool anim_ready_handler(lv_anim_t * a); /********************** @@ -42,6 +44,7 @@ static bool anim_ready_handler(lv_anim_t * a); **********************/ static uint32_t last_task_run; static bool anim_list_changed; +static lv_task_t * _lv_anim_task; /********************** * MACROS @@ -58,7 +61,9 @@ void lv_anim_core_init(void) { lv_ll_init(&LV_GC_ROOT(_lv_anim_ll), sizeof(lv_anim_t)); last_task_run = lv_tick_get(); - lv_task_create(anim_task, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, NULL); + _lv_anim_task = lv_task_create(anim_task, LV_DISP_DEF_REFR_PERIOD, LV_ANIM_TASK_PRIO, NULL); + anim_mark_list_change(); /*Turn off the animation task*/ + anim_list_changed = false; /*The list has not actaully changed*/ } /** @@ -102,7 +107,7 @@ void lv_anim_create(lv_anim_t * a) /* Creating an animation changed the linked list. * It's important if it happens in a ready callback. (see `anim_task`)*/ - anim_list_changed = true; + anim_mark_list_change(); LV_LOG_TRACE("animation created") } @@ -127,7 +132,7 @@ bool lv_anim_del(void * var, lv_anim_exec_xcb_t exec_cb) if(a->var == var && (a->exec_cb == exec_cb || exec_cb == NULL)) { lv_ll_remove(&LV_GC_ROOT(_lv_anim_ll), a); lv_mem_free(a); - anim_list_changed = true; /*Read by `anim_task`. It need to know if a delete occurred in + anim_mark_list_change(); /*Read by `anim_task`. It need to know if a delete occurred in the linked list*/ del = true; } @@ -446,7 +451,8 @@ static bool anim_ready_handler(lv_anim_t * a) memcpy(&a_tmp, a, sizeof(lv_anim_t)); lv_ll_remove(&LV_GC_ROOT(_lv_anim_ll), a); lv_mem_free(a); - anim_list_changed = true; + /*Flag that the list has changed */ + anim_mark_list_change(); /* Call the callback function at the end*/ if(a_tmp.ready_cb != NULL) a_tmp.ready_cb(&a_tmp); @@ -471,4 +477,12 @@ static bool anim_ready_handler(lv_anim_t * a) return anim_list_changed; } +static void anim_mark_list_change(void) +{ + anim_list_changed = true; + if(lv_ll_get_head(&LV_GC_ROOT(_lv_anim_ll)) == NULL) + lv_task_set_prio(_lv_anim_task, LV_TASK_PRIO_OFF); + else + lv_task_set_prio(_lv_anim_task, LV_ANIM_TASK_PRIO); +} #endif From 6c64b29d269bfc5f16859bb1636bf378b9f1cafc Mon Sep 17 00:00:00 2001 From: Themba Dube Date: Tue, 10 Dec 2019 20:12:24 -0500 Subject: [PATCH 05/11] Remove leftover debug statements --- src/lv_core/lv_refr.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/lv_core/lv_refr.c b/src/lv_core/lv_refr.c index 141ac5a07..5b555fb7a 100644 --- a/src/lv_core/lv_refr.c +++ b/src/lv_core/lv_refr.c @@ -132,7 +132,6 @@ void lv_inv_area(lv_disp_t * disp, const lv_area_t * area_p) } disp->inv_p++; lv_task_set_prio(disp->refr_task, LV_REFR_TASK_PRIO); - dprintf("refr task enabled\n"); } } @@ -170,7 +169,6 @@ void lv_disp_refr_task(lv_task_t * task) * This is done before refreshing in case refreshing invalidates something else. */ lv_task_set_prio(task, LV_TASK_PRIO_OFF); - dprintf("refr task disabled\n"); disp_refr = task->user_data; From f583b4ffd5cd810d96169981e80ebeb42a084316 Mon Sep 17 00:00:00 2001 From: Themba Dube Date: Sun, 5 Jan 2020 09:27:09 -0500 Subject: [PATCH 06/11] Add task_list_changed flag --- src/lv_misc/lv_task.c | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/src/lv_misc/lv_task.c b/src/lv_misc/lv_task.c index 79e2f6908..eb10e1813 100644 --- a/src/lv_misc/lv_task.c +++ b/src/lv_misc/lv_task.c @@ -40,6 +40,7 @@ static uint32_t lv_task_time_remaining(lv_task_t * task); static bool lv_task_run = false; static uint8_t idle_last = 0; static bool task_deleted; +static bool task_list_changed; static bool task_created; /********************** @@ -57,6 +58,7 @@ void lv_task_core_init(void) { lv_ll_init(&LV_GC_ROOT(_lv_task_ll), sizeof(lv_task_t)); + task_list_changed = false; /*Initially enable the lv_task handling*/ lv_task_enable(true); } @@ -152,6 +154,13 @@ LV_ATTRIBUTE_TASK_HANDLER uint32_t lv_task_handler(void) break; } + if(task_list_changed) { + task_interrupter = NULL; + end_flag = false; + task_list_changed = false; + break; + } + LV_GC_ROOT(_lv_task_act) = next; /*Load the next task*/ } } while(!end_flag); @@ -165,17 +174,19 @@ LV_ATTRIBUTE_TASK_HANDLER uint32_t lv_task_handler(void) busy_time = 0; idle_period_start = lv_tick_get(); } - time_till_next = LV_NO_TASK_READY; - next = lv_ll_get_head(&LV_GC_ROOT(_lv_task_ll)); - while(next) { - if(next->prio != LV_TASK_PRIO_OFF) { - uint32_t delay = lv_task_time_remaining(next); - if(delay < time_till_next) - time_till_next = delay; - } - - next = lv_ll_get_next(&LV_GC_ROOT(_lv_task_ll), next); /*Find the next task*/ - } + + time_till_next = LV_NO_TASK_READY; + next = lv_ll_get_head(&LV_GC_ROOT(_lv_task_ll)); + while(next) { + if(next->prio != LV_TASK_PRIO_OFF) { + uint32_t delay = lv_task_time_remaining(next); + if(delay < time_till_next) + time_till_next = delay; + } + + next = lv_ll_get_next(&LV_GC_ROOT(_lv_task_ll), next); /*Find the next task*/ + } + already_running = false; /*Release the mutex*/ LV_LOG_TRACE("lv_task_handler ready"); @@ -219,6 +230,7 @@ lv_task_t * lv_task_create_basic(void) if(new_task == NULL) return NULL; } } + task_list_changed = true; new_task->period = DEF_PERIOD; new_task->task_cb = NULL; @@ -275,6 +287,7 @@ void lv_task_set_cb(lv_task_t * task, lv_task_cb_t task_cb) void lv_task_del(lv_task_t * task) { lv_ll_remove(&LV_GC_ROOT(_lv_task_ll), task); + task_list_changed = true; lv_mem_free(task); @@ -304,6 +317,7 @@ void lv_task_set_prio(lv_task_t * task, lv_task_prio_t prio) if(i == NULL) { lv_ll_move_before(&LV_GC_ROOT(_lv_task_ll), task, NULL); } + task_list_changed = true; task->prio = prio; } From d3d8205b2fb59c43830eb47c9c2c5af821853b7d Mon Sep 17 00:00:00 2001 From: embeddedt <42941056+embeddedt@users.noreply.github.com> Date: Thu, 9 Jan 2020 09:21:32 -0500 Subject: [PATCH 07/11] Initialize refresh task before creating display objects --- src/lv_hal/lv_hal_disp.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/lv_hal/lv_hal_disp.c b/src/lv_hal/lv_hal_disp.c index db5461447..9c1b30f32 100644 --- a/src/lv_hal/lv_hal_disp.c +++ b/src/lv_hal/lv_hal_disp.c @@ -133,7 +133,11 @@ lv_disp_t * lv_disp_drv_register(lv_disp_drv_t * driver) lv_disp_t * disp_def_tmp = disp_def; disp_def = disp; /*Temporarily change the default screen to create the default screens on the new display*/ - + /*Create a refresh task*/ + disp->refr_task = lv_task_create(lv_disp_refr_task, LV_DISP_DEF_REFR_PERIOD, LV_REFR_TASK_PRIO, disp); + LV_ASSERT_MEM(disp->refr_task); + if(disp->refr_task == NULL) return NULL; + disp->inv_p = 0; disp->act_scr = lv_obj_create(NULL, NULL); /*Create a default screen on the display*/ @@ -146,11 +150,6 @@ lv_disp_t * lv_disp_drv_register(lv_disp_drv_t * driver) disp_def = disp_def_tmp; /*Revert the default display*/ - /*Create a refresh task*/ - disp->refr_task = lv_task_create(lv_disp_refr_task, LV_DISP_DEF_REFR_PERIOD, LV_REFR_TASK_PRIO, disp); - LV_ASSERT_MEM(disp->refr_task); - if(disp->refr_task == NULL) return NULL; - lv_task_ready(disp->refr_task); /*Be sure the screen will be refreshed immediately on start up*/ return disp; From bcd4e224291829bd408ecd3a2eb2e9ca49d1d79b Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Thu, 9 Jan 2020 18:15:54 +0100 Subject: [PATCH 08/11] copy adv_hittest in lv_obj_create --- src/lv_core/lv_obj.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lv_core/lv_obj.c b/src/lv_core/lv_obj.c index d4239de5b..27cc6df4b 100644 --- a/src/lv_core/lv_obj.c +++ b/src/lv_core/lv_obj.c @@ -368,6 +368,7 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, const lv_obj_t * copy) new_obj->event_cb = copy->event_cb; /*Copy attributes*/ + new_obj->adv_hittest = copy->adv_hittest; new_obj->click = copy->click; new_obj->drag = copy->drag; new_obj->drag_dir = copy->drag_dir; From 59fd1ad5f299173a2fbe4ab4670ea5157161b477 Mon Sep 17 00:00:00 2001 From: Themba Dube Date: Thu, 9 Jan 2020 19:11:14 -0500 Subject: [PATCH 09/11] Fix weird behavior with switch knobs --- src/lv_objx/lv_bar.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lv_objx/lv_bar.c b/src/lv_objx/lv_bar.c index 07db53239..078d7ce8f 100644 --- a/src/lv_objx/lv_bar.c +++ b/src/lv_objx/lv_bar.c @@ -518,9 +518,9 @@ static void draw_indic(lv_obj_t * bar, const lv_area_t * clip_area, lv_design_mo lv_coord_t anim_start_value_end_x = (int32_t)((int32_t)anim_length * (ext->start_value_anim.anim_end - ext->min_value)) / range; - anim_start_value_x = (((anim_start_value_end_x - anim_start_value_start_x) * ext->start_value_anim.anim_state) >> LV_BAR_ANIM_STATE_NORM); + anim_start_value_x = (((anim_start_value_end_x - anim_start_value_start_x) * ext->start_value_anim.anim_state) / LV_BAR_ANIM_STATE_END); - if(anim_start_value_x < 0) + if(anim_start_value_end_x < anim_start_value_start_x) anim_start_value_x += anim_start_value_start_x; } else #endif @@ -535,9 +535,9 @@ static void draw_indic(lv_obj_t * bar, const lv_area_t * clip_area, lv_design_mo lv_coord_t anim_cur_value_end_x = (int32_t)((int32_t)anim_length * (ext->cur_value_anim.anim_end - ext->min_value)) / range; - anim_cur_value_x = (((anim_cur_value_end_x - anim_cur_value_start_x) * ext->cur_value_anim.anim_state) >> LV_BAR_ANIM_STATE_NORM); + anim_cur_value_x = (((anim_cur_value_end_x - anim_cur_value_start_x) * ext->cur_value_anim.anim_state) / LV_BAR_ANIM_STATE_END); - if(anim_cur_value_x < 0) + if(anim_cur_value_end_x < anim_cur_value_start_x) anim_cur_value_x += anim_cur_value_start_x; } else #endif From 8f9fb4578c0ca06a9d9f8ed40308146fd58f840e Mon Sep 17 00:00:00 2001 From: Themba Dube Date: Thu, 9 Jan 2020 19:11:40 -0500 Subject: [PATCH 10/11] Properly cast struct initializers in lv_color.h --- src/lv_misc/lv_color.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lv_misc/lv_color.h b/src/lv_misc/lv_color.h index 0dce299f8..a480d9bc5 100644 --- a/src/lv_misc/lv_color.h +++ b/src/lv_misc/lv_color.h @@ -528,14 +528,14 @@ static inline uint8_t lv_color_brightness(lv_color_t color) /* The most simple macro to create a color from R,G and B values */ #if LV_COLOR_DEPTH == 1 -#define LV_COLOR_MAKE(r8, g8, b8) ((lv_color_t){.full = ((b8 >> 7) | (g8 >> 7) | (r8 >> 7))}) +#define LV_COLOR_MAKE(r8, g8, b8) ((lv_color_t){.full = (uint8_t)((b8 >> 7) | (g8 >> 7) | (r8 >> 7))}) #elif LV_COLOR_DEPTH == 8 -#define LV_COLOR_MAKE(r8, g8, b8) ((lv_color_t){{(b8 >> 6) & 0x3U, (g8 >> 5) & 0x7U, (r8 >> 5) & 0x7U}}) +#define LV_COLOR_MAKE(r8, g8, b8) ((lv_color_t){{(uint8_t)((b8 >> 6) & 0x3U), (uint8_t)((g8 >> 5) & 0x7U), (uint8_t)((r8 >> 5) & 0x7U)}}) #elif LV_COLOR_DEPTH == 16 #if LV_COLOR_16_SWAP == 0 -#define LV_COLOR_MAKE(r8, g8, b8) ((lv_color_t){{(b8 >> 3) & 0x1FU, (g8 >> 2) & 0x3FU, (r8 >> 3) & 0x1FU}}) +#define LV_COLOR_MAKE(r8, g8, b8) ((lv_color_t){{(uint16_t)((b8 >> 3) & 0x1FU), (uint16_t)((g8 >> 2) & 0x3FU), (uint16_t)((r8 >> 3) & 0x1FU)}}) #else -#define LV_COLOR_MAKE(r8, g8, b8) ((lv_color_t){{(g8 >> 5) & 0x7U, (r8 >> 3) & 0x1FU, (b8 >> 3) & 0x1FU, (g8 >> 2) & 0x7U}}) +#define LV_COLOR_MAKE(r8, g8, b8) ((lv_color_t){{(uint16_t)((g8 >> 5) & 0x7U), (uint16_t)((r8 >> 3) & 0x1FU), (uint16_t)((b8 >> 3) & 0x1FU), (uint16_t)((g8 >> 2) & 0x7U)}}) #endif #elif LV_COLOR_DEPTH == 32 #define LV_COLOR_MAKE(r8, g8, b8) ((lv_color_t){{b8, g8, r8, 0xff}}) /*Fix 0xff alpha*/ From 00ba66534dd900ed2e57fedfbfbfbe8f7b000439 Mon Sep 17 00:00:00 2001 From: Themba Dube Date: Thu, 9 Jan 2020 20:26:46 -0500 Subject: [PATCH 11/11] Initialize adv_hittest for non-screen objects --- src/lv_core/lv_obj.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lv_core/lv_obj.c b/src/lv_core/lv_obj.c index 27cc6df4b..6fbb450c5 100644 --- a/src/lv_core/lv_obj.c +++ b/src/lv_core/lv_obj.c @@ -319,6 +319,7 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, const lv_obj_t * copy) #endif /*Set attributes*/ + new_obj->adv_hittest = 0; new_obj->click = 1; new_obj->drag = 0; new_obj->drag_dir = LV_DRAG_DIR_BOTH;