document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  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. }
');