diff --git a/arch/sim/src/Makefile b/arch/sim/src/Makefile index f513d473446..6e0576748bf 100644 --- a/arch/sim/src/Makefile +++ b/arch/sim/src/Makefile @@ -41,6 +41,14 @@ CPPFLAGS += -I$(ARCH_SRCDIR)/chip -I$(TOPDIR)/sched $(EXTRADEFINES) CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(TOPDIR)/sched $(EXTRADEFINES) CXXFLAGS += -I$(ARCH_SRCDIR)/chip -I$(TOPDIR)/sched $(EXTRADEFINES) +# Determine which objects are required in the link.The +# up_head object normally draws in all that is needed, but +# there are a fews that must be included because they +# are called only from the host OS-specific logic(HOSTOBJS) + +LINKOBJS = up_head$(OBJEXT) +REQUIREDOBJS = $(LINKOBJS) + ASRCS = ifeq ($(CONFIG_HOST_X86_64),y) @@ -60,8 +68,8 @@ AOBJS = $(ASRCS:.S=$(OBJEXT)) CSRCS = up_initialize.c up_idle.c up_interruptcontext.c up_initialstate.c CSRCS += up_createstack.c up_usestack.c up_releasestack.c up_stackframe.c CSRCS += up_unblocktask.c up_blocktask.c up_releasepending.c -CSRCS += up_reprioritizertr.c up_exit.c up_schedulesigaction.c up_spiflash.c -CSRCS += up_allocateheap.c up_qspiflash.c +CSRCS += up_reprioritizertr.c up_exit.c up_schedulesigaction.c +CSRCS += up_allocateheap.c VPATH = sim DEPPATH = $(patsubst %,--dep-path %,$(subst :, ,$(VPATH))) @@ -82,6 +90,7 @@ endif ifeq ($(CONFIG_SMP),y) CSRCS += up_smpsignal.c up_smphook.c up_cpuidlestack.c + REQUIREDOBJS += up_smpsignal$(OBJEXT) up_smphook$(OBJEXT) HOSTCFLAGS += -DCONFIG_SMP=1 -DCONFIG_SMP_NCPUS=$(CONFIG_SMP_NCPUS) HOSTSRCS += up_simsmp.c STDLIBS += -lpthread @@ -113,13 +122,15 @@ ifeq ($(CONFIG_SCHED_CRITMONITOR),y) endif ifeq ($(CONFIG_NX_LCDDRIVER),y) - CSRCS += board_lcd.c + CSRCS += up_lcd.c else CSRCS += up_framebuffer.c ifeq ($(CONFIG_SIM_X11FB),y) HOSTSRCS += up_x11framebuffer.c + STDLIBS += -lX11 -lXext ifeq ($(CONFIG_SIM_TOUCHSCREEN),y) CSRCS += up_touchscreen.c + REQUIREDOBJS += up_touchscreen$(OBJEXT) HOSTSRCS += up_x11eventloop.c else ifeq ($(CONFIG_SIM_AJOYSTICK),y) @@ -134,6 +145,14 @@ ifeq ($(CONFIG_SIM_IOEXPANDER),y) CSRCS += up_ioexpander.c endif +ifeq ($(CONFIG_SIM_SPIFLASH),y) + CSRCS += up_spiflash.c +endif + +ifeq ($(CONFIG_SIM_QSPIFLASH),y) + CSRCS += up_qspiflash.c +endif + ifeq ($(CONFIG_FS_FAT),y) CSRCS += up_blockdevice.c up_deviceimage.c STDLIBS += -lz @@ -189,12 +208,6 @@ HOSTOBJS = $(HOSTSRCS:.c=$(OBJEXT)) SRCS = $(ASRCS) $(CSRCS) $(HOSTSRCS) OBJS = $(AOBJS) $(COBJS) $(HOSTOBJS) -# Determine which standard libraries will need to be linked in - -ifeq ($(CONFIG_SIM_X11FB),y) - STDLIBS += -lX11 -lXext -endif - # Override in Make.defs if linker is not 'ld' ifeq ($(HOSTOS),Darwin) @@ -210,24 +223,6 @@ endif EXTRA_LIBS ?= EXTRA_LIBPATHS ?= -# Determine which objects are required in the link. The -# up_head object normally draws in all that is needed, but -# there are a fews that must be included because they -# are called only from the host OS-specific logic (HOSTOBJS) - -LINKOBJS = up_head$(OBJEXT) -REQUIREDOBJS = $(LINKOBJS) - -ifeq ($(CONFIG_SIM_X11FB),y) -ifeq ($(CONFIG_SIM_TOUCHSCREEN),y) - REQUIREDOBJS += up_touchscreen$(OBJEXT) -endif -endif - -ifeq ($(CONFIG_SMP),y) - REQUIREDOBJS += up_smpsignal$(OBJEXT) up_smphook$(OBJEXT) -endif - # Determine which NuttX libraries will need to be linked in # Most are provided by LINKLIBS on the MAKE command line diff --git a/arch/sim/src/sim/board_lcd.c b/arch/sim/src/sim/up_lcd.c similarity index 95% rename from arch/sim/src/sim/board_lcd.c rename to arch/sim/src/sim/up_lcd.c index eed24a2a6b0..87c2a5af0cd 100644 --- a/arch/sim/src/sim/board_lcd.c +++ b/arch/sim/src/sim/up_lcd.c @@ -1,7 +1,7 @@ /**************************************************************************** - * arch/sim/src/sim/board_lcd.c + * arch/sim/src/sim/up_lcd.c * - * Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2015, 2020 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -55,6 +55,7 @@ ****************************************************************************/ /* Configuration ************************************************************/ + /* Check contrast selection */ #if !defined(CONFIG_LCD_MAXCONTRAST) @@ -123,8 +124,8 @@ struct sim_dev_s /* LCD Data Transfer Methods */ -static int sim_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buffer, - size_t npixels); +static int sim_putrun(fb_coord_t row, fb_coord_t col, + FAR const uint8_t *buffer, size_t npixels); static int sim_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer, size_t npixels); @@ -204,6 +205,7 @@ static struct sim_dev_s g_lcddev = .getplaneinfo = sim_getplaneinfo, /* LCD RGB Mapping -- Not supported */ + /* Cursor Controls -- Not supported */ /* LCD Specific Controls */ @@ -233,8 +235,8 @@ static struct sim_dev_s g_lcddev = * ****************************************************************************/ -static int sim_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buffer, - size_t npixels) +static int sim_putrun(fb_coord_t row, fb_coord_t col, + FAR const uint8_t *buffer, size_t npixels) { lcdinfo("row: %d col: %d npixels: %d\n", row, col, npixels); return OK; @@ -255,7 +257,7 @@ static int sim_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buffer, ****************************************************************************/ static int sim_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer, - size_t npixels) + size_t npixels) { lcdinfo("row: %d col: %d npixels: %d\n", row, col, npixels); return -ENOSYS; @@ -270,11 +272,13 @@ static int sim_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer, ****************************************************************************/ static int sim_getvideoinfo(FAR struct lcd_dev_s *dev, - FAR struct fb_videoinfo_s *vinfo) + FAR struct fb_videoinfo_s *vinfo) { DEBUGASSERT(dev && vinfo); ginfo("fmt: %d xres: %d yres: %d nplanes: %d\n", - g_videoinfo.fmt, g_videoinfo.xres, g_videoinfo.yres, g_videoinfo.nplanes); + g_videoinfo.fmt, g_videoinfo.xres, g_videoinfo.yres, + g_videoinfo.nplanes); + memcpy(vinfo, &g_videoinfo, sizeof(struct fb_videoinfo_s)); return OK; } @@ -301,7 +305,8 @@ static int sim_getplaneinfo(FAR struct lcd_dev_s *dev, unsigned int planeno, * * Description: * Get the LCD panel power status (0: full off - CONFIG_LCD_MAXPOWER: - * full on). On backlit LCDs, this setting may correspond to the backlight setting. + * full on). On backlit LCDs, this setting may correspond to the backlight + * setting. * ****************************************************************************/