Skip to content

Commit

Permalink
Merge pull request #260 from sensorium/fix/AudioInput
Browse files Browse the repository at this point in the history
Fix/audio input
  • Loading branch information
tomcombriat authored Jun 19, 2024
2 parents 9a83d96 + 181ddbf commit 870282c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions internal/MozziGuts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ uint16_t getAudioInput() { return audio_input; }
CircularBuffer<uint16_t> input_buffer; // fixed size 256
#define audioInputAvailable() (!input_buffer.isEmpty())
#define readAudioInput() (input_buffer.read())
/** NOTE: Triggered at MOZZI_AUDIO_RATE via defaultAudioOutput(). In addition to the AUDIO_INPUT_PIN, at most one reading is taken for mozziAnalogRead(). */
/** NOTE: Triggered at MOZZI_AUDIO_RATE via defaultAudioOutput(). In addition to the MOZZI_AUDIO_INPUT_PIN, at most one reading is taken for mozziAnalogRead(). */
inline void advanceADCStep() {
switch (adc_count) {
case 0:
Expand All @@ -172,7 +172,7 @@ inline void advanceADCStep() {
case 2:
// 3us
analog_readings[channelNumToIndex(current_channel)] = getADCReading();
adcStartConversion(adcPinToChannelNum(AUDIO_INPUT_PIN)); // -> result is ignored, but first thing in the next cycle, a second reading is taken.
adcStartConversion(adcPinToChannelNum(MOZZI_AUDIO_INPUT_PIN)); // -> result is ignored, but first thing in the next cycle, a second reading is taken.
break;

}
Expand Down
2 changes: 1 addition & 1 deletion internal/config_checks_generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ MOZZI_CHECK_POW2(MOZZI_CONTROL_RATE)
#error "MOZZI_AUDIO_INPUT depends on MOZZI_ANALOG_READ option"
#endif

#if !MOZZI_IS(MOZZI_AUDIO_INPUT, MOZZI_AUDIO_INPUT_NONE) && defined(MOZZI_AUDIO_INPUT_PIN)
#if MOZZI_IS(MOZZI_AUDIO_INPUT, MOZZI_AUDIO_INPUT_NONE) && defined(MOZZI_AUDIO_INPUT_PIN)
#warning "MOZZI_AUDIO_INPUT_PIN defined without MOZZI_AUDIO_INPUT"
#endif

Expand Down

0 comments on commit 870282c

Please sign in to comment.