diff --git a/lv_objx/lv_arc.c b/lv_objx/lv_arc.c index ed40112116..5314e99ac9 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 6a925186ac..acf3976ded 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 945ee4cfea..66cdc7154e 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 04561f9367..78c26f95d4 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 8276a7983f..78043b0a8c 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 f2a38c9f3f..224dcb6f9b 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"