diff --git a/src/core/lv_obj.c b/src/core/lv_obj.c index fa625567e..b98f63d7a 100644 --- a/src/core/lv_obj.c +++ b/src/core/lv_obj.c @@ -22,7 +22,7 @@ #include "../misc/lv_math.h" #include "../misc/lv_log.h" #include "../hal/lv_hal.h" -#include "../extra/layouts/lv_layouts.h" +#include "../extra/lv_extra.h" #include #include @@ -156,8 +156,7 @@ void lv_init(void) LV_LOG_WARN("Log level is set the Trace which makes LVGL much slower") #endif - lv_grid_init(); - lv_flex_init(); + lv_extra_init(); lv_initialized = true; diff --git a/src/extra/lv_extra.c b/src/extra/lv_extra.c new file mode 100644 index 000000000..c47c11897 --- /dev/null +++ b/src/extra/lv_extra.c @@ -0,0 +1,47 @@ +/** + * @file lv_extra.c + * + */ + +/********************* + * INCLUDES + *********************/ +#include "../lvgl.h" + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * STATIC PROTOTYPES + **********************/ + +/********************** + * STATIC VARIABLES + **********************/ + +/********************** + * MACROS + **********************/ + +/********************** + * GLOBAL FUNCTIONS + **********************/ +void lv_extra_init(void) +{ +#if LV_USE_FLEX + lv_flex_init(); +#endif + +#if LV_USE_GRID + lv_grid_init(); +#endif +} + +/********************** + * STATIC FUNCTIONS + **********************/ diff --git a/src/extra/lv_extra.h b/src/extra/lv_extra.h new file mode 100644 index 000000000..327cd4ea0 --- /dev/null +++ b/src/extra/lv_extra.h @@ -0,0 +1,42 @@ +/** + * @file lv_extra.h + * + */ + +#ifndef LV_EXTRA_H +#define LV_EXTRA_H + +#ifdef __cplusplus +extern "C" { +#endif + +/********************* + * INCLUDES + *********************/ + +/********************* + * DEFINES + *********************/ + +/********************** + * TYPEDEFS + **********************/ + +/********************** + * GLOBAL PROTOTYPES + **********************/ + +/** + * Initilaize the extra components + */ +void lv_extra_init(void); + +/********************** + * MACROS + **********************/ + +#ifdef __cplusplus +} /*extern "C"*/ +#endif + +#endif /*LV_EXTRA_H*/