diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-07-23 13:51:02 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-07-23 13:51:02 +0000 |
commit | fa64f08fc1ad45d0984828695697f6abde7e8ffd (patch) | |
tree | 6d7c116760540a13a3e87c2b512dff4618de196f /os/hal | |
parent | 30895b26766443c620dfe5a5aabc90fc8c53c7f8 (diff) | |
download | ChibiOS-fa64f08fc1ad45d0984828695697f6abde7e8ffd.tar.gz ChibiOS-fa64f08fc1ad45d0984828695697f6abde7e8ffd.tar.bz2 ChibiOS-fa64f08fc1ad45d0984828695697f6abde7e8ffd.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6024 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal')
-rw-r--r-- | os/hal/platforms/STM32F30x/hal_lld.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/os/hal/platforms/STM32F30x/hal_lld.c b/os/hal/platforms/STM32F30x/hal_lld.c index 64b691ade..fcfbd4d10 100644 --- a/os/hal/platforms/STM32F30x/hal_lld.c +++ b/os/hal/platforms/STM32F30x/hal_lld.c @@ -103,12 +103,18 @@ void hal_lld_init(void) { rccResetAPB1(0xFFFFFFFF);
rccResetAPB2(0xFFFFFFFF);
+#if CH_CFG_TIMEDELTA == 0
/* SysTick initialization using the system clock.*/
SysTick->LOAD = STM32_HCLK / CH_CFG_FREQUENCY - 1;
SysTick->VAL = 0;
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
SysTick_CTRL_ENABLE_Msk |
SysTick_CTRL_TICKINT_Msk;
+#else
+ rccEnableAPB1(RCC_APB1ENR_TIM2EN, TRUE);
+ nvicEnableVector(28, CORTEX_PRIORITY_MASK(CORTEX_PRIORITY_SYSTICK));
+ TIM2->PSC = STM32_TIMCLK2 / CH_CFG_FREQUENCY - 1;
+#endif
/* DWT cycle counter enable.*/
SCS_DEMCR |= SCS_DEMCR_TRCENA;
|