Browse Source

Allow AudioInputAnalog to use different pins

dds
PaulStoffregen 10 years ago
parent
commit
fff6eda8eb
2 changed files with 3 additions and 3 deletions
  1. +1
    -2
      input_adc.cpp
  2. +2
    -1
      input_adc.h

+ 1
- 2
input_adc.cpp View File

DMAChannel AudioInputAnalog::dma(false); DMAChannel AudioInputAnalog::dma(false);




AudioInputAnalog::AudioInputAnalog() : AudioStream(0, NULL)
AudioInputAnalog::AudioInputAnalog(uint8_t pin) : AudioStream(0, NULL)
{ {
unsigned int pin = A2;
uint32_t i, sum=0; uint32_t i, sum=0;


// Configure the ADC and run at least one software-triggered // Configure the ADC and run at least one software-triggered

+ 2
- 1
input_adc.h View File

class AudioInputAnalog : public AudioStream class AudioInputAnalog : public AudioStream
{ {
public: public:
AudioInputAnalog();
AudioInputAnalog(uint8_t pin);
AudioInputAnalog() : AudioStream(0, NULL) { AudioInputAnalog(A2); }
virtual void update(void); virtual void update(void);
friend void dma_ch9_isr(void); friend void dma_ch9_isr(void);
private: private:

Loading…
Cancel
Save