Skip to content

Commit

Permalink
Fix AudioInputAnalog
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulStoffregen committed Oct 8, 2014
1 parent bf6f8b4 commit 87b715a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion input_adc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
7 changes: 4 additions & 3 deletions input_adc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 87b715a

Please sign in to comment.