boards/sim/sim/sim/src/sim_bringup.c: Simulator shouldn't assume that graphics stack is enabled if both X11 framebuffer and touchscreen driver turn on.

This commit is contained in:
Xiang Xiao 2019-12-16 08:57:40 -06:00 committed by Gregory Nutt
parent 3c472dcf52
commit af5d0d3157
2 changed files with 16 additions and 26 deletions

View File

@ -58,7 +58,7 @@ ifeq ($(CONFIG_LIB_ZONEINFO_ROMFS),y)
endif
endif
ifeq ($(CONFIG_SIM_X11FB),y)
ifeq ($(CONFIG_NX),y)
ifeq ($(CONFIG_SIM_TOUCHSCREEN),y)
CSRCS += sim_touchscreen.c
endif

View File

@ -59,28 +59,6 @@
#include "up_internal.h"
#include "sim.h"
/****************************************************************************
* Public Functions
****************************************************************************/
#define NEED_FRAMEBUFFER 1
/* If we are using the X11 touchscreen simulation, then the frame buffer
* initialization will need to be done here.
*/
#if defined(CONFIG_SIM_X11FB) && defined(CONFIG_SIM_TOUCHSCREEN)
# undef NEED_FRAMEBUFFER
#endif
/* Currently the only case we need to initialize the framebuffer here is
* when we are testing the framebuffer character driver.
*/
#ifndef CONFIG_VIDEO_FB
# undef NEED_FRAMEBUFFER
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
@ -270,7 +248,7 @@ int sim_bringup(void)
sim_ajoy_initialize();
#endif
#if defined(CONFIG_SIM_X11FB) && defined(CONFIG_SIM_TOUCHSCREEN)
#if defined(CONFIG_NX) && defined(CONFIG_SIM_TOUCHSCREEN)
/* Initialize the touchscreen */
ret = sim_tsc_setup(0);
@ -278,9 +256,9 @@ int sim_bringup(void)
{
syslog(LOG_ERR, "ERROR: sim_tsc_setup failed: %d\n", ret);
}
#endif
#else
#ifdef NEED_FRAMEBUFFER
# ifdef CONFIG_VIDEO_FB
/* Initialize and register the simulated framebuffer driver */
ret = fb_register(0, 0);
@ -288,6 +266,18 @@ int sim_bringup(void)
{
syslog(LOG_ERR, "ERROR: fb_register() failed: %d\n", ret);
}
# endif
# ifdef CONFIG_SIM_TOUCHSCREEN
/* Initialize the touchscreen */
ret = sim_tsc_initialize(0);
if (ret < 0)
{
syslog(LOG_ERR, "ERROR: sim_tsc_initialize failed: %d\n", ret);
}
# endif
#endif
#ifdef CONFIG_IEEE802154_LOOPBACK