nis

sys_init.c for stm32/example/03-exti-int

nis
Feb 26th, 2012
461
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.58 KB | None | 0 0
  1. /**
  2.  * System init of firmware
  3.  */
  4. #include "stm32f10x.h"
  5. #define CIR_FLAGS RCC_CIR_CSSC | RCC_CIR_PLLRDYC | RCC_CIR_HSERDYC | \
  6. RCC_CIR_HSIRDYC | RCC_CIR_LSERDYC | RCC_CIR_LSIRDYC
  7. /* system init function */
  8. void SystemInit(void) {
  9.     /* enable HSI - hight speed interal clock */
  10.     if ((RCC->CR & RCC_CR_HSION) == 0)
  11.         RCC->CR |= RCC_CR_HSION;
  12.     /* disable all interrupts and clear penging bits */
  13.     RCC->CIR = CIR_FLAGS;
  14.     /* reset CGGR2 register */
  15.     RCC->CFGR2 = 0x0;
  16.     /* disable all interrupts and clear penging bits */
  17.     RCC->CIR = CIR_FLAGS;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment