summaryrefslogtreecommitdiff
path: root/nuttx/configs/sam4s-xplained-pro/src
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-04-22 09:01:20 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-04-22 09:01:20 -0600
commit919fd1d3f93e7292da2b2a29a200f05b46886f06 (patch)
tree9556e73396200d8503560e5024b117b91e9ecc39 /nuttx/configs/sam4s-xplained-pro/src
parent4c0502234f156d9d21bd7c6d20d1002908ef65ed (diff)
downloadnuttx-919fd1d3f93e7292da2b2a29a200f05b46886f06.tar.gz
nuttx-919fd1d3f93e7292da2b2a29a200f05b46886f06.tar.bz2
nuttx-919fd1d3f93e7292da2b2a29a200f05b46886f06.zip
Various SAM4S related fixes, mostely related to the timer driver driver and the SAM4S timer/counter. All from Bob Doisin
Diffstat (limited to 'nuttx/configs/sam4s-xplained-pro/src')
-rw-r--r--nuttx/configs/sam4s-xplained-pro/src/Makefile3
-rw-r--r--nuttx/configs/sam4s-xplained-pro/src/sam4s-xplained-pro.h2
-rw-r--r--nuttx/configs/sam4s-xplained-pro/src/sam_nsh.c20
-rw-r--r--nuttx/configs/sam4s-xplained-pro/src/sam_wdt.c1
4 files changed, 21 insertions, 5 deletions
diff --git a/nuttx/configs/sam4s-xplained-pro/src/Makefile b/nuttx/configs/sam4s-xplained-pro/src/Makefile
index 15501d49e..e3ebc842f 100644
--- a/nuttx/configs/sam4s-xplained-pro/src/Makefile
+++ b/nuttx/configs/sam4s-xplained-pro/src/Makefile
@@ -72,6 +72,9 @@ ifeq ($(CONFIG_SAM34_WDT),y)
CSRCS += sam_wdt.c
endif
+ifeq ($(CONFIG_TIMER),y)
+CSRCS += sam_tc.c
+endif
COBJS = $(CSRCS:.c=$(OBJEXT))
diff --git a/nuttx/configs/sam4s-xplained-pro/src/sam4s-xplained-pro.h b/nuttx/configs/sam4s-xplained-pro/src/sam4s-xplained-pro.h
index 9226f2d0d..e4a6fc4ca 100644
--- a/nuttx/configs/sam4s-xplained-pro/src/sam4s-xplained-pro.h
+++ b/nuttx/configs/sam4s-xplained-pro/src/sam4s-xplained-pro.h
@@ -57,7 +57,7 @@
#define HAVE_HSMCI 1
#define HAVE_PROC 1
-#define HAVE_USBDEV 1
+#define HAVE_USBDEV 0
#undef HAVE_USBMONITOR
/* HSMCI */
diff --git a/nuttx/configs/sam4s-xplained-pro/src/sam_nsh.c b/nuttx/configs/sam4s-xplained-pro/src/sam_nsh.c
index 92b1ff8aa..60b1aee82 100644
--- a/nuttx/configs/sam4s-xplained-pro/src/sam_nsh.c
+++ b/nuttx/configs/sam4s-xplained-pro/src/sam_nsh.c
@@ -45,10 +45,9 @@
#include <stdio.h>
#include <errno.h>
#include <debug.h>
+#include <unistd.h>
-#ifdef CONFIG_SYSTEM_USBMONITOR
-# include <apps/usbmonitor.h>
-#endif
+#include <nuttx/arch.h>
#ifdef CONFIG_CDCACM
# include <nuttx/usb/cdcacm.h>
@@ -58,6 +57,14 @@
# include <nuttx/usb/pl2303.h>
#endif
+#ifdef CONFIG_TIMER
+# include <nuttx/timer.h>
+#endif
+
+#ifdef CONFIG_SYSTEM_USBMONITOR
+# include <apps/usbmonitor.h>
+#endif
+
#include "sam4s-xplained-pro.h"
/****************************************************************************
@@ -134,7 +141,6 @@ int nsh_archinitialize(void)
}
#endif
-#warning "add automount config...."
message("Mounting /dev/mmcsd0 to /fat\n");
ret = mount("/dev/mmcsd0", "/fat", "vfat", 0, NULL);
if (ret < 0)
@@ -143,5 +149,11 @@ int nsh_archinitialize(void)
return ret;
}
+#ifdef CONFIG_TIMER
+ /* Registers the timer driver and starts an async interrupt. */
+
+ up_timerinitialize();
+#endif
+
return OK;
}
diff --git a/nuttx/configs/sam4s-xplained-pro/src/sam_wdt.c b/nuttx/configs/sam4s-xplained-pro/src/sam_wdt.c
index 8423e802d..e78a12023 100644
--- a/nuttx/configs/sam4s-xplained-pro/src/sam_wdt.c
+++ b/nuttx/configs/sam4s-xplained-pro/src/sam_wdt.c
@@ -139,6 +139,7 @@ static int wdog_daemon(int argc, char *argv[])
goto errout_with_dev;
}
+ usleep(200);
while(1)
{
usleep((CONFIG_WDT_THREAD_INTERVAL)*1000);