Skip to content

Commit 66a50cd

Browse files
committed
removed debug output and some fixes
1 parent e4fa40b commit 66a50cd

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

usermods/audioreactive/audio_reactive.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,11 @@
6767
#endif
6868

6969
// Analog mic with DMA ADC sampling is only supported on ESP32-S2, ESP32-C3 and ESP32-S3 on IDF >= 4.4.0
70+
#ifdef ARDUINO_ARCH_ESP32
7071
#if !defined(CONFIG_IDF_TARGET_ESP32) && (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 4, 0) && (defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32S3)))
7172
#define AR_DMA_ADC_SAMPLING
7273
#endif
74+
#endif
7375

7476
// Comment/Uncomment to toggle usb serial debugging
7577
// #define MIC_LOGGER // MIC sampling & sound input debugging (serial plotter)

usermods/audioreactive/audio_source.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ class AC101Source : public I2SSource {
947947

948948
};
949949

950-
#if !defined(CONFIG_IDF_TARGET_ESP32) || !defined(AR_DMA_ADC_SAMPLING)
950+
#if !defined(CONFIG_IDF_TARGET_ESP32) && !defined(AR_DMA_ADC_SAMPLING)
951951
#warning this MCU does not support analog sound input on IDF versions < 4.4.0
952952
#endif
953953

@@ -1207,7 +1207,7 @@ class DMAadcSource : public AudioSource {
12071207
}
12081208
_audioPin = audioPin;
12091209
// Determine Analog channel. Only Channels on ADC1 are supported
1210-
int8_t channel = digitalPinToAnalogChannel(_audioPin);
1210+
uint8_t channel = digitalPinToAnalogChannel(_audioPin);
12111211
if (channel > MAX_ADC1_CHANNEL) {
12121212
DEBUGSR_PRINTF("Incompatible GPIO used for analog audio input: %d\n", _audioPin);
12131213
return;
@@ -1223,9 +1223,6 @@ class DMAadcSource : public AudioSource {
12231223
}
12241224

12251225
void getSamples(float *buffer, uint16_t num_samples) {
1226-
1227-
1228-
Serial.println(ESP_IDF_VERSION);
12291226
if (!_initialized) return;
12301227
int32_t framesize = num_samples * ADC_RESULT_BYTE; // size of one sample frame in bytes
12311228
uint8_t result[framesize]; // create a read buffer

0 commit comments

Comments
 (0)