Bläddra i källkod

Fix AudioInputAnalog

dds
PaulStoffregen 10 år sedan
förälder
incheckning
87b715ad2d
2 ändrade filer med 6 tillägg och 4 borttagningar
  1. +2
    -1
      input_adc.cpp
  2. +4
    -3
      input_adc.h

+ 2
- 1
input_adc.cpp Visa fil

@@ -31,11 +31,12 @@
DMAMEM static uint16_t analog_rx_buffer[AUDIO_BLOCK_SAMPLES];
audio_block_t * AudioInputAnalog::block_left = NULL;
uint16_t AudioInputAnalog::block_offset = 0;
uint16_t AudioInputAnalog::dc_average = 0;
bool AudioInputAnalog::update_responsibility = false;
DMAChannel AudioInputAnalog::dma(false);


AudioInputAnalog::AudioInputAnalog(uint8_t pin) : AudioStream(0, NULL)
void AudioInputAnalog::init(uint8_t pin)
{
uint32_t i, sum=0;


+ 4
- 3
input_adc.h Visa fil

@@ -33,17 +33,18 @@
class AudioInputAnalog : public AudioStream
{
public:
AudioInputAnalog(uint8_t pin);
AudioInputAnalog() : AudioStream(0, NULL) { AudioInputAnalog(A2); }
AudioInputAnalog() : AudioStream(0, NULL) { init(A2); }
AudioInputAnalog(uint8_t pin) : AudioStream(0, NULL) { init(pin); }
virtual void update(void);
friend void dma_ch9_isr(void);
private:
static audio_block_t *block_left;
static uint16_t block_offset;
uint16_t dc_average;
static uint16_t dc_average;
static bool update_responsibility;
static DMAChannel dma;
static void isr(void);
static void init(uint8_t pin);
};

#endif

Laddar…
Avbryt
Spara