apps/examples/lvgldemo: Can no call boardctl() to initialize graphics hardware if needed.
This commit is contained in:
parent
29072596c3
commit
157e59b004
@ -38,19 +38,41 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
#include <graphics/lvgl.h>
|
|
||||||
|
|
||||||
|
#include <sys/boardctl.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
|
#include <graphics/lvgl.h>
|
||||||
|
|
||||||
#include "fbdev.h"
|
#include "fbdev.h"
|
||||||
#include "tp.h"
|
#include "tp.h"
|
||||||
#include "demo.h"
|
#include "demo.h"
|
||||||
#include "tp_cal.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
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@ -125,22 +147,31 @@ int main(int argc, FAR char *argv[])
|
|||||||
int lvgldemo_main(int argc, char *argv[])
|
int lvgldemo_main(int argc, char *argv[])
|
||||||
#endif
|
#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();
|
lv_init();
|
||||||
|
|
||||||
/* DISPLAY INTERFACE INIT */
|
/* Display interface initialization */
|
||||||
|
|
||||||
fbdev_init();
|
fbdev_init();
|
||||||
|
|
||||||
/* Basic initialization */
|
/* Basic LittlevGL display driver initialization */
|
||||||
|
|
||||||
lv_disp_drv_t disp_drv;
|
|
||||||
lv_disp_drv_init(&disp_drv);
|
lv_disp_drv_init(&disp_drv);
|
||||||
disp_drv.disp_flush = fbdev_flush;
|
disp_drv.disp_flush = fbdev_flush;
|
||||||
lv_disp_drv_register(&disp_drv);
|
lv_disp_drv_register(&disp_drv);
|
||||||
|
|
||||||
/* TICK INTERFACE INIT */
|
/* Tick interface initialization */
|
||||||
|
|
||||||
pthread_t tick_thread;
|
|
||||||
pthread_create(&tick_thread, NULL, tick_func, NULL);
|
pthread_create(&tick_thread, NULL, tick_func, NULL);
|
||||||
|
|
||||||
/* Touchpad Initialization */
|
/* Touchpad Initialization */
|
||||||
|
@ -31,7 +31,6 @@ config NXWIDGETS_FLICKERFREE
|
|||||||
config NXWIDGET_SERVERINIT
|
config NXWIDGET_SERVERINIT
|
||||||
bool "Start server"
|
bool "Start server"
|
||||||
default y
|
default y
|
||||||
depends on !BUILD_PROTECTED && !BUILD_KERNEL
|
|
||||||
---help---
|
---help---
|
||||||
If this option is selected, then the NxWidgets::CNxServer class will
|
If this option is selected, then the NxWidgets::CNxServer class will
|
||||||
bring up the NX server when it is initialized. If this option is
|
bring up the NX server when it is initialized. If this option is
|
||||||
|
Loading…
x
Reference in New Issue
Block a user