diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-11-29 21:07:43 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-11-29 21:07:43 +0000 |
commit | 39d171f7ef1cf093a1b1a05650afb0256b7c7ce1 (patch) | |
tree | 9560645d07ac1b232c9533fc8243d0228ffa5c89 /os/hal/platforms/STM32 | |
parent | b21a96e14b7dba7e6d59beb946785c2f7fabc16e (diff) | |
download | ChibiOS-39d171f7ef1cf093a1b1a05650afb0256b7c7ce1.tar.gz ChibiOS-39d171f7ef1cf093a1b1a05650afb0256b7c7ce1.tar.bz2 ChibiOS-39d171f7ef1cf093a1b1a05650afb0256b7c7ce1.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1366 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms/STM32')
-rw-r--r-- | os/hal/platforms/STM32/hal_lld.c | 28 | ||||
-rw-r--r-- | os/hal/platforms/STM32/hal_lld.h | 1 |
2 files changed, 11 insertions, 18 deletions
diff --git a/os/hal/platforms/STM32/hal_lld.c b/os/hal/platforms/STM32/hal_lld.c index 7a096070e..a904cf69f 100644 --- a/os/hal/platforms/STM32/hal_lld.c +++ b/os/hal/platforms/STM32/hal_lld.c @@ -72,6 +72,17 @@ const STM32GPIOConfig pal_default_config = */
void hal_lld_init(void) {
+ /* Note: PRIGROUP 4:0 (4:4).*/
+ SCB->AIRCR = AIRCR_VECTKEY | SCB_AIRCR_PRIGROUP_0 | SCB_AIRCR_PRIGROUP_1;
+ NVICSetSystemHandlerPriority(HANDLER_SVCALL, PRIORITY_SVCALL);
+ NVICSetSystemHandlerPriority(HANDLER_SYSTICK, PRIORITY_SYSTICK);
+ NVICSetSystemHandlerPriority(HANDLER_PENDSV, PRIORITY_PENDSV);
+
+ /* Systick initialization.*/
+ SysTick->LOAD = SYSCLK / (8000000 / CH_FREQUENCY) - 1;
+ SysTick->VAL = 0;
+ SysTick->CTRL = SysTick_CTRL_ENABLE | SysTick_CTRL_TICKINT;
+
#if CH_HAL_USE_ADC || CH_HAL_USE_SPI
dmaInit();
#endif
@@ -108,21 +119,4 @@ void stm32_clock_init(void) { ;
}
-/**
- * @brief STM32 NVIC/SCB/SYSTICK initialization.
- * @note All the involved constants come from the file @p board.h.
- */
-void stm32_nvic_init(void) {
-
- /* Note: PRIGROUP 4:0 (4:4).*/
- SCB->AIRCR = AIRCR_VECTKEY | SCB_AIRCR_PRIGROUP_0 | SCB_AIRCR_PRIGROUP_1;
- NVICSetSystemHandlerPriority(HANDLER_SVCALL, PRIORITY_SVCALL);
- NVICSetSystemHandlerPriority(HANDLER_SYSTICK, PRIORITY_SYSTICK);
- NVICSetSystemHandlerPriority(HANDLER_PENDSV, PRIORITY_PENDSV);
-
- SysTick->LOAD = SYSCLK / (8000000 / CH_FREQUENCY) - 1;
- SysTick->VAL = 0;
- SysTick->CTRL = SysTick_CTRL_ENABLE | SysTick_CTRL_TICKINT;
-}
-
/** @} */
diff --git a/os/hal/platforms/STM32/hal_lld.h b/os/hal/platforms/STM32/hal_lld.h index 455a65b32..b0bba29d5 100644 --- a/os/hal/platforms/STM32/hal_lld.h +++ b/os/hal/platforms/STM32/hal_lld.h @@ -61,7 +61,6 @@ extern "C" { #endif
void hal_lld_init(void);
void stm32_clock_init(void);
- void stm32_nvic_init(void);
#ifdef __cplusplus
}
#endif
|