/* Starts taking samples using DMA from the microphone.  */
void MIC_start(uint32_t nSamples)
/* Starts taking samples using DMA from the microphone.  */
void MIC_start(uint32_t nSamples)
{
   if( nSamples > sampleBufferLen ) {
      sampleCount = sampleBufferLen;
   }
   else {
      sampleCount = nSamples;
   }
   if( !dmaBusy ) {
      DMADRV_PeripheralMemory( dmadrvChannelId,
                               dmadrvPeripheralSignal_ADC0_SCAN,
                               (void *) sampleBuffer,
                               (void *) &( ADC0 ->SCANDATA ),
                               true,
                               sampleCount,
                               dmadrvDataSize2,
                               dmaCompleteCallback,
                               NULL );
      adcEnable( true );
      dmaBusy = true;
      sampleBufferReady = false;
   }
   return;
}