Updated system timer logic from Bob Doiron

This commit is contained in:
Gregory Nutt 2014-04-30 14:47:30 -06:00
parent f7485ea962
commit e0a9d3071a
4 changed files with 19 additions and 10 deletions

View File

@ -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

View File

@ -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

View File

@ -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 */

View File

@ -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 */