diff --git a/examples/lvgldemo/lvgldemo.c b/examples/lvgldemo/lvgldemo.c index cd5d9710b..57716e5a3 100644 --- a/examples/lvgldemo/lvgldemo.c +++ b/examples/lvgldemo/lvgldemo.c @@ -38,19 +38,41 @@ ****************************************************************************/ #include -#include +#include #include #include #include #include #include +#include + #include "fbdev.h" #include "tp.h" #include "demo.h" #include "tp_cal.h" +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* Should we perform board-specific driver initialization? There are two + * ways that board initialization can occur: 1) automatically via + * board_initialize() during bootup if CONFIG_BOARD_INITIALIZE, or 2) via a + * call to boardctl() if the interface is enabled (CONFIG_LIB_BOARDCTL=y). + * If this task is running as an NSH built-in application, then that + * initialization has probably already been performed otherwise we do it + * here. + */ + +#undef NEED_BOARDINIT + +#if defined(CONFIG_LIB_BOARDCTL) && !defined(CONFIG_BOARD_INITIALIZE) && \ + (!defined(CONFIG_NSH_BUILTIN_APPS) || !defined(CONFIG_NSH_ARCHINIT)) +# define NEED_BOARDINIT 1 +#endif + /**************************************************************************** * Private Functions ****************************************************************************/ @@ -125,22 +147,31 @@ int main(int argc, FAR char *argv[]) int lvgldemo_main(int argc, char *argv[]) #endif { + lv_disp_drv_t disp_drv; + pthread_t tick_thread; + +#ifdef NEED_BOARDINIT + /* Perform board-specific driver initialization */ + + (void)boardctl(BOARDIOC_INIT, 0); +#endif + + /* LittlevGL initialization */ + lv_init(); - /* DISPLAY INTERFACE INIT */ + /* Display interface initialization */ fbdev_init(); - /* Basic initialization */ + /* Basic LittlevGL display driver initialization */ - lv_disp_drv_t disp_drv; lv_disp_drv_init(&disp_drv); disp_drv.disp_flush = fbdev_flush; lv_disp_drv_register(&disp_drv); - /* TICK INTERFACE INIT */ + /* Tick interface initialization */ - pthread_t tick_thread; pthread_create(&tick_thread, NULL, tick_func, NULL); /* Touchpad Initialization */ diff --git a/graphics/NxWidgets/Kconfig b/graphics/NxWidgets/Kconfig index c841707a4..1b8392907 100644 --- a/graphics/NxWidgets/Kconfig +++ b/graphics/NxWidgets/Kconfig @@ -31,7 +31,6 @@ config NXWIDGETS_FLICKERFREE config NXWIDGET_SERVERINIT bool "Start server" default y - depends on !BUILD_PROTECTED && !BUILD_KERNEL ---help--- If this option is selected, then the NxWidgets::CNxServer class will bring up the NX server when it is initialized. If this option is