Ver código fonte

Avoid allocating unneeded DMA channels

dds
PaulStoffregen 10 anos atrás
pai
commit
e8cb4897b0
7 arquivos alterados com 6 adições e 20 exclusões
  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 Ver arquivo

@@ -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"

+ 0
- 14
examples/HardwareTesting/PassThroughMono/PassThroughMono.ino Ver arquivo

@@ -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();
}



+ 1
- 1
input_adc.cpp Ver arquivo

@@ -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)

+ 1
- 1
input_i2s.cpp Ver arquivo

@@ -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)

+ 1
- 1
output_dac.cpp Ver arquivo

@@ -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)
{

+ 1
- 1
output_i2s.cpp Ver arquivo

@@ -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)
{

+ 1
- 1
output_pwm.cpp Ver arquivo

@@ -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

Carregando…
Cancelar
Salvar