最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Mysterious delay on ESP32s - Stack Overflow

programmeradmin5浏览0评论

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

发布评论

评论列表(0)

  1. 暂无评论