Exemplo n.º 1
0
static void receiveSecondAudioADC()
{
	if (!input_buffer.isFull()) 
#if defined(__MK20DX128__) || defined(__MK20DX256__) || defined(TEENSYDUINO)  || defined(TEENSYDUINO) // teensy 3, 3.1
		input_buffer.write(adc->readSingle());
#else
		input_buffer.write(ADC);
#endif
}
Exemplo n.º 2
0
static void receiveSecondAudioADC()
{
	if (!input_buffer.isFull()) 
#if IS_TEENSY3()
		input_buffer.write(adc->readSingle());
#elif IS_STM32()
	input_buffer.write(adc.getData());
#else
		input_buffer.write(ADC);
#endif
}
Exemplo n.º 3
0
void audioHook() // 2us excluding updateAudio()
{
//setPin13High();
#if (USE_AUDIO_INPUT==true)
		if (!input_buffer.isEmpty()) 
			audio_input = input_buffer.read();
#endif

	if (!output_buffer.isFull()) {
		output_buffer.write((unsigned int) (updateAudio() + AUDIO_BIAS));

	}
//setPin13Low();
}
Exemplo n.º 4
0
void audioHook() // 2us excluding updateAudio()
{
//setPin13High();
#if (USE_AUDIO_INPUT==true)
		if (!input_buffer.isEmpty()) 
			audio_input = input_buffer.read();
#endif

	if (!output_buffer.isFull()) {
		#if (STEREO_HACK == true)
		updateAudio(); // in hacked version, this returns void
		output_buffer.write((unsigned int) (audio_out_1 + AUDIO_BIAS));
		output_buffer2.write((unsigned int) (audio_out_2 + AUDIO_BIAS));
		#else
		output_buffer.write((unsigned int) (updateAudio() + AUDIO_BIAS));
		#endif

	}
//setPin13Low();
}