From a78df87f8e9d07fcdcd3a52b73f5b6f705fba3d8 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Sun, 8 Jul 2018 01:12:20 +0200 Subject: [PATCH] update the new objects with LV_CONF_INCLUDE_SIMPLE --- lv_objx/lv_arc.c | 6 ------ lv_objx/lv_arc.h | 5 +++++ lv_objx/lv_calendar.c | 3 +-- lv_objx/lv_calendar.h | 5 +++++ lv_objx/lv_preload.c | 9 +++++---- lv_objx/lv_preload.h | 14 ++++++++++++++ 6 files changed, 30 insertions(+), 12 deletions(-) diff --git a/lv_objx/lv_arc.c b/lv_objx/lv_arc.c index ed4011211..5314e99ac 100644 --- a/lv_objx/lv_arc.c +++ b/lv_objx/lv_arc.c @@ -3,12 +3,6 @@ * */ -/* TODO Remove these instructions - * Search an replace: arc -> object normal name with lower case (e.g. button, label etc.) - * arc -> object short name with lower case(e.g. btn, label etc) - * ARC -> object short name with upper case (e.g. BTN, LABEL etc.) - * - */ /********************* * INCLUDES diff --git a/lv_objx/lv_arc.h b/lv_objx/lv_arc.h index 6a925186a..acf3976de 100644 --- a/lv_objx/lv_arc.h +++ b/lv_objx/lv_arc.h @@ -14,7 +14,12 @@ extern "C" { /********************* * INCLUDES *********************/ +#ifdef LV_CONF_INCLUDE_SIMPLE +#include "lv_conf.h" +#else #include "../../lv_conf.h" +#endif + #if USE_LV_ARC != 0 #include "../lv_core/lv_obj.h" diff --git a/lv_objx/lv_calendar.c b/lv_objx/lv_calendar.c index 945ee4cfe..66cdc7154 100644 --- a/lv_objx/lv_calendar.c +++ b/lv_objx/lv_calendar.c @@ -6,10 +6,9 @@ /********************* * INCLUDES *********************/ -#include "../../lv_conf.h" +#include "lv_calendar.h" #if USE_LV_CALENDAR != 0 -#include "lv_calendar.h" #include "../lv_draw/lv_draw.h" #include "../lv_hal/lv_hal_indev.h" #include "../lv_misc/lv_math.h" diff --git a/lv_objx/lv_calendar.h b/lv_objx/lv_calendar.h index 04561f936..78c26f95d 100644 --- a/lv_objx/lv_calendar.h +++ b/lv_objx/lv_calendar.h @@ -13,7 +13,12 @@ extern "C" { /********************* * INCLUDES *********************/ +#ifdef LV_CONF_INCLUDE_SIMPLE +#include "lv_conf.h" +#else #include "../../lv_conf.h" +#endif + #if USE_LV_CALENDAR != 0 #include "../lv_core/lv_obj.h" diff --git a/lv_objx/lv_preload.c b/lv_objx/lv_preload.c index 8276a7983..78043b0a8 100644 --- a/lv_objx/lv_preload.c +++ b/lv_objx/lv_preload.c @@ -6,10 +6,9 @@ /********************* * INCLUDES *********************/ -#include "../../lv_conf.h" +#include "lv_preload.h" #if USE_LV_PRELOAD != 0 -#include "lv_preload.h" #include "../lv_misc/lv_math.h" #include "../lv_draw/lv_draw_rect.h" #include "../lv_draw/lv_draw_arc.h" @@ -72,7 +71,7 @@ lv_obj_t * lv_preload_create(lv_obj_t * par, lv_obj_t * copy) /*The signal and design functions are not copied so set them here*/ lv_obj_set_signal_func(new_preload, lv_preload_signal); lv_obj_set_design_func(new_preload, lv_preload_design); - +#if USE_LV_ANIMATION lv_anim_t a; a.var = new_preload; a.start = 0; @@ -87,6 +86,7 @@ lv_obj_t * lv_preload_create(lv_obj_t * par, lv_obj_t * copy) a.repeat = 1; a.repeat_pause = 0; lv_anim_create(&a); +#endif /*Init the new pre loader pre loader*/ if(copy == NULL) { @@ -130,7 +130,7 @@ void lv_preload_set_spin_time(lv_obj_t * preload, uint16_t time) lv_preload_ext_t * ext = lv_obj_get_ext_attr(preload); ext->time = time; - +#if USE_LV_ANIMATION lv_anim_t a; a.var = preload; a.start = 0; @@ -145,6 +145,7 @@ void lv_preload_set_spin_time(lv_obj_t * preload, uint16_t time) a.repeat = 1; a.repeat_pause = 0; lv_anim_create(&a); +#endif } /*===================== * Setter functions diff --git a/lv_objx/lv_preload.h b/lv_objx/lv_preload.h index f2a38c9f3..224dcb6f9 100644 --- a/lv_objx/lv_preload.h +++ b/lv_objx/lv_preload.h @@ -13,9 +13,23 @@ extern "C" { /********************* * INCLUDES *********************/ +#ifdef LV_CONF_INCLUDE_SIMPLE +#include "lv_conf.h" +#else #include "../../lv_conf.h" +#endif + #if USE_LV_PRELOAD != 0 +/*Testing of dependencies*/ +#if USE_LV_ARC == 0 +#error "lv_preload: lv_arc is required. Enable it in lv_conf.h (USE_LV_ARC 1) " +#endif + +#if USE_LV_ANIMATION == 0 +#error "lv_preload: animations are required. Enable it in lv_conf.h (USE_LV_ANIMATION 1) " +#endif + #include "../lv_core/lv_obj.h" #include "lv_arc.h"