kopia lustrzana https://github.com/s-marley/ESP32_FFT_VU
Merge pull request #2 from Kineticus/patch-1
Prevent Stuck Loop when micros rolls over after about an hourpull/3/head
commit
ec857d5ba8
|
@ -116,7 +116,7 @@ void loop() {
|
|||
newTime = micros();
|
||||
vReal[i] = analogRead(AUDIO_IN_PIN); // A conversion takes about 9.7uS on an ESP32
|
||||
vImag[i] = 0;
|
||||
while (micros() < (newTime + sampling_period_us)) { /* chill */ }
|
||||
while ((micros() - newTime) < sampling_period_us) { /* chill */ }
|
||||
}
|
||||
|
||||
// Compute FFT
|
||||
|
|
Ładowanie…
Reference in New Issue