Пример #1
0
void DMA1_Stream7_IRQHandler() {
	DMA1 ->HIFCR |= DMA_HIFCR_CTCIF7; // Clear interrupt flag.

	if (NextBufferSamples) {
		StartAudioDMAAndRequestBuffers();
	} else {
		DMARunning = false;
	}
}
Пример #2
0
bool ProvideAudioBufferWithoutBlocking(void *samples,int numsamples)
{
	if(NextBufferSamples) return false;

	DisableInterrupt(DMA1_Stream7_IRQn);

	NextBufferSamples=samples;
	NextBufferLength=numsamples;

	if(!DMARunning) StartAudioDMAAndRequestBuffers();

	EnableInterrupt(DMA1_Stream7_IRQn);

	return true;
}
Пример #3
0
bool ProvideAudioBufferWithoutBlocking(void *samples, int numsamples) {
	int loop=0;

	if (NextBufferSamples)
		return false;

	NextBufferSamples = samples;
	NextBufferLength  = numsamples;

	 	 ptr = &DAC->DHR12R1;
	 	 ptrSR = &DAC->SR;	//chck for dma underrrun
	     ptrDOR = &DAC->DOR1;

	if (!DMARunning)
		StartAudioDMAAndRequestBuffers();

	return true;
}