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

feat(obj) add lv_is_initialized (#2402)

While it's possible to try initialize LVGL after it is already initialized, it warns 'lv_init: already inited' in such case. Therefore it is useful to be able to check on runtime whether LVGL was initialized or not before calling lv_init().
This commit is contained in:
Amir Gonnen 2021-07-24 17:27:16 +03:00 committed by GitHub
parent 105bf24318
commit 4db0071f05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -84,6 +84,11 @@ const lv_obj_class_t lv_obj_class = {
* GLOBAL FUNCTIONS
**********************/
bool lv_is_initialized(void)
{
return lv_initialized;
}
void lv_init(void)
{
/*Do nothing if already initialized*/

View File

@ -204,6 +204,11 @@ void lv_deinit(void);
#endif
/**
* Returns whether the 'lv' library is currently initialized
*/
bool lv_is_initialized(void);
/**
* Create a base object (a rectangle)
* @param parent pointer to a parent object. If NULL then a screen will be created.