소스 검색

Avoid allocating unneeded DMA channels

dds
PaulStoffregen 10 년 전
부모
커밋
e8cb4897b0
7개의 변경된 파일6개의 추가작업 그리고 20개의 파일을 삭제
  1. +1
    -1
      Audio.h
  2. +0
    -14
      examples/HardwareTesting/PassThroughMono/PassThroughMono.ino
  3. +1
    -1
      input_adc.cpp
  4. +1
    -1
      input_i2s.cpp
  5. +1
    -1
      output_dac.cpp
  6. +1
    -1
      output_i2s.cpp
  7. +1
    -1
      output_pwm.cpp

+ 1
- 1
Audio.h 파일 보기

#endif #endif


#include "DMAChannel.h" #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 "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.h"
#error "https://github.com/PaulStoffregen/cores/blob/master/teensy3/DMAChannel.cpp" #error "https://github.com/PaulStoffregen/cores/blob/master/teensy3/DMAChannel.cpp"

+ 0
- 14
examples/HardwareTesting/PassThroughMono/PassThroughMono.ino 파일 보기

// Do nothing here. The Audio flows automatically // Do nothing here. The Audio flows automatically


// When AudioInputAnalog is running, analogRead() must NOT be used. // 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();
} }





+ 1
- 1
input_adc.cpp 파일 보기

audio_block_t * AudioInputAnalog::block_left = NULL; audio_block_t * AudioInputAnalog::block_left = NULL;
uint16_t AudioInputAnalog::block_offset = 0; uint16_t AudioInputAnalog::block_offset = 0;
bool AudioInputAnalog::update_responsibility = false; bool AudioInputAnalog::update_responsibility = false;
DMAChannel AudioInputAnalog::dma;
DMAChannel AudioInputAnalog::dma(false);




AudioInputAnalog::AudioInputAnalog() : AudioStream(0, NULL) AudioInputAnalog::AudioInputAnalog() : AudioStream(0, NULL)

+ 1
- 1
input_i2s.cpp 파일 보기

audio_block_t * AudioInputI2S::block_right = NULL; audio_block_t * AudioInputI2S::block_right = NULL;
uint16_t AudioInputI2S::block_offset = 0; uint16_t AudioInputI2S::block_offset = 0;
bool AudioInputI2S::update_responsibility = false; bool AudioInputI2S::update_responsibility = false;
DMAChannel AudioInputI2S::dma;
DMAChannel AudioInputI2S::dma(false);




void AudioInputI2S::begin(void) void AudioInputI2S::begin(void)

+ 1
- 1
output_dac.cpp 파일 보기

audio_block_t * AudioOutputAnalog::block_left_1st = NULL; audio_block_t * AudioOutputAnalog::block_left_1st = NULL;
audio_block_t * AudioOutputAnalog::block_left_2nd = NULL; audio_block_t * AudioOutputAnalog::block_left_2nd = NULL;
bool AudioOutputAnalog::update_responsibility = false; bool AudioOutputAnalog::update_responsibility = false;
DMAChannel AudioOutputAnalog::dma;
DMAChannel AudioOutputAnalog::dma(false);


void AudioOutputAnalog::begin(void) void AudioOutputAnalog::begin(void)
{ {

+ 1
- 1
output_i2s.cpp 파일 보기

uint16_t AudioOutputI2S::block_right_offset = 0; uint16_t AudioOutputI2S::block_right_offset = 0;
bool AudioOutputI2S::update_responsibility = false; bool AudioOutputI2S::update_responsibility = false;
DMAMEM static uint32_t i2s_tx_buffer[AUDIO_BLOCK_SAMPLES]; DMAMEM static uint32_t i2s_tx_buffer[AUDIO_BLOCK_SAMPLES];
DMAChannel AudioOutputI2S::dma;
DMAChannel AudioOutputI2S::dma(false);


void AudioOutputI2S::begin(void) void AudioOutputI2S::begin(void)
{ {

+ 1
- 1
output_pwm.cpp 파일 보기

uint8_t AudioOutputPWM::interrupt_count = 0; uint8_t AudioOutputPWM::interrupt_count = 0;


DMAMEM uint32_t pwm_dma_buffer[AUDIO_BLOCK_SAMPLES*2]; 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. // TODO: this code assumes F_BUS is 48 MHz.
// supporting other speeds is not easy, but should be done someday // supporting other speeds is not easy, but should be done someday

Loading…
취소
저장