有哪位大佬知道 看门狗不起作用
#include <Ticker.h>#include <WiFi.h>
Ticker secondTick;
int watchdogCount = 0;
void ISRwatchdog(){
watchdogCount++;
if (watchdogCount == 5){
Serial.println();
Serial.println("the wachdog biter!!!!!!!");
ESP.restart();
}
}
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
secondTick.attach(1, ISRwatchdog);
WiFi.mode(WIFI_STA);
WiFi.disconnect();
}
void loop() {
// put your main code here, to run repeatedly:
Serial.printf("Watchdog counter= %d\n", watchdogCount);
delay(1000);
}
WiFi.mode(WIFI_STA);加入这行之后看门狗就不会自动重启了那位大佬知道 这是什么问题 端口打印一直是 Watchdog counter=5
去掉这行之后 就会自动重启了
页:
[1]