1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-28 07:03:00 +08:00

Move setting of _lv_initialized and correct formatting

Set _lv_initialized at the end of lv_init.

Correct formatting of "if" statement to be consistent with the rest of the library.
This commit is contained in:
embeddedt 2019-02-07 17:57:06 -05:00 committed by GitHub
parent e72589c6d4
commit 1c67d07dc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -64,9 +64,10 @@ static bool _lv_initialized = false;
*/
void lv_init(void)
{
if (_lv_initialized) return;
_lv_initialized = true;
/* Do nothing if already initialized */
if (_lv_initialized)
return;
LV_GC_ROOT(_lv_def_scr) = NULL;
LV_GC_ROOT(_lv_act_scr) = NULL;
LV_GC_ROOT(_lv_top_layer) = NULL;
@ -116,7 +117,7 @@ void lv_init(void)
lv_indev_init();
#endif
_lv_initialized = true;
LV_LOG_INFO("lv_init ready");
}