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:
parent
105bf24318
commit
4db0071f05
@ -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*/
|
||||
|
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user