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:
parent
f42c357654
commit
44173905cb
@ -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>
|
||||||
|
@ -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))
|
||||||
|
|
||||||
|
@ -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 */
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user