1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-14 06:42:58 +08:00

fix(extra): add lv_extra.c/h for lv_extra_init()

This commit is contained in:
Gabor Kiss-Vamosi 2021-03-26 11:45:28 +01:00
parent 415c114be6
commit 0e0393539e
3 changed files with 91 additions and 3 deletions

View File

@ -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 <stdint.h>
#include <string.h>
@ -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;

47
src/extra/lv_extra.c Normal file
View File

@ -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
**********************/

42
src/extra/lv_extra.h Normal file
View File

@ -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*/