Il y avait des problèmes dans la libraire...
Dependencies: ST_FREQUENCY_DIVIDER ST_I2S USBDEVICE
Fork of X_NUCLEO_CCA02M1 by
Diff: BSP/XNucleoCCA02M1.cpp
- Revision:
- 11:b2f7f79026e4
- Parent:
- 9:4c3d94b67a6b
- Child:
- 14:377677cca2e9
diff -r 4c3d94b67a6b -r b2f7f79026e4 BSP/XNucleoCCA02M1.cpp --- a/BSP/XNucleoCCA02M1.cpp Thu Apr 27 17:05:38 2017 +0200 +++ b/BSP/XNucleoCCA02M1.cpp Fri Apr 28 17:22:13 2017 +0200 @@ -80,8 +80,10 @@ #ifdef USE_OPEN_PDM2PCM_LIBRARY /* Checking input parameters. */ - if (!((_frequency == 16000) && (_channels == 2))) - error("\r\nConfiguration error: Currently only two channels at 16KHz are supported.\n\r"); + if (!(((_frequency == 16000) && (_channels == 1)) || + ((_frequency == 16000) && (_channels == 2)) || + ((_frequency == 32000) && (_channels == 1)))) + error("\r\nConfiguration error: Currently only mono@16KHz, stero@16KHz or mono@32KHz are supported.\n\r"); #endif /* Setting configuration. */ @@ -111,11 +113,9 @@ /* Allocating support buffers. */ _PDM_buffer_one_ms = (uint16_t *) calloc(_PDM_samples_one_ms, sizeof(uint16_t)); - /* Starting the I2S frequency divider, if needed. */ - if (_channels == 2) { - FrequencyDivider *divider = new FrequencyDivider(); - divider->start(); - } + /* Starting the I2S frequency divider. */ + FrequencyDivider *divider = new FrequencyDivider(); + divider->start(); /* Initializing the PDM to PCM conversion library. */ if ((_pdm2pcm = new PDM2PCMAudio(_frequency, _channels)) == NULL)