From c2b5979e91f6015f51ec0cdf1b5061482f0dfc42 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Thu, 13 Aug 2020 12:00:57 +0200 Subject: [PATCH] arc: fix event sending --- src/lv_widgets/lv_arc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lv_widgets/lv_arc.c b/src/lv_widgets/lv_arc.c index d9d1b2383..fad51e7a5 100644 --- a/src/lv_widgets/lv_arc.c +++ b/src/lv_widgets/lv_arc.c @@ -765,11 +765,12 @@ static lv_res_t lv_arc_signal(lv_obj_t * arc, lv_signal_t sign, void * param) angle += round; /*Set the new value*/ + int16_t old_value = ext->cur_value; int16_t new_value = _lv_map(angle, ext->bg_angle_start, bg_end, ext->min_value, ext->max_value); if(new_value != lv_arc_get_value(arc)) { ext->last_tick = lv_tick_get(); /*Cache timestamp for the next iteration*/ lv_arc_set_value(arc, new_value); /*set_value caches the last_angle for the next iteration*/ - if(new_value != ext->cur_value) { + if(new_value != old_value) { res = lv_event_send(arc, LV_EVENT_VALUE_CHANGED, NULL); if(res != LV_RES_OK) return res; }