From 858f03a793f17fa050d5874c02c4fba796a450fb Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Wed, 9 Mar 2022 20:59:04 +0100 Subject: [PATCH] skip call to logAudio when not needed --- wled00/usermod.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wled00/usermod.cpp b/wled00/usermod.cpp index f054e3cb75..22fde5f953 100644 --- a/wled00/usermod.cpp +++ b/wled00/usermod.cpp @@ -83,9 +83,12 @@ void userLoop() { getSample(); // Sample the microphone agcAvg(); // Calculated the PI adjusted value as sampleAvg myVals[millis()%32] = sampleAgc; +#if defined(MIC_LOGGER) || defined(MIC_SAMPLING_LOG) || defined(FFT_SAMPLING_LOG) EVERY_N_MILLIS(20) { logAudio(); } +#endif + } if (audioSyncEnabled & (1 << 0)) { // Only run the transmit code IF we're in Transmit mode //Serial.println("Transmitting UDP Mic Packet");