Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: ST_FREQUENCY_DIVIDER ST_I2S USBDEVICE
Fork of X_NUCLEO_CCA02M1 by
Revision 7:9d6a4a53e640, committed 2017-04-21
- Comitter:
- davide.aliprandi@st.com
- Date:
- Fri Apr 21 19:39:43 2017 +0200
- Parent:
- 6:9b8bc842aeb3
- Child:
- 8:4b5736648043
- Commit message:
- Closed PDM2PCM library removed.
Changed in this revision
| BSP/PDM2PCMAudio.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/BSP/PDM2PCMAudio.cpp Fri Apr 21 19:39:27 2017 +0200
+++ b/BSP/PDM2PCMAudio.cpp Fri Apr 21 19:39:43 2017 +0200
@@ -83,12 +83,13 @@
switch (decimation_factor)
{
case 64:
- for (uint32_t index = 0; index < 1/*_channels*/; index++) {
+ for (uint32_t index = 0; index < _channels; index++) {
#ifdef PDM2PCM_AUDIO_DEBUG
_pdm2pcm_audio_signal = 1;
#endif
#ifdef USE_OPEN_PDM2PCM_LIBRARY
Open_PDM_Filter(&((uint8_t *) input_buffer)[index], (uint16_t *) &(output_buffer[index]), volume, (TPDMFilter_InitStruct *) &_PDM2PCM_filter[index]);
+ index++;
#else
PDM_Filter_64_LSB(&((uint8_t *) input_buffer)[index], (uint16_t *) &(output_buffer[index]), volume, (PDMFilter_InitStruct *) &_PDM2PCM_filter[index]);
#endif
@@ -100,11 +101,18 @@
case 128:
for (uint32_t index = 0; index < _channels; index++) {
+#ifdef PDM2PCM_AUDIO_DEBUG
+ _pdm2pcm_audio_signal = 1;
+#endif
#ifdef USE_OPEN_PDM2PCM_LIBRARY
Open_PDM_Filter(&((uint8_t *) input_buffer)[index], (uint16_t *) &(output_buffer[index]), volume, (TPDMFilter_InitStruct *) &_PDM2PCM_filter[index]);
+ index++;
#else
PDM_Filter_128_LSB(&((uint8_t *) input_buffer)[index], (uint16_t *) &(output_buffer[index]), volume, (PDMFilter_InitStruct *) &_PDM2PCM_filter[index]);
#endif
+#ifdef PDM2PCM_AUDIO_DEBUG
+ _pdm2pcm_audio_signal = 0;
+#endif
}
break;
