diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2010-03-28 08:04:45 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2010-03-28 08:04:45 +0000 |
commit | 347b801809d0c9c30c046d3a60277d05b1c8d86c (patch) | |
tree | 0a6f90a4cb0a67772ecb2b7c19743dd35125a8f0 /os/hal/platforms/STM32/hal_lld.c | |
parent | 193bbcc9dd5305cb40057cfb7731006ac3600e35 (diff) | |
download | ChibiOS-347b801809d0c9c30c046d3a60277d05b1c8d86c.tar.gz ChibiOS-347b801809d0c9c30c046d3a60277d05b1c8d86c.tar.bz2 ChibiOS-347b801809d0c9c30c046d3a60277d05b1c8d86c.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1797 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms/STM32/hal_lld.c')
-rw-r--r-- | os/hal/platforms/STM32/hal_lld.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/os/hal/platforms/STM32/hal_lld.c b/os/hal/platforms/STM32/hal_lld.c index 59e4fee58..c98de5104 100644 --- a/os/hal/platforms/STM32/hal_lld.c +++ b/os/hal/platforms/STM32/hal_lld.c @@ -74,15 +74,18 @@ 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;
+ SCB->AIRCR = (0x05FA << SCB_AIRCR_VECTKEY_Pos) |
+ (3 << SCB_AIRCR_PRIGROUP_Pos);
NVICSetSystemHandlerPriority(HANDLER_SVCALL, CORTEX_PRIORITY_SVCALL);
NVICSetSystemHandlerPriority(HANDLER_SYSTICK, CORTEX_PRIORITY_SYSTICK);
NVICSetSystemHandlerPriority(HANDLER_PENDSV, CORTEX_PRIORITY_PENDSV);
- /* Systick initialization.*/
- SysTick->LOAD = SYSCLK / (8000000 / CH_FREQUENCY) - 1;
+ /* Systick initialization using the system clock.*/
+ SysTick->LOAD = SYSCLK / CH_FREQUENCY - 1;
SysTick->VAL = 0;
- SysTick->CTRL = SysTick_CTRL_ENABLE | SysTick_CTRL_TICKINT;
+ SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
+ SysTick_CTRL_ENABLE_Msk |
+ SysTick_CTRL_TICKINT_Msk;
#if CH_HAL_USE_ADC || CH_HAL_USE_SPI
dmaInit();
|