aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-07-23 13:51:02 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-07-23 13:51:02 +0000
commitfa64f08fc1ad45d0984828695697f6abde7e8ffd (patch)
tree6d7c116760540a13a3e87c2b512dff4618de196f /os/hal
parent30895b26766443c620dfe5a5aabc90fc8c53c7f8 (diff)
downloadChibiOS-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.c6
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;