Merge pull request #2 from Kineticus/patch-1

Prevent Stuck Loop when micros rolls over after about an hour
pull/3/head
s-marley 2020-10-07 15:57:52 +01:00 zatwierdzone przez GitHub
commit ec857d5ba8
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -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