sm1000_main: Enable CRC peripheral.
authorsjlongland <sjlongland@01035d8c-6547-0410-b346-abe4f91aad63>
Sun, 27 Sep 2015 01:07:51 +0000 (01:07 +0000)
committersjlongland <sjlongland@01035d8c-6547-0410-b346-abe4f91aad63>
Sun, 27 Sep 2015 01:07:51 +0000 (01:07 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@2402 01035d8c-6547-0410-b346-abe4f91aad63

codec2-dev/stm32/src/sm1000_main.c

index b8a0c353f3ac703dcb594e9bfd1d8e60f1998e02..076a9b45453406c65cac78b7b3bd929763f6ab11 100644 (file)
@@ -36,6 +36,7 @@
 #include "codec2_fdmdv.h"
 #include "sm1000_leds_switches.h"
 #include <stm32f4xx_gpio.h>
+#include <stm32f4xx_rcc.h>
 #include <stdlib.h>
 
 #include "sfx.h"
@@ -126,8 +127,15 @@ int main(void) {
 
     SysTick_Config(SystemCoreClock/168000); /* 1 kHz SysTick */
     sm1000_leds_switches_init();
+
+    /* Enable CRC clock */
+    RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_CRC, ENABLE);
+
+    /* Set up ADCs/DACs */
     dac_open(4*DAC_BUF_SZ);
     adc_open(4*ADC_BUF_SZ);
+
+    /* Set up FreeDV modem */
     f = freedv_open(FREEDV_MODE_1600);
     n_samples = freedv_get_n_speech_samples(f);
     n_samples_16k = 2*n_samples;