Various SAM4S related fixes, mostely related to the timer driver driver and the SAM4S timer/counter. All from Bob Doisin

This commit is contained in:
Gregory Nutt 2014-04-22 09:01:20 -06:00
parent f42c357654
commit 44173905cb
5 changed files with 22 additions and 5 deletions

View File

@ -41,6 +41,7 @@
************************************************************************************/ ************************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdbool.h>
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
# include <stdint.h> # include <stdint.h>

View File

@ -72,6 +72,9 @@ ifeq ($(CONFIG_SAM34_WDT),y)
CSRCS += sam_wdt.c CSRCS += sam_wdt.c
endif endif
ifeq ($(CONFIG_TIMER),y)
CSRCS += sam_tc.c
endif
COBJS = $(CSRCS:.c=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT))

View File

@ -57,7 +57,7 @@
#define HAVE_HSMCI 1 #define HAVE_HSMCI 1
#define HAVE_PROC 1 #define HAVE_PROC 1
#define HAVE_USBDEV 1 #define HAVE_USBDEV 0
#undef HAVE_USBMONITOR #undef HAVE_USBMONITOR
/* HSMCI */ /* HSMCI */

View File

@ -45,10 +45,9 @@
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
#include <debug.h> #include <debug.h>
#include <unistd.h>
#ifdef CONFIG_SYSTEM_USBMONITOR #include <nuttx/arch.h>
# include <apps/usbmonitor.h>
#endif
#ifdef CONFIG_CDCACM #ifdef CONFIG_CDCACM
# include <nuttx/usb/cdcacm.h> # include <nuttx/usb/cdcacm.h>
@ -58,6 +57,14 @@
# include <nuttx/usb/pl2303.h> # include <nuttx/usb/pl2303.h>
#endif #endif
#ifdef CONFIG_TIMER
# include <nuttx/timer.h>
#endif
#ifdef CONFIG_SYSTEM_USBMONITOR
# include <apps/usbmonitor.h>
#endif
#include "sam4s-xplained-pro.h" #include "sam4s-xplained-pro.h"
/**************************************************************************** /****************************************************************************
@ -134,7 +141,6 @@ int nsh_archinitialize(void)
} }
#endif #endif
#warning "add automount config...."
message("Mounting /dev/mmcsd0 to /fat\n"); message("Mounting /dev/mmcsd0 to /fat\n");
ret = mount("/dev/mmcsd0", "/fat", "vfat", 0, NULL); ret = mount("/dev/mmcsd0", "/fat", "vfat", 0, NULL);
if (ret < 0) if (ret < 0)
@ -143,5 +149,11 @@ int nsh_archinitialize(void)
return ret; return ret;
} }
#ifdef CONFIG_TIMER
/* Registers the timer driver and starts an async interrupt. */
up_timerinitialize();
#endif
return OK; return OK;
} }

View File

@ -139,6 +139,7 @@ static int wdog_daemon(int argc, char *argv[])
goto errout_with_dev; goto errout_with_dev;
} }
usleep(200);
while(1) while(1)
{ {
usleep((CONFIG_WDT_THREAD_INTERVAL)*1000); usleep((CONFIG_WDT_THREAD_INTERVAL)*1000);