I have troubles with a mysterious delay on ESP32s. It makes my project work incorrectly.
For example, to exclude another reason, I show it on empty project.
This is the code:
loop() {
Serial.print("moment1: ");
Serial.println(micros() - processTime);
processTime = micros();
Serial.print("moment2: ");
Serial.println(micros() - processTime);
processTime = micros();
Serial.print("last moment:");
Serial.println(micros() - processTime);
processTime = micros();
Serial.println();
}
In the output, I see anything like:
moment1: 42
moment2: 19
last moment: 10233
moment1: 43
moment2: 19
last moment: 21
moment1: 42
moment2: 10197
last moment: 20
Does anybody know where from this delay for > 10000 micro seconds comes from? And how to get rid of it?
This delay distorts the work of the project. And in this project wifi or BT are not used
I was trying to use
noInterrupts();
//code;
interrupts();
but esp going to reboot