Quentin Roche / X_NUCLEO_CCA02M1

Dependencies:   ST_FREQUENCY_DIVIDER ST_I2S USBDEVICE

Fork of X_NUCLEO_CCA02M1 by ST

Files at this revision

API Documentation at this revision

Comitter:
Davidroid
Date:
Tue May 02 12:53:15 2017 +0000
Parent:
13:90465220b75f
Child:
15:17bdadc6aa9c
Commit message:
Supporting mono configurations with the use of the jumper.

Changed in this revision

BSP/XNucleoCCA02M1.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/BSP/XNucleoCCA02M1.cpp	Fri Apr 28 15:42:58 2017 +0000
+++ b/BSP/XNucleoCCA02M1.cpp	Tue May 02 12:53:15 2017 +0000
@@ -113,9 +113,16 @@
     /* Allocating support buffers. */
     _PDM_buffer_one_ms = (uint16_t *) calloc(_PDM_samples_one_ms, sizeof(uint16_t));
 
-    /* Starting the I2S frequency divider. */
-    FrequencyDivider *divider = new FrequencyDivider();
-    divider->start();
+    /*
+     * Starting the I2S frequency divider.
+     * Note: put a jumper to connect PB_5 and PB_13 on the MORPHO connector when
+     *       running a mono configuration.
+     */
+    if (_channels >= 2)
+    {
+	    FrequencyDivider *divider = new FrequencyDivider();
+	    divider->start();
+    }
 
     /* Initializing the PDM to PCM conversion library. */
     if ((_pdm2pcm = new PDM2PCMAudio(_frequency, _channels)) == NULL)