mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2025-12-13 11:02:12 +01:00
Added 5 second wdt #349
This commit is contained in:
parent
2feb420551
commit
d64103f259
10 changed files with 50 additions and 48 deletions
|
|
@ -1,5 +1,6 @@
|
|||
#include <WiFi.h>
|
||||
#include <LittleFS.h>
|
||||
#include <esp_task_wdt.h>
|
||||
#include "ConfigSettings.h"
|
||||
#include "Network.h"
|
||||
#include "Web.h"
|
||||
|
|
@ -36,6 +37,9 @@ void setup() {
|
|||
net.setup();
|
||||
somfy.begin();
|
||||
//git.checkForUpdate();
|
||||
esp_task_wdt_init(5, true); //enable panic so ESP32 restarts
|
||||
esp_task_wdt_add(NULL); //add current thread to WDT watch
|
||||
|
||||
}
|
||||
|
||||
void loop() {
|
||||
|
|
@ -48,6 +52,7 @@ void loop() {
|
|||
ESP.restart();
|
||||
}
|
||||
uint32_t timing = millis();
|
||||
|
||||
net.loop();
|
||||
if(millis() - timing > 100) Serial.printf("Timing Net: %ldms\n", millis() - timing);
|
||||
timing = millis();
|
||||
|
|
@ -67,6 +72,8 @@ void loop() {
|
|||
net.end();
|
||||
ESP.restart();
|
||||
}
|
||||
esp_task_wdt_reset();
|
||||
|
||||
/*
|
||||
if(heap < oldheap) {
|
||||
Serial.print("Heap: ");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue