From 4c0055e628afb43fa2b2919376ab96a82ede6af8 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 19 Mar 2011 15:02:01 +0000 Subject: Move VSN apps to apps/vsn git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3397 42af7a65-404d-4744-a932-0658087f49c3 --- apps/Make.defs | 4 +- apps/Makefile | 12 +++++ apps/free/Makefile | 103 ------------------------------------- apps/free/README.txt | 6 --- apps/free/free.c | 93 --------------------------------- apps/hello/Makefile | 103 ------------------------------------- apps/hello/README.txt | 5 -- apps/hello/hello.c | 75 --------------------------- apps/poweroff/Makefile | 103 ------------------------------------- apps/poweroff/README.txt | 5 -- apps/poweroff/poweroff.c | 42 --------------- apps/ramtron/Makefile | 103 ------------------------------------- apps/ramtron/README.txt | 7 --- apps/ramtron/ramtron.c | 97 ----------------------------------- apps/sdcard/Makefile | 103 ------------------------------------- apps/sdcard/README.txt | 7 --- apps/sdcard/sdcard.c | 110 ---------------------------------------- apps/vsn/Makefile | 58 +++++++++++++++++++++ apps/vsn/free/Makefile | 103 +++++++++++++++++++++++++++++++++++++ apps/vsn/free/README.txt | 6 +++ apps/vsn/free/free.c | 93 +++++++++++++++++++++++++++++++++ apps/vsn/hello/Makefile | 103 +++++++++++++++++++++++++++++++++++++ apps/vsn/hello/README.txt | 5 ++ apps/vsn/hello/hello.c | 75 +++++++++++++++++++++++++++ apps/vsn/poweroff/Makefile | 103 +++++++++++++++++++++++++++++++++++++ apps/vsn/poweroff/README.txt | 5 ++ apps/vsn/poweroff/poweroff.c | 42 +++++++++++++++ apps/vsn/ramtron/Makefile | 103 +++++++++++++++++++++++++++++++++++++ apps/vsn/ramtron/README.txt | 7 +++ apps/vsn/ramtron/ramtron.c | 97 +++++++++++++++++++++++++++++++++++ apps/vsn/sdcard/Makefile | 103 +++++++++++++++++++++++++++++++++++++ apps/vsn/sdcard/README.txt | 7 +++ apps/vsn/sdcard/sdcard.c | 110 ++++++++++++++++++++++++++++++++++++++++ misc/buildroot/ChangeLog | 3 ++ misc/buildroot/Makefile | 2 +- nuttx/ChangeLog | 5 ++ nuttx/Documentation/NuttX.html | 4 +- nuttx/configs/vsn/nsh/appconfig | 12 ++--- 38 files changed, 1052 insertions(+), 972 deletions(-) delete mode 100644 apps/free/Makefile delete mode 100644 apps/free/README.txt delete mode 100644 apps/free/free.c delete mode 100644 apps/hello/Makefile delete mode 100644 apps/hello/README.txt delete mode 100644 apps/hello/hello.c delete mode 100644 apps/poweroff/Makefile delete mode 100644 apps/poweroff/README.txt delete mode 100644 apps/poweroff/poweroff.c delete mode 100644 apps/ramtron/Makefile delete mode 100644 apps/ramtron/README.txt delete mode 100644 apps/ramtron/ramtron.c delete mode 100644 apps/sdcard/Makefile delete mode 100644 apps/sdcard/README.txt delete mode 100644 apps/sdcard/sdcard.c create mode 100644 apps/vsn/Makefile create mode 100644 apps/vsn/free/Makefile create mode 100644 apps/vsn/free/README.txt create mode 100644 apps/vsn/free/free.c create mode 100644 apps/vsn/hello/Makefile create mode 100644 apps/vsn/hello/README.txt create mode 100644 apps/vsn/hello/hello.c create mode 100644 apps/vsn/poweroff/Makefile create mode 100644 apps/vsn/poweroff/README.txt create mode 100644 apps/vsn/poweroff/poweroff.c create mode 100644 apps/vsn/ramtron/Makefile create mode 100644 apps/vsn/ramtron/README.txt create mode 100644 apps/vsn/ramtron/ramtron.c create mode 100644 apps/vsn/sdcard/Makefile create mode 100644 apps/vsn/sdcard/README.txt create mode 100644 apps/vsn/sdcard/sdcard.c diff --git a/apps/Make.defs b/apps/Make.defs index 0a6e869dd..5b6cd9aa0 100755 --- a/apps/Make.defs +++ b/apps/Make.defs @@ -36,6 +36,6 @@ define REGISTER @echo "Register: $1" - @echo "{ .name = \"$1\", .priority = $2, .stacksize = $3, .main = $4 }," >> ../exec_nuttapp_list.h - @echo "EXTERN int $4(int argc, char *argv[]);" >> ../exec_nuttapp_proto.h + @echo "{ .name = \"$1\", .priority = $2, .stacksize = $3, .main = $4 }," >> "$(APPDIR)/exec_nuttapp_list.h" + @echo "EXTERN int $4(int argc, char *argv[]);" >> "$(APPDIR)/exec_nuttapp_proto.h" endef diff --git a/apps/Makefile b/apps/Makefile index b9a067c26..ce00bb667 100644 --- a/apps/Makefile +++ b/apps/Makefile @@ -42,8 +42,14 @@ endif # Application Directories +# SUBDIRS is the list of all directories containing Makefiles. It is used +# only for cleaning. + +SUBDIRS = nshlib vsn + # we use a non-existing .built_always to guarantee that Makefile # always walks into the sub-directories and asks for build + BUILTIN_APPS_BUILT = BUILTIN_APPS_DIR = @@ -130,15 +136,21 @@ $(BIN): $(OBJS) $(BUILTIN_APPS_BUILT) depend: .depend +define MAKECLEAN + @(MAKE) -C $1 $2 TOPDIR="$(TOPDIR)" +endef + clean: @rm -f $(BIN) *~ .*.swp *.o libapps.a $(call CLEAN) + $(foreach DIR, $(SUBDIRS), $(eval $(call MAKECLEAN,$(DIR),clean))) distclean: clean @rm -f .config @rm -f Make.dep .depend @rm -f exec_nuttapp_list.h @rm -f exec_nuttapp_proto.h + $(foreach DIR, $(SUBDIRS), $(eval $(call MAKECLEAN,$(DIR),distclean))) -include Make.dep diff --git a/apps/free/Makefile b/apps/free/Makefile deleted file mode 100644 index 33b2c564c..000000000 --- a/apps/free/Makefile +++ /dev/null @@ -1,103 +0,0 @@ -############################################################################ -# Makefile -# -# Copyright (C) 2011 Uros Platise. All rights reserved. -# Author: Uros Platise -# Gregory Nutt -# -# 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. -# -############################################################################ - -# TODO, this makefile should run make under the app dirs, instead of -# sourcing the Make.defs! - --include $(TOPDIR)/Make.defs -include ../Make.defs - -ifeq ($(WINTOOL),y) -INCDIROPT = -w -endif - -# Hello Application -# TODO: appname can be automatically extracted from the directory name - -APPNAME = free -PRIORITY = SCHED_PRIORITY_DEFAULT -STACKSIZE = 768 - -ASRCS = -CSRCS = free.c - -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -BIN = ../libapps$(LIBEXT) - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -$(BIN): $(OBJS) - @( for obj in $(OBJS) ; do \ - $(call ARCHIVE, $@, $${obj}); \ - done ; ) - @touch .built - -.built: $(BIN) - -.depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) \ - $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - @touch $@ - -# Register application -depend: .depend - -clean: - @rm -f $(BIN) *.o *~ .*.swp .built - $(call CLEAN) - -distclean: clean - @rm -f Make.dep .depend - --include Make.dep diff --git a/apps/free/README.txt b/apps/free/README.txt deleted file mode 100644 index dd92a94ae..000000000 --- a/apps/free/README.txt +++ /dev/null @@ -1,6 +0,0 @@ - -This application provides UNIX style memory free information. - - Source: NuttX - Author: Gregory Nutt - Date: 17. March 2011 diff --git a/apps/free/free.c b/apps/free/free.c deleted file mode 100644 index fa5288cdd..000000000 --- a/apps/free/free.c +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** - * free/free.c - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * 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 - -#include -#include - - -/**************************************************************************** - * Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: cmd_free - ****************************************************************************/ - -int free_main(int argc, char **argv) -{ - struct mallinfo mem; - -#ifdef CONFIG_CAN_PASS_STRUCTS - mem = mallinfo(); -#else - (void)mallinfo(&mem); -#endif - - printf(" total used free largest\n"); - printf("Mem: %11d%11d%11d%11d\n", - mem.arena, mem.uordblks, mem.fordblks, mem.mxordblk); - - return OK; -} diff --git a/apps/hello/Makefile b/apps/hello/Makefile deleted file mode 100644 index 720d365af..000000000 --- a/apps/hello/Makefile +++ /dev/null @@ -1,103 +0,0 @@ -############################################################################ -# Makefile -# -# Copyright (C) 2011 Uros Platise. All rights reserved. -# Author: Uros Platise -# Gregory Nutt -# -# 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. -# -############################################################################ - -# TODO, this makefile should run make under the app dirs, instead of -# sourcing the Make.defs! - --include $(TOPDIR)/Make.defs -include ../Make.defs - -ifeq ($(WINTOOL),y) -INCDIROPT = -w -endif - -# Hello Application -# TODO: appname can be automatically extracted from the directory name - -APPNAME = hello -PRIORITY = SCHED_PRIORITY_DEFAULT -STACKSIZE = 768 - -ASRCS = -CSRCS = hello.c - -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -BIN = ../libapps$(LIBEXT) - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -$(BIN): $(OBJS) - @( for obj in $(OBJS) ; do \ - $(call ARCHIVE, $@, $${obj}); \ - done ; ) - @touch .built - -.built: $(BIN) - -.depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) \ - $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - @touch $@ - -# Register application -depend: .depend - -clean: - @rm -f $(BIN) *.o *~ .*.swp .built - $(call CLEAN) - -distclean: clean - @rm -f Make.dep .depend - --include Make.dep diff --git a/apps/hello/README.txt b/apps/hello/README.txt deleted file mode 100644 index 531c4d193..000000000 --- a/apps/hello/README.txt +++ /dev/null @@ -1,5 +0,0 @@ - -This application provides Hello Builtin Application skeleton - - Source: NuttX - Date: 13. March 2011 diff --git a/apps/hello/hello.c b/apps/hello/hello.c deleted file mode 100644 index fb94d0ea9..000000000 --- a/apps/hello/hello.c +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** - * hello/hello.c - * - * Copyright (C) 2011 Uros Platise. All rights reserved. - * Author: Uros Platise - * - * 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 -#include - - -void memtest(void) -{ - char *p; - int i, j; - - for (i=0; i<1000; i++) { - p = malloc(40000); - if (!p) { - printf("No memory\n"); - break; - } - for (j=0; j<40000; j++) p[j] = 0; - free(p); - } -} - - -/** Example of a standalone application - */ -int hello_main(int argc, char *argv[]) -{ - int i; - - printf("Hello Builtin Application\n" - "Found argc=%d arguments and are as follows:\n", argc); - - // note that stdout is bufferred and that fflush() and is called on exit. - fflush(stdout); - - for (i=0; i -# Gregory Nutt -# -# 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. -# -############################################################################ - -# TODO, this makefile should run make under the app dirs, instead of -# sourcing the Make.defs! - --include $(TOPDIR)/Make.defs -include ../Make.defs - -ifeq ($(WINTOOL),y) -INCDIROPT = -w -endif - -# Hello Application -# TODO: appname can be automatically extracted from the directory name - -APPNAME = poweroff -PRIORITY = SCHED_PRIORITY_DEFAULT -STACKSIZE = 768 - -ASRCS = -CSRCS = poweroff.c - -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -BIN = ../libapps$(LIBEXT) - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -$(BIN): $(OBJS) - @( for obj in $(OBJS) ; do \ - $(call ARCHIVE, $@, $${obj}); \ - done ; ) - @touch .built - -.built: $(BIN) - -.depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) \ - $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - @touch $@ - -# Register application -depend: .depend - -clean: - @rm -f $(BIN) *.o *~ .*.swp .built - $(call CLEAN) - -distclean: clean - @rm -f Make.dep .depend - --include Make.dep diff --git a/apps/poweroff/README.txt b/apps/poweroff/README.txt deleted file mode 100644 index e02180e5a..000000000 --- a/apps/poweroff/README.txt +++ /dev/null @@ -1,5 +0,0 @@ - -This application provides poweroff command - - Source: NuttX - Date: 13. March 2011 diff --git a/apps/poweroff/poweroff.c b/apps/poweroff/poweroff.c deleted file mode 100644 index f8b56e0d8..000000000 --- a/apps/poweroff/poweroff.c +++ /dev/null @@ -1,42 +0,0 @@ -/**************************************************************************** - * poweroff/poweroff.c - * - * Copyright (C) 2011 Uros Platise. All rights reserved. - * Author: Uros Platise - * - * 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 - -int poweroff_main(int argc, char *argv[]) -{ - board_power_off(); - return 0; -} diff --git a/apps/ramtron/Makefile b/apps/ramtron/Makefile deleted file mode 100644 index d2430f747..000000000 --- a/apps/ramtron/Makefile +++ /dev/null @@ -1,103 +0,0 @@ -############################################################################ -# Makefile -# -# Copyright (C) 2011 Uros Platise. All rights reserved. -# Author: Uros Platise -# Gregory Nutt -# -# 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. -# -############################################################################ - -# TODO, this makefile should run make under the app dirs, instead of -# sourcing the Make.defs! - --include $(TOPDIR)/Make.defs -include ../Make.defs - -ifeq ($(WINTOOL),y) -INCDIROPT = -w -endif - -# Hello Application -# TODO: appname can be automatically extracted from the directory name - -APPNAME = ramtron -PRIORITY = SCHED_PRIORITY_DEFAULT -STACKSIZE = 1024 - -ASRCS = -CSRCS = ramtron.c - -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -BIN = ../libapps$(LIBEXT) - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -$(BIN): $(OBJS) - @( for obj in $(OBJS) ; do \ - $(call ARCHIVE, $@, $${obj}); \ - done ; ) - @touch .built - -.built: $(BIN) - -.depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) \ - $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - @touch $@ - -# Register application -depend: .depend - -clean: - @rm -f $(BIN) *.o *~ .*.swp .built - $(call CLEAN) - -distclean: clean - @rm -f Make.dep .depend - --include Make.dep diff --git a/apps/ramtron/README.txt b/apps/ramtron/README.txt deleted file mode 100644 index 152774b66..000000000 --- a/apps/ramtron/README.txt +++ /dev/null @@ -1,7 +0,0 @@ - -This application provides RAMTRON tool/lib to start, stop or to perform -RAMTRON custom operations. - - Source: NuttX - Author: Uros Platise - Date: 18. March 2011 diff --git a/apps/ramtron/ramtron.c b/apps/ramtron/ramtron.c deleted file mode 100644 index 323a42247..000000000 --- a/apps/ramtron/ramtron.c +++ /dev/null @@ -1,97 +0,0 @@ -/**************************************************************************** - * ramtron/ramtron.c - * - * Copyright (C) 2011 Uros Platise. All rights reserved. - * Copyright (C) 2009 Gregory Nutt. All rights reserved. - * - * Authors: Uros Platise - * Gregory Nutt - * - * 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 - -#include -#include -#include -#include - -#include -#include - - -int ramtron_start(int spino) -{ - FAR struct spi_dev_s *spi; - FAR struct mtd_dev_s *mtd; - int retval; - - /* Get the SPI port */ - - spi = up_spiinitialize(spino); - if (!spi) - { - printf("RAMTRON: Failed to initialize SPI%d\n", spino); - return -ENODEV; - } - printf("RAMTRON: Initialized SPI%d\n", spino); - - mtd = (struct mtd_dev_s *)ramtron_initialize(spi); - if (!mtd) - { - printf("RAMTRON: Device not found\n"); - return -ENODEV; - } - printf("RAMTRON: FM25V10 of size 128 kB\n"); - //printf("RAMTRON: %s of size %d B\n", ramtron_getpart(mtd), ramtron_getsize(mtd) ); - - retval = ftl_initialize(0, NULL, mtd); - printf("RAMTRON: FTL Initialized (returns with %d)\n", retval); - - return OK; -} - - -int ramtron_main(int argc, char *argv[]) -{ - int spino; - - if (argc == 3) { - spino = atoi(argv[2]); - - if (!strcmp(argv[1], "start")) { - return ramtron_start(spino); - } - } - - // todo: write protect - printf("%s: \n", argv[0]); - return -1; -} diff --git a/apps/sdcard/Makefile b/apps/sdcard/Makefile deleted file mode 100644 index 9df8cbe98..000000000 --- a/apps/sdcard/Makefile +++ /dev/null @@ -1,103 +0,0 @@ -############################################################################ -# Makefile -# -# Copyright (C) 2011 Uros Platise. All rights reserved. -# Author: Uros Platise -# Gregory Nutt -# -# 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. -# -############################################################################ - -# TODO, this makefile should run make under the app dirs, instead of -# sourcing the Make.defs! - --include $(TOPDIR)/Make.defs -include ../Make.defs - -ifeq ($(WINTOOL),y) -INCDIROPT = -w -endif - -# Hello Application -# TODO: appname can be automatically extracted from the directory name - -APPNAME = sdcard -PRIORITY = SCHED_PRIORITY_DEFAULT -STACKSIZE = 1024 - -ASRCS = -CSRCS = sdcard.c - -AOBJS = $(ASRCS:.S=$(OBJEXT)) -COBJS = $(CSRCS:.c=$(OBJEXT)) - -SRCS = $(ASRCS) $(CSRCS) -OBJS = $(AOBJS) $(COBJS) - -BIN = ../libapps$(LIBEXT) - -ROOTDEPPATH = --dep-path . - -# Common build - -VPATH = - -all: .built - -$(AOBJS): %$(OBJEXT): %.S - $(call ASSEMBLE, $<, $@) - -$(COBJS): %$(OBJEXT): %.c - $(call COMPILE, $<, $@) - -$(BIN): $(OBJS) - @( for obj in $(OBJS) ; do \ - $(call ARCHIVE, $@, $${obj}); \ - done ; ) - @touch .built - -.built: $(BIN) - -.depend: Makefile $(SRCS) - @$(MKDEP) $(ROOTDEPPATH) \ - $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep - $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) - @touch $@ - -# Register application -depend: .depend - -clean: - @rm -f $(BIN) *.o *~ .*.swp .built - $(call CLEAN) - -distclean: clean - @rm -f Make.dep .depend - --include Make.dep diff --git a/apps/sdcard/README.txt b/apps/sdcard/README.txt deleted file mode 100644 index 332aa26cf..000000000 --- a/apps/sdcard/README.txt +++ /dev/null @@ -1,7 +0,0 @@ - -This application provides SDcard tool/lib to start, stop, eject or insert -a memory card. - - Source: NuttX - Author: Uros Platise - Date: 18. March 2011 diff --git a/apps/sdcard/sdcard.c b/apps/sdcard/sdcard.c deleted file mode 100644 index bf3e82a07..000000000 --- a/apps/sdcard/sdcard.c +++ /dev/null @@ -1,110 +0,0 @@ -/**************************************************************************** - * sdcard/sdcard.c - * - * Copyright (C) 2011 Uros Platise. All rights reserved. - * Copyright (C) 2009 Gregory Nutt. All rights reserved. - * - * Authors: Uros Platise - * Gregory Nutt - * - * 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 - -#include -#include -#include -#include - -#ifdef CONFIG_STM32_SDIO -# include -# include -#endif - - - -/* Create device device for the SDIO-based MMC/SD block driver */ - -int sdcard_start(int slotno) -{ - FAR struct sdio_dev_s *sdio; - int ret; - - /* First, get an instance of the SDIO interface */ - - sdio = sdio_initialize(slotno); - if (!sdio) - { - printf("SDIO: Failed to initialize slot %d\n", slotno); - return -ENODEV; - } - printf("SDIO: Initialized slot %d\n", slotno); - - /* Now bind the SPI interface to the MMC/SD driver */ - - ret = mmcsd_slotinitialize(slotno, sdio); - if (ret != OK) - { - printf("SDIO: Failed to bind to the MMC/SD driver: %d\n", ret); - return ret; - } - printf("SDIO: Successfully bound to the MMC/SD driver\n"); - - /* Then let's guess and say that there is a card in the slot. I need to check to - * see if the VSN board supports a GPIO to detect if there is a card in - * the slot. - */ - sdio_mediachange(sdio, true); - - return OK; -} - - -int sdcard_main(int argc, char *argv[]) -{ - int slotno; - - if (argc == 3) { - slotno = atoi(argv[2]); - - if (!strcmp(argv[1], "start")) { - return sdcard_start(slotno); - } - else if (!strcmp(argv[1], "stop")) { - } - else if (!strcmp(argv[1], "insert")) { - } - else if (!strcmp(argv[1], "eject")) { - } - } - - printf("%s: \n", argv[0]); - return -1; -} diff --git a/apps/vsn/Makefile b/apps/vsn/Makefile new file mode 100644 index 000000000..d971d3fe4 --- /dev/null +++ b/apps/vsn/Makefile @@ -0,0 +1,58 @@ +############################################################################ +# vsn/Makefile +# +# Copyright (C) 2011 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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. +# +############################################################################ + +# Sub-directories + +SUBDIRS = free hello poweroff ramtron sdcard + +all: nothing +.PHONY: nothing + +nothing: + +define DOMAKE + @(MAKE) -C $1 $2 TOPDIR="$(TOPDIR)" +endef + +depend: + $(foreach DIR, $(SUBDIRS), $(eval $(call DOMAKE,$(DIR),depend))) + +clean: + $(foreach DIR, $(SUBDIRS), $(eval $(call DOMAKE,$(DIR),clean))) + +distclean: clean + $(foreach DIR, $(SUBDIRS), $(eval $(call DOMAKE,$(DIR),distclean))) + +-include Make.dep diff --git a/apps/vsn/free/Makefile b/apps/vsn/free/Makefile new file mode 100644 index 000000000..d63f7af3e --- /dev/null +++ b/apps/vsn/free/Makefile @@ -0,0 +1,103 @@ +############################################################################ +# Makefile +# +# Copyright (C) 2011 Uros Platise. All rights reserved. +# Author: Uros Platise +# Gregory Nutt +# +# 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. +# +############################################################################ + +# TODO, this makefile should run make under the app dirs, instead of +# sourcing the Make.defs! + +-include $(TOPDIR)/Make.defs +include ../../Make.defs + +ifeq ($(WINTOOL),y) +INCDIROPT = -w +endif + +# Hello Application +# TODO: appname can be automatically extracted from the directory name + +APPNAME = free +PRIORITY = SCHED_PRIORITY_DEFAULT +STACKSIZE = 768 + +ASRCS = +CSRCS = free.c + +AOBJS = $(ASRCS:.S=$(OBJEXT)) +COBJS = $(CSRCS:.c=$(OBJEXT)) + +SRCS = $(ASRCS) $(CSRCS) +OBJS = $(AOBJS) $(COBJS) + +BIN = ../../libapps$(LIBEXT) + +ROOTDEPPATH = --dep-path . + +# Common build + +VPATH = + +all: .built + +$(AOBJS): %$(OBJEXT): %.S + $(call ASSEMBLE, $<, $@) + +$(COBJS): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +$(BIN): $(OBJS) + @( for obj in $(OBJS) ; do \ + $(call ARCHIVE, $@, $${obj}); \ + done ; ) + @touch .built + +.built: $(BIN) + +.depend: Makefile $(SRCS) + @$(MKDEP) $(ROOTDEPPATH) \ + $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep + $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) + @touch $@ + +# Register application +depend: .depend + +clean: + @rm -f $(BIN) *.o *~ .*.swp .built + $(call CLEAN) + +distclean: clean + @rm -f Make.dep .depend + +-include Make.dep diff --git a/apps/vsn/free/README.txt b/apps/vsn/free/README.txt new file mode 100644 index 000000000..dd92a94ae --- /dev/null +++ b/apps/vsn/free/README.txt @@ -0,0 +1,6 @@ + +This application provides UNIX style memory free information. + + Source: NuttX + Author: Gregory Nutt + Date: 17. March 2011 diff --git a/apps/vsn/free/free.c b/apps/vsn/free/free.c new file mode 100644 index 000000000..fa5288cdd --- /dev/null +++ b/apps/vsn/free/free.c @@ -0,0 +1,93 @@ +/**************************************************************************** + * free/free.c + * + * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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 + +#include +#include + + +/**************************************************************************** + * Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: cmd_free + ****************************************************************************/ + +int free_main(int argc, char **argv) +{ + struct mallinfo mem; + +#ifdef CONFIG_CAN_PASS_STRUCTS + mem = mallinfo(); +#else + (void)mallinfo(&mem); +#endif + + printf(" total used free largest\n"); + printf("Mem: %11d%11d%11d%11d\n", + mem.arena, mem.uordblks, mem.fordblks, mem.mxordblk); + + return OK; +} diff --git a/apps/vsn/hello/Makefile b/apps/vsn/hello/Makefile new file mode 100644 index 000000000..a0bed80e1 --- /dev/null +++ b/apps/vsn/hello/Makefile @@ -0,0 +1,103 @@ +############################################################################ +# Makefile +# +# Copyright (C) 2011 Uros Platise. All rights reserved. +# Author: Uros Platise +# Gregory Nutt +# +# 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. +# +############################################################################ + +# TODO, this makefile should run make under the app dirs, instead of +# sourcing the Make.defs! + +-include $(TOPDIR)/Make.defs +include ../../Make.defs + +ifeq ($(WINTOOL),y) +INCDIROPT = -w +endif + +# Hello Application +# TODO: appname can be automatically extracted from the directory name + +APPNAME = hello +PRIORITY = SCHED_PRIORITY_DEFAULT +STACKSIZE = 768 + +ASRCS = +CSRCS = hello.c + +AOBJS = $(ASRCS:.S=$(OBJEXT)) +COBJS = $(CSRCS:.c=$(OBJEXT)) + +SRCS = $(ASRCS) $(CSRCS) +OBJS = $(AOBJS) $(COBJS) + +BIN = ../../libapps$(LIBEXT) + +ROOTDEPPATH = --dep-path . + +# Common build + +VPATH = + +all: .built + +$(AOBJS): %$(OBJEXT): %.S + $(call ASSEMBLE, $<, $@) + +$(COBJS): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +$(BIN): $(OBJS) + @( for obj in $(OBJS) ; do \ + $(call ARCHIVE, $@, $${obj}); \ + done ; ) + @touch .built + +.built: $(BIN) + +.depend: Makefile $(SRCS) + @$(MKDEP) $(ROOTDEPPATH) \ + $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep + $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) + @touch $@ + +# Register application +depend: .depend + +clean: + @rm -f $(BIN) *.o *~ .*.swp .built + $(call CLEAN) + +distclean: clean + @rm -f Make.dep .depend + +-include Make.dep diff --git a/apps/vsn/hello/README.txt b/apps/vsn/hello/README.txt new file mode 100644 index 000000000..531c4d193 --- /dev/null +++ b/apps/vsn/hello/README.txt @@ -0,0 +1,5 @@ + +This application provides Hello Builtin Application skeleton + + Source: NuttX + Date: 13. March 2011 diff --git a/apps/vsn/hello/hello.c b/apps/vsn/hello/hello.c new file mode 100644 index 000000000..fb94d0ea9 --- /dev/null +++ b/apps/vsn/hello/hello.c @@ -0,0 +1,75 @@ +/**************************************************************************** + * hello/hello.c + * + * Copyright (C) 2011 Uros Platise. All rights reserved. + * Author: Uros Platise + * + * 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 +#include + + +void memtest(void) +{ + char *p; + int i, j; + + for (i=0; i<1000; i++) { + p = malloc(40000); + if (!p) { + printf("No memory\n"); + break; + } + for (j=0; j<40000; j++) p[j] = 0; + free(p); + } +} + + +/** Example of a standalone application + */ +int hello_main(int argc, char *argv[]) +{ + int i; + + printf("Hello Builtin Application\n" + "Found argc=%d arguments and are as follows:\n", argc); + + // note that stdout is bufferred and that fflush() and is called on exit. + fflush(stdout); + + for (i=0; i +# Gregory Nutt +# +# 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. +# +############################################################################ + +# TODO, this makefile should run make under the app dirs, instead of +# sourcing the Make.defs! + +-include $(TOPDIR)/Make.defs +include ../../Make.defs + +ifeq ($(WINTOOL),y) +INCDIROPT = -w +endif + +# Hello Application +# TODO: appname can be automatically extracted from the directory name + +APPNAME = poweroff +PRIORITY = SCHED_PRIORITY_DEFAULT +STACKSIZE = 768 + +ASRCS = +CSRCS = poweroff.c + +AOBJS = $(ASRCS:.S=$(OBJEXT)) +COBJS = $(CSRCS:.c=$(OBJEXT)) + +SRCS = $(ASRCS) $(CSRCS) +OBJS = $(AOBJS) $(COBJS) + +BIN = ../../libapps$(LIBEXT) + +ROOTDEPPATH = --dep-path . + +# Common build + +VPATH = + +all: .built + +$(AOBJS): %$(OBJEXT): %.S + $(call ASSEMBLE, $<, $@) + +$(COBJS): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +$(BIN): $(OBJS) + @( for obj in $(OBJS) ; do \ + $(call ARCHIVE, $@, $${obj}); \ + done ; ) + @touch .built + +.built: $(BIN) + +.depend: Makefile $(SRCS) + @$(MKDEP) $(ROOTDEPPATH) \ + $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep + $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) + @touch $@ + +# Register application +depend: .depend + +clean: + @rm -f $(BIN) *.o *~ .*.swp .built + $(call CLEAN) + +distclean: clean + @rm -f Make.dep .depend + +-include Make.dep diff --git a/apps/vsn/poweroff/README.txt b/apps/vsn/poweroff/README.txt new file mode 100644 index 000000000..e02180e5a --- /dev/null +++ b/apps/vsn/poweroff/README.txt @@ -0,0 +1,5 @@ + +This application provides poweroff command + + Source: NuttX + Date: 13. March 2011 diff --git a/apps/vsn/poweroff/poweroff.c b/apps/vsn/poweroff/poweroff.c new file mode 100644 index 000000000..f8b56e0d8 --- /dev/null +++ b/apps/vsn/poweroff/poweroff.c @@ -0,0 +1,42 @@ +/**************************************************************************** + * poweroff/poweroff.c + * + * Copyright (C) 2011 Uros Platise. All rights reserved. + * Author: Uros Platise + * + * 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 + +int poweroff_main(int argc, char *argv[]) +{ + board_power_off(); + return 0; +} diff --git a/apps/vsn/ramtron/Makefile b/apps/vsn/ramtron/Makefile new file mode 100644 index 000000000..42b73a09b --- /dev/null +++ b/apps/vsn/ramtron/Makefile @@ -0,0 +1,103 @@ +############################################################################ +# Makefile +# +# Copyright (C) 2011 Uros Platise. All rights reserved. +# Author: Uros Platise +# Gregory Nutt +# +# 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. +# +############################################################################ + +# TODO, this makefile should run make under the app dirs, instead of +# sourcing the Make.defs! + +-include $(TOPDIR)/Make.defs +include ../../Make.defs + +ifeq ($(WINTOOL),y) +INCDIROPT = -w +endif + +# Hello Application +# TODO: appname can be automatically extracted from the directory name + +APPNAME = ramtron +PRIORITY = SCHED_PRIORITY_DEFAULT +STACKSIZE = 1024 + +ASRCS = +CSRCS = ramtron.c + +AOBJS = $(ASRCS:.S=$(OBJEXT)) +COBJS = $(CSRCS:.c=$(OBJEXT)) + +SRCS = $(ASRCS) $(CSRCS) +OBJS = $(AOBJS) $(COBJS) + +BIN = ../../libapps$(LIBEXT) + +ROOTDEPPATH = --dep-path . + +# Common build + +VPATH = + +all: .built + +$(AOBJS): %$(OBJEXT): %.S + $(call ASSEMBLE, $<, $@) + +$(COBJS): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +$(BIN): $(OBJS) + @( for obj in $(OBJS) ; do \ + $(call ARCHIVE, $@, $${obj}); \ + done ; ) + @touch .built + +.built: $(BIN) + +.depend: Makefile $(SRCS) + @$(MKDEP) $(ROOTDEPPATH) \ + $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep + $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) + @touch $@ + +# Register application +depend: .depend + +clean: + @rm -f $(BIN) *.o *~ .*.swp .built + $(call CLEAN) + +distclean: clean + @rm -f Make.dep .depend + +-include Make.dep diff --git a/apps/vsn/ramtron/README.txt b/apps/vsn/ramtron/README.txt new file mode 100644 index 000000000..152774b66 --- /dev/null +++ b/apps/vsn/ramtron/README.txt @@ -0,0 +1,7 @@ + +This application provides RAMTRON tool/lib to start, stop or to perform +RAMTRON custom operations. + + Source: NuttX + Author: Uros Platise + Date: 18. March 2011 diff --git a/apps/vsn/ramtron/ramtron.c b/apps/vsn/ramtron/ramtron.c new file mode 100644 index 000000000..323a42247 --- /dev/null +++ b/apps/vsn/ramtron/ramtron.c @@ -0,0 +1,97 @@ +/**************************************************************************** + * ramtron/ramtron.c + * + * Copyright (C) 2011 Uros Platise. All rights reserved. + * Copyright (C) 2009 Gregory Nutt. All rights reserved. + * + * Authors: Uros Platise + * Gregory Nutt + * + * 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 + +#include +#include +#include +#include + +#include +#include + + +int ramtron_start(int spino) +{ + FAR struct spi_dev_s *spi; + FAR struct mtd_dev_s *mtd; + int retval; + + /* Get the SPI port */ + + spi = up_spiinitialize(spino); + if (!spi) + { + printf("RAMTRON: Failed to initialize SPI%d\n", spino); + return -ENODEV; + } + printf("RAMTRON: Initialized SPI%d\n", spino); + + mtd = (struct mtd_dev_s *)ramtron_initialize(spi); + if (!mtd) + { + printf("RAMTRON: Device not found\n"); + return -ENODEV; + } + printf("RAMTRON: FM25V10 of size 128 kB\n"); + //printf("RAMTRON: %s of size %d B\n", ramtron_getpart(mtd), ramtron_getsize(mtd) ); + + retval = ftl_initialize(0, NULL, mtd); + printf("RAMTRON: FTL Initialized (returns with %d)\n", retval); + + return OK; +} + + +int ramtron_main(int argc, char *argv[]) +{ + int spino; + + if (argc == 3) { + spino = atoi(argv[2]); + + if (!strcmp(argv[1], "start")) { + return ramtron_start(spino); + } + } + + // todo: write protect + printf("%s: \n", argv[0]); + return -1; +} diff --git a/apps/vsn/sdcard/Makefile b/apps/vsn/sdcard/Makefile new file mode 100644 index 000000000..ccbd22952 --- /dev/null +++ b/apps/vsn/sdcard/Makefile @@ -0,0 +1,103 @@ +############################################################################ +# Makefile +# +# Copyright (C) 2011 Uros Platise. All rights reserved. +# Author: Uros Platise +# Gregory Nutt +# +# 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. +# +############################################################################ + +# TODO, this makefile should run make under the app dirs, instead of +# sourcing the Make.defs! + +-include $(TOPDIR)/Make.defs +include ../../Make.defs + +ifeq ($(WINTOOL),y) +INCDIROPT = -w +endif + +# Hello Application +# TODO: appname can be automatically extracted from the directory name + +APPNAME = sdcard +PRIORITY = SCHED_PRIORITY_DEFAULT +STACKSIZE = 1024 + +ASRCS = +CSRCS = sdcard.c + +AOBJS = $(ASRCS:.S=$(OBJEXT)) +COBJS = $(CSRCS:.c=$(OBJEXT)) + +SRCS = $(ASRCS) $(CSRCS) +OBJS = $(AOBJS) $(COBJS) + +BIN = ../../libapps$(LIBEXT) + +ROOTDEPPATH = --dep-path . + +# Common build + +VPATH = + +all: .built + +$(AOBJS): %$(OBJEXT): %.S + $(call ASSEMBLE, $<, $@) + +$(COBJS): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +$(BIN): $(OBJS) + @( for obj in $(OBJS) ; do \ + $(call ARCHIVE, $@, $${obj}); \ + done ; ) + @touch .built + +.built: $(BIN) + +.depend: Makefile $(SRCS) + @$(MKDEP) $(ROOTDEPPATH) \ + $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep + $(call REGISTER,$(APPNAME),$(PRIORITY),$(STACKSIZE),$(APPNAME)_main) + @touch $@ + +# Register application +depend: .depend + +clean: + @rm -f $(BIN) *.o *~ .*.swp .built + $(call CLEAN) + +distclean: clean + @rm -f Make.dep .depend + +-include Make.dep diff --git a/apps/vsn/sdcard/README.txt b/apps/vsn/sdcard/README.txt new file mode 100644 index 000000000..332aa26cf --- /dev/null +++ b/apps/vsn/sdcard/README.txt @@ -0,0 +1,7 @@ + +This application provides SDcard tool/lib to start, stop, eject or insert +a memory card. + + Source: NuttX + Author: Uros Platise + Date: 18. March 2011 diff --git a/apps/vsn/sdcard/sdcard.c b/apps/vsn/sdcard/sdcard.c new file mode 100644 index 000000000..bf3e82a07 --- /dev/null +++ b/apps/vsn/sdcard/sdcard.c @@ -0,0 +1,110 @@ +/**************************************************************************** + * sdcard/sdcard.c + * + * Copyright (C) 2011 Uros Platise. All rights reserved. + * Copyright (C) 2009 Gregory Nutt. All rights reserved. + * + * Authors: Uros Platise + * Gregory Nutt + * + * 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 + +#include +#include +#include +#include + +#ifdef CONFIG_STM32_SDIO +# include +# include +#endif + + + +/* Create device device for the SDIO-based MMC/SD block driver */ + +int sdcard_start(int slotno) +{ + FAR struct sdio_dev_s *sdio; + int ret; + + /* First, get an instance of the SDIO interface */ + + sdio = sdio_initialize(slotno); + if (!sdio) + { + printf("SDIO: Failed to initialize slot %d\n", slotno); + return -ENODEV; + } + printf("SDIO: Initialized slot %d\n", slotno); + + /* Now bind the SPI interface to the MMC/SD driver */ + + ret = mmcsd_slotinitialize(slotno, sdio); + if (ret != OK) + { + printf("SDIO: Failed to bind to the MMC/SD driver: %d\n", ret); + return ret; + } + printf("SDIO: Successfully bound to the MMC/SD driver\n"); + + /* Then let's guess and say that there is a card in the slot. I need to check to + * see if the VSN board supports a GPIO to detect if there is a card in + * the slot. + */ + sdio_mediachange(sdio, true); + + return OK; +} + + +int sdcard_main(int argc, char *argv[]) +{ + int slotno; + + if (argc == 3) { + slotno = atoi(argv[2]); + + if (!strcmp(argv[1], "start")) { + return sdcard_start(slotno); + } + else if (!strcmp(argv[1], "stop")) { + } + else if (!strcmp(argv[1], "insert")) { + } + else if (!strcmp(argv[1], "eject")) { + } + } + + printf("%s: \n", argv[0]); + return -1; +} diff --git a/misc/buildroot/ChangeLog b/misc/buildroot/ChangeLog index 3ea2b60f3..c871bdd49 100644 --- a/misc/buildroot/ChangeLog +++ b/misc/buildroot/ChangeLog @@ -89,4 +89,7 @@ buildroot-1.10 2011-xx-xx .exe files). That is probably not usable for most NuttX targets. Instead, you should use this i486-elf-gcc to generate true ELF binaries under Cygwin. + * Makefile - Alter copy arguements to avoid permissions problems when + copying NuttX header files. + diff --git a/misc/buildroot/Makefile b/misc/buildroot/Makefile index 5000dec8f..166b13c04 100644 --- a/misc/buildroot/Makefile +++ b/misc/buildroot/Makefile @@ -122,7 +122,7 @@ $(NUTTX_DIR)/include/arch: $(NUTTX_DIR) $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/include : $(STAGING_DIR) $(NUTTX_DIR)/include/arch @mkdir -p $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/include || \ { echo "Failed to create $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/include" ; exit 1 ; } - @cp -a $(NUTTX_DIR)/include/* $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/include/. || \ + @cp -aLf $(NUTTX_DIR)/include/* $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/include/. || \ { echo "Failed to copy Nuttx header files" ; exit 1 ; } $(TOOL_BUILD_DIR): diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 11056a44c..1904cf0f0 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -1597,3 +1597,8 @@ * examples/nsh and apps/nshlib - Move the core NuttShell (NSH) logic out of the exemples directory and into the apps/directory where it belongs. + * apps/Makefile and configs/*/appconfig - Use '=' as the delimiter + instead of '/' so that sub-directories in apps/ can be used. + * apps/vsn - Move all VSN apps to apps/vsn. + + diff --git a/nuttx/Documentation/NuttX.html b/nuttx/Documentation/NuttX.html index 61b6e1d3e..6d7414d3a 100644 --- a/nuttx/Documentation/NuttX.html +++ b/nuttx/Documentation/NuttX.html @@ -8,7 +8,7 @@

NuttX RTOS

-

Last Updated: March 18, 2011

+

Last Updated: March 19, 2011

@@ -2248,6 +2248,8 @@ buildroot-1.10 2011-xx-xx <spudmonkey@racsa.co.cr> .exe files). That is probably not usable for most NuttX targets. Instead, you should use this i486-elf-gcc to generate true ELF binaries under Cygwin. + * Makefile - Alter copy arguements to avoid permissions problems when + copying NuttX header files. diff --git a/nuttx/configs/vsn/nsh/appconfig b/nuttx/configs/vsn/nsh/appconfig index 0d7fd27f4..3371dc21a 100755 --- a/nuttx/configs/vsn/nsh/appconfig +++ b/nuttx/configs/vsn/nsh/appconfig @@ -54,19 +54,19 @@ CONFIGURED_APPS += nshlib=.built_always # Individual selection of built-in applications: # Hello world provide a simple skeleton/demo application -CONFIGURED_APPS += hello=.built_always +CONFIGURED_APPS += vsn/hello=.built_always # Provide poweroff command to switch off the board -CONFIGURED_APPS += poweroff=.built_always +CONFIGURED_APPS += vsn/poweroff=.built_always # Provide SDcard tool -CONFIGURED_APPS += sdcard=.built_always +CONFIGURED_APPS += vsn/sdcard=.built_always # Provide RAMTRON tool -CONFIGURED_APPS += ramtron=.built_always +CONFIGURED_APPS += vsn/ramtron=.built_always # Provide UNIX style free -CONFIGURED_APPS += free=.built_always +CONFIGURED_APPS += vsn/free=.built_always # Provide JAVA Virtual Machine (the Darjeeling JVM) -#CONFIGURED_APPS += jvm=.built_always +#CONFIGURED_APPS += vsn/jvm=.built_always -- cgit v1.2.3