| @@ -35,7 +35,7 @@ | |||
| #endif | |||
| #include "DMAChannel.h" | |||
| #ifndef DMACHANNEL_HAS_BEGIN | |||
| #if !defined(DMACHANNEL_HAS_BEGIN) || !defined(DMACHANNEL_HAS_BOOLEAN_CTOR) | |||
| #error "You need to update DMAChannel.h & DMAChannel.cpp" | |||
| #error "https://github.com/PaulStoffregen/cores/blob/master/teensy3/DMAChannel.h" | |||
| #error "https://github.com/PaulStoffregen/cores/blob/master/teensy3/DMAChannel.cpp" | |||
| @@ -22,20 +22,6 @@ void loop() { | |||
| // Do nothing here. The Audio flows automatically | |||
| // When AudioInputAnalog is running, analogRead() must NOT be used. | |||
| delay(200); | |||
| Serial.print("PDB: SC="); | |||
| Serial.print(PDB0_SC, HEX); | |||
| Serial.print(", CONFIG="); | |||
| Serial.print(PDB_CONFIG, HEX); | |||
| Serial.print(", MOD="); | |||
| Serial.print(PDB0_MOD); | |||
| Serial.print(", IDLY="); | |||
| Serial.print(PDB0_IDLY); | |||
| Serial.print(", CH0C1="); | |||
| Serial.print(PDB0_CH0C1); | |||
| Serial.print(", DMA: "); | |||
| Serial.print(dma_channel_allocated_mask, HEX); | |||
| Serial.println(); | |||
| } | |||
| @@ -31,7 +31,7 @@ DMAMEM static uint16_t analog_rx_buffer[AUDIO_BLOCK_SAMPLES]; | |||
| audio_block_t * AudioInputAnalog::block_left = NULL; | |||
| uint16_t AudioInputAnalog::block_offset = 0; | |||
| bool AudioInputAnalog::update_responsibility = false; | |||
| DMAChannel AudioInputAnalog::dma; | |||
| DMAChannel AudioInputAnalog::dma(false); | |||
| AudioInputAnalog::AudioInputAnalog() : AudioStream(0, NULL) | |||
| @@ -32,7 +32,7 @@ audio_block_t * AudioInputI2S::block_left = NULL; | |||
| audio_block_t * AudioInputI2S::block_right = NULL; | |||
| uint16_t AudioInputI2S::block_offset = 0; | |||
| bool AudioInputI2S::update_responsibility = false; | |||
| DMAChannel AudioInputI2S::dma; | |||
| DMAChannel AudioInputI2S::dma(false); | |||
| void AudioInputI2S::begin(void) | |||
| @@ -33,7 +33,7 @@ DMAMEM static uint16_t dac_buffer[AUDIO_BLOCK_SAMPLES*2]; | |||
| audio_block_t * AudioOutputAnalog::block_left_1st = NULL; | |||
| audio_block_t * AudioOutputAnalog::block_left_2nd = NULL; | |||
| bool AudioOutputAnalog::update_responsibility = false; | |||
| DMAChannel AudioOutputAnalog::dma; | |||
| DMAChannel AudioOutputAnalog::dma(false); | |||
| void AudioOutputAnalog::begin(void) | |||
| { | |||
| @@ -34,7 +34,7 @@ uint16_t AudioOutputI2S::block_left_offset = 0; | |||
| uint16_t AudioOutputI2S::block_right_offset = 0; | |||
| bool AudioOutputI2S::update_responsibility = false; | |||
| DMAMEM static uint32_t i2s_tx_buffer[AUDIO_BLOCK_SAMPLES]; | |||
| DMAChannel AudioOutputI2S::dma; | |||
| DMAChannel AudioOutputI2S::dma(false); | |||
| void AudioOutputI2S::begin(void) | |||
| { | |||
| @@ -33,7 +33,7 @@ bool AudioOutputPWM::update_responsibility = false; | |||
| uint8_t AudioOutputPWM::interrupt_count = 0; | |||
| DMAMEM uint32_t pwm_dma_buffer[AUDIO_BLOCK_SAMPLES*2]; | |||
| DMAChannel AudioOutputPWM::dma; | |||
| DMAChannel AudioOutputPWM::dma(false); | |||
| // TODO: this code assumes F_BUS is 48 MHz. | |||
| // supporting other speeds is not easy, but should be done someday | |||