summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-07-07 16:20:35 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-07-07 16:20:35 +0000
commit21de300584601f990c440757197097746fa40034 (patch)
treedb07761a3cee55d5c466a67261f0da23d73e8c96 /apps
parent6aaedb5fc741627830baa841728c504b62e047a6 (diff)
downloadpx4-nuttx-21de300584601f990c440757197097746fa40034.tar.gz
px4-nuttx-21de300584601f990c440757197097746fa40034.tar.bz2
px4-nuttx-21de300584601f990c440757197097746fa40034.zip
Add support for STM3210E-EVAL button interrupts
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3750 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps')
-rw-r--r--apps/examples/Makefile6
-rw-r--r--apps/examples/README.txt17
-rw-r--r--apps/examples/buttons/Makefile93
-rw-r--r--apps/examples/buttons/main.c63
4 files changed, 176 insertions, 3 deletions
diff --git a/apps/examples/Makefile b/apps/examples/Makefile
index d4e96c11a..95769ed0c 100644
--- a/apps/examples/Makefile
+++ b/apps/examples/Makefile
@@ -37,9 +37,9 @@
# Sub-directories
-SUBDIRS = dhcpd ftpc hello helloxx hidkbd igmp mm mount nettest nsh null nx \
- nxffs nxflat ostest pashello pipe poll rgmp romfs sendmail serloop \
- thttpd udp uip usbserial usbstorage wget wlan
+SUBDIRS = buttons dhcpd ftpc hello helloxx hidkbd igmp mm mount nettest \
+ nsh null nx nxffs nxflat ostest pashello pipe poll rgmp romfs \
+ sendmail serloop thttpd udp uip usbserial usbstorage wget wlan
all: nothing
.PHONY: nothing context depend clean distclean
diff --git a/apps/examples/README.txt b/apps/examples/README.txt
index 7ce5e2b52..bda96a20a 100644
--- a/apps/examples/README.txt
+++ b/apps/examples/README.txt
@@ -12,6 +12,23 @@ examples
Selects the examples/ostest example.
+examples/buttons
+^^^^^^^^^^^^^^^^
+
+ This is a simple configuration that may be used to test the board-
+ specific button interfaces. Configuration options:
+
+ CONFIG_ARCH_BUTTONS - Must be defined for button support
+ CONFIG_EXAMPLE_BUTTONS_MIN - Lowest button number
+ CONFIG_EXAMPLE_BUTTONS_MAX - Highest button number
+
+ CONFIG_ARCH_IRQBUTTONS - Must be defined for interrupting button support
+ CONFIG_EXAMPLE_IRQBUTTONS_MIN - Lowest interrupting button number
+ CONFIG_EXAMPLE_IRQBUTTONS_MAX - Highest interrupting button number
+
+ Additional architecture-/board- specific configuration settings may also
+ be required.
+
examples/dhcpd
^^^^^^^^^^^^^^
diff --git a/apps/examples/buttons/Makefile b/apps/examples/buttons/Makefile
new file mode 100644
index 000000000..89db5cec1
--- /dev/null
+++ b/apps/examples/buttons/Makefile
@@ -0,0 +1,93 @@
+############################################################################
+# apps/examples/buttons/Makefile
+#
+# Copyright (C) 2011 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+
+-include $(TOPDIR)/.config
+-include $(TOPDIR)/Make.defs
+include $(APPDIR)/Make.defs
+
+# Hello, World! Example
+
+ASRCS =
+CSRCS = main.c
+
+AOBJS = $(ASRCS:.S=$(OBJEXT))
+COBJS = $(CSRCS:.c=$(OBJEXT))
+
+SRCS = $(ASRCS) $(CSRCS)
+OBJS = $(AOBJS) $(COBJS)
+
+ifeq ($(WINTOOL),y)
+ BIN = "${shell cygpath -w $(APPDIR)/libapps$(LIBEXT)}"
+else
+ BIN = "$(APPDIR)/libapps$(LIBEXT)"
+endif
+
+ROOTDEPPATH = --dep-path .
+
+# Common build
+
+VPATH =
+
+all: .built
+.PHONY: clean depend distclean
+
+$(AOBJS): %$(OBJEXT): %.S
+ $(call ASSEMBLE, $<, $@)
+
+$(COBJS): %$(OBJEXT): %.c
+ $(call COMPILE, $<, $@)
+
+.built: $(OBJS)
+ @( for obj in $(OBJS) ; do \
+ $(call ARCHIVE, $(BIN), $${obj}); \
+ done ; )
+ @touch .built
+
+context:
+
+.depend: Makefile $(SRCS)
+ @$(MKDEP) $(ROOTDEPPATH) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
+ @touch $@
+
+depend: .depend
+
+clean:
+ @rm -f *.o *~ .*.swp .built
+ $(call CLEAN)
+
+distclean: clean
+ @rm -f Make.dep .depend
+
+-include Make.dep
diff --git a/apps/examples/buttons/main.c b/apps/examples/buttons/main.c
new file mode 100644
index 000000000..cd1e0cce8
--- /dev/null
+++ b/apps/examples/buttons/main.c
@@ -0,0 +1,63 @@
+/****************************************************************************
+ * examples/buttons/main.c
+ *
+ * Copyright (C) 2011 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+#include <stdio.h>
+
+/****************************************************************************
+ * Definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * user_start
+ ****************************************************************************/
+
+int user_start(int argc, char *argv[])
+{
+ return 0;
+}
+