feat(multi-instance): collect all the global variables into a struct to allow running multiple instances of LVGL

Closes #4358
This commit is contained in:
Gabor Kiss-Vamosi
2023-08-19 01:42:37 +02:00
parent 1f807ae714
commit 0b83a82a07
145 changed files with 3230 additions and 2707 deletions

View File

@@ -104,6 +104,21 @@ from ``lv_conf.h`` or build settings (``-D...``) overwrite the values
set in Kconfig. To ignore the configs from ``lv_conf.h`` simply remove
its content, or define :c:macro:`LV_CONF_SKIP`.
To enable multi-instance feature, set :c:macro:`LV_GLOBAL_CUSTOM` in
``lv_conf.h`` and provide a custom function to
:cpp:func:`lv_global_default` using ``__thread`` or ``pthread_key_t``.
For example:
.. code:: c
lv_global_t * lv_global_default(void)
{
static __thread lv_global_t lv_global;
return &lv_global;
}
Initialization
--------------