summaryrefslogtreecommitdiff
path: root/nuttx
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx')
-rw-r--r--nuttx/configs/sam4s-xplained-pro/Kconfig8
-rw-r--r--nuttx/configs/sam4s-xplained-pro/nsh/defconfig6
-rw-r--r--nuttx/configs/sam4s-xplained-pro/src/sam_boot.c9
-rw-r--r--nuttx/configs/sam4s-xplained-pro/src/sam_nsh.c6
4 files changed, 19 insertions, 10 deletions
diff --git a/nuttx/configs/sam4s-xplained-pro/Kconfig b/nuttx/configs/sam4s-xplained-pro/Kconfig
index dd2134c3a..cce0f48a8 100644
--- a/nuttx/configs/sam4s-xplained-pro/Kconfig
+++ b/nuttx/configs/sam4s-xplained-pro/Kconfig
@@ -10,9 +10,15 @@ config SAM4S_XPLAINED_PRO_CDCACM_DEVMINOR
default 0
depends on SAM34_UDP && USBDEV && CDCACM
+config SAM4S_XPLAINED_PRO_SCHED_TIMER_DEVPATH
+ string "Scheduler Timer Device Path"
+ default "/dev/tc0"
+ depends on TIMER && SYSTEMTICK_EXTCLK
+
config SAM4S_XPLAINED_PRO_CPULOAD_TIMER_DEVPATH
string "CPU Load Timer Device Path"
- default "/dev/tc0"
+ default "/dev/tc1"
depends on TIMER && SCHED_CPULOAD && SCHED_CPULOAD_EXTCLK
+
endif
diff --git a/nuttx/configs/sam4s-xplained-pro/nsh/defconfig b/nuttx/configs/sam4s-xplained-pro/nsh/defconfig
index 25c41d06a..dbf11c354 100644
--- a/nuttx/configs/sam4s-xplained-pro/nsh/defconfig
+++ b/nuttx/configs/sam4s-xplained-pro/nsh/defconfig
@@ -212,7 +212,7 @@ CONFIG_SAM34_SMC=y
# CONFIG_SAM34_SPI0 is not set
# CONFIG_SAM34_SSC is not set
CONFIG_SAM34_TC0=y
-# CONFIG_SAM34_TC1 is not set
+CONFIG_SAM34_TC1=y
# CONFIG_SAM34_TC2 is not set
# CONFIG_SAM34_TC3 is not set
# CONFIG_SAM34_TC4 is not set
@@ -342,7 +342,8 @@ CONFIG_NSH_MMCSDSLOTNO=0
# Board-Specific Options
#
CONFIG_SAM4S_XPLAINED_PRO_CDCACM_DEVMINOR=0
-CONFIG_SAM4S_XPLAINED_PRO_CPULOAD_TIMER_DEVPATH="/dev/tc0"
+CONFIG_SAM4S_XPLAINED_PRO_SCHED_TIMER_DEVPATH="/dev/tc0"
+CONFIG_SAM4S_XPLAINED_PRO_CPULOAD_TIMER_DEVPATH="/dev/tc1"
#
# RTOS Features
@@ -359,6 +360,7 @@ CONFIG_DISABLE_ENVIRON=y
# Clocks and Timers
#
CONFIG_MSEC_PER_TICK=10
+CONFIG_SYSTEMTICK_EXTCLK=y
# CONFIG_SYSTEM_TIME64 is not set
# CONFIG_CLOCK_MONOTONIC is not set
CONFIG_JULIAN_TIME=y
diff --git a/nuttx/configs/sam4s-xplained-pro/src/sam_boot.c b/nuttx/configs/sam4s-xplained-pro/src/sam_boot.c
index 8c06ca825..cda18efb1 100644
--- a/nuttx/configs/sam4s-xplained-pro/src/sam_boot.c
+++ b/nuttx/configs/sam4s-xplained-pro/src/sam_boot.c
@@ -92,9 +92,16 @@ void sam_boardinitialize(void)
void board_initialize(void)
{
#if (defined(CONFIG_SAM34_WDT) && !defined(CONFIG_WDT_DISABLE_ON_RESET))
- /* Enable watchdog timer kicker kernel thread. */
+ /* Configure watchdog timer and enable kicker kernel thread. */
DEBUGASSERT(up_wdginitialize() >= 0);
#endif
+
+#ifdef CONFIG_TIMER
+ /* Registers the timers and starts any async processes (which may include the scheduler) */
+
+ sam_timerinitialize();
+#endif
+
}
#endif /* CONFIG_BOARD_INITIALIZE */
diff --git a/nuttx/configs/sam4s-xplained-pro/src/sam_nsh.c b/nuttx/configs/sam4s-xplained-pro/src/sam_nsh.c
index bbca0dd81..cc7a66c37 100644
--- a/nuttx/configs/sam4s-xplained-pro/src/sam_nsh.c
+++ b/nuttx/configs/sam4s-xplained-pro/src/sam_nsh.c
@@ -151,12 +151,6 @@ int nsh_archinitialize(void)
}
#endif
-#ifdef CONFIG_TIMER
- /* Registers the timer driver and starts an async interrupt. */
-
- sam_timerinitialize();
-#endif
-
#ifdef HAVE_USBMONITOR
/* Start the USB Monitor */