summaryrefslogtreecommitdiff
path: root/nuttx/arch/sim/src
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-09-29 16:25:21 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-09-29 16:25:21 +0000
commit46befd16063c1f5ac68344cf5419a33a56d3a1ab (patch)
treede01ea633b4e957d8747055b849ac4b386566c35 /nuttx/arch/sim/src
parent23ddf8e48b573f08c96d1bcde85f2e3f029b806d (diff)
downloadpx4-nuttx-46befd16063c1f5ac68344cf5419a33a56d3a1ab.tar.gz
px4-nuttx-46befd16063c1f5ac68344cf5419a33a56d3a1ab.tar.bz2
px4-nuttx-46befd16063c1f5ac68344cf5419a33a56d3a1ab.zip
Add a simple touchscreen test
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3995 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/sim/src')
-rw-r--r--nuttx/arch/sim/src/Makefile27
-rw-r--r--nuttx/arch/sim/src/up_touchscreen.c2
2 files changed, 24 insertions, 5 deletions
diff --git a/nuttx/arch/sim/src/Makefile b/nuttx/arch/sim/src/Makefile
index b3ed39a2c..d4da17d88 100644
--- a/nuttx/arch/sim/src/Makefile
+++ b/nuttx/arch/sim/src/Makefile
@@ -81,7 +81,7 @@ endif
COBJS = $(CSRCS:.c=$(OBJEXT))
-NXOBJS = $(AOBJS) $(COBJS)
+NUTTXOBJS = $(AOBJS) $(COBJS)
HOSTOBJS = $(HOSTSRCS:.c=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(HOSTSRCS)
@@ -104,11 +104,22 @@ endif
STDLIBS += -lc
+# Determine which NuttX libraries will need to be linked in
+# Most are provided by LINKLIBS on the MAKE command line
+
LINKOBJS = up_head$(OBJEXT)
LINKLIBS =
LDPATHS = $(addprefix -L$(TOPDIR)/,$(dir $(LINKLIBS)))
LDLIBS = $(patsubst lib%,-l%,$(basename $(notdir $(LINKLIBS))))
+# Add the board-specific library and directory
+
+BOARDDIR = $(TOPDIR)/configs/sim/src
+LDPATHS += -L $(BOARDDIR)
+LDLIBS += -lboard
+
+# Make targets begin here
+
all: up_head$(OBJEXT) libarch$(LIBEXT)
.PHONY: export_head clean distclean cleanrel depend
@@ -123,11 +134,19 @@ $(HOSTOBJS): %$(OBJEXT): %.c
@$(CC) -c $(HOSTCFLAGS) $< -o $@
# The architecture-specific library
-libarch$(LIBEXT): $(NXOBJS)
- @( for obj in $(NXOBJS) ; do \
+
+libarch$(LIBEXT): $(NUTTXOBJS)
+ @( for obj in $(NUTTXOBJS) ; do \
$(call ARCHIVE, $@, $${obj}); \
done ; )
+# The "board"-specific library. Of course, there really are no boards in
+# the simulation. However, this is a good place to keep parts of the simulation
+# that are not hardware-related.
+
+$(BOARDDIR)/libboard$(LIBEXT):
+ @$(MAKE) -C $(BOARDDIR) TOPDIR="$(TOPDIR)" libboard$(LIBEXT) EXTRADEFINES=$(EXTRADEFINES)
+
# A partially linked object containing only NuttX code (no interface to host OS)
# Change the names of most symbols that conflict with libc symbols.
@@ -140,7 +159,7 @@ GNU/Linux-names.dat: GNU nuttx-names.dat
Cygwin-names.dat: nuttx-names.dat
@cat $^ | sed -e "s/^/_/g" >$@
-nuttx.rel : libarch$(LIBEXT) $(HOSTOS)-names.dat $(LINKOBJS)
+nuttx.rel : libarch$(LIBEXT) $(BOARDDIR)/libboard$(LIBEXT) $(HOSTOS)-names.dat $(LINKOBJS)
@echo "LD: nuttx.rel"
@$(LD) -r $(LDFLAGS) $(LDPATHS) -o $@ $(LINKOBJS) --start-group $(LDLIBS) --end-group $(EXTRA_LIBS)
@$(OBJCOPY) --redefine-syms=$(HOSTOS)-names.dat $@
diff --git a/nuttx/arch/sim/src/up_touchscreen.c b/nuttx/arch/sim/src/up_touchscreen.c
index b012ff5b2..6c339eab8 100644
--- a/nuttx/arch/sim/src/up_touchscreen.c
+++ b/nuttx/arch/sim/src/up_touchscreen.c
@@ -714,7 +714,7 @@ void sim_tcuninitialize(void)
(void)snprintf(devname, DEV_NAMELEN, DEV_FORMAT, priv->minor);
ivdbg("Un-registering %s\n", devname);
- ret = runegister_driver(devname);
+ ret = unregister_driver(devname);
if (ret < 0)
{
idbg("uregister_driver() failed: %d\n", ret);