소스 검색

Настроил тактовую частоту

Vladimir N. Shilov 8 년 전
부모
커밋
2ea983c88c
1개의 변경된 파일9개의 추가작업 그리고 1개의 파일을 삭제
  1. 9 1
      src/main.c

+ 9 - 1
src/main.c

@@ -85,6 +85,14 @@ static uint8_t LedPoint = 4;
 
 void main(void)
 {
+  /* Initialization of the clock */
+  /* Clock divider to HSI/1, CPU/1 */
+  CLK->CKDIVR = 0x00;
+
+  /* Disable clock of unused perephireal */
+  /* UART, SPI, I2C*/
+  CLK->PCKENR1 = 0xF0;
+
   /* GPIO configuration ------------------------------------------*/
   GPIO_Config();
 
@@ -170,7 +178,7 @@ static void PrepareForLed(void) {
 static void OutputToLed(void) {
   static uint8_t ledn = 0;
 
-  /* íà ïèíå PD2 äîëæåí áûòü ìåàäð ñ ïåðèîäîì 10 ìñåê. /*
+  /* íà ïèíå PD2 äîëæåí áûòü ìåàäð ñ ïåðèîäîì 10 ìñåê. */
   GPIOD->ODR ^= GPIO_PIN_2;
 
   /* all off */