mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2026-04-20 11:02:14 +02:00
Fixed task_wdt: esp_task_wdt_reset(707): task not found
This commit is contained in:
parent
41270fffb8
commit
b2e402e20e
1 changed files with 15 additions and 9 deletions
|
|
@ -5,6 +5,12 @@
|
||||||
#include <ESPmDNS.h>
|
#include <ESPmDNS.h>
|
||||||
#include <esp_task_wdt.h>
|
#include <esp_task_wdt.h>
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
|
|
||||||
|
// Only reset the WDT if the current task is actually subscribed.
|
||||||
|
// setConnected() is called from the WiFi event task which is not registered.
|
||||||
|
static inline void safe_wdt_reset() {
|
||||||
|
if (esp_task_wdt_status(NULL) == ESP_OK) esp_task_wdt_reset();
|
||||||
|
}
|
||||||
#include "ConfigSettings.h"
|
#include "ConfigSettings.h"
|
||||||
#include "ESPNetwork.h"
|
#include "ESPNetwork.h"
|
||||||
#include "Web.h"
|
#include "Web.h"
|
||||||
|
|
@ -230,7 +236,7 @@ void ESPNetwork::emitSockets(uint8_t num) {
|
||||||
this->emitHeap(num);
|
this->emitHeap(num);
|
||||||
}
|
}
|
||||||
void ESPNetwork::setConnected(conn_types_t connType) {
|
void ESPNetwork::setConnected(conn_types_t connType) {
|
||||||
esp_task_wdt_reset();
|
safe_wdt_reset();
|
||||||
this->connType = connType;
|
this->connType = connType;
|
||||||
this->connectTime = millis();
|
this->connectTime = millis();
|
||||||
connectRetries = 0;
|
connectRetries = 0;
|
||||||
|
|
@ -261,7 +267,7 @@ void ESPNetwork::setConnected(conn_types_t connType) {
|
||||||
#endif // CONFIG_IDF_TARGET_ESP32C6
|
#endif // CONFIG_IDF_TARGET_ESP32C6
|
||||||
// NET: Begin this in the startup.
|
// NET: Begin this in the startup.
|
||||||
//sockEmit.begin();
|
//sockEmit.begin();
|
||||||
esp_task_wdt_reset();
|
safe_wdt_reset();
|
||||||
|
|
||||||
if(this->connectAttempts == 1) {
|
if(this->connectAttempts == 1) {
|
||||||
if(this->connType == conn_types_t::wifi) {
|
if(this->connType == conn_types_t::wifi) {
|
||||||
|
|
@ -284,7 +290,7 @@ void ESPNetwork::setConnected(conn_types_t connType) {
|
||||||
settings.IP.dns1 = ETH.dnsIP(0);
|
settings.IP.dns1 = ETH.dnsIP(0);
|
||||||
settings.IP.dns2 = ETH.dnsIP(1);
|
settings.IP.dns2 = ETH.dnsIP(1);
|
||||||
}
|
}
|
||||||
esp_task_wdt_reset();
|
safe_wdt_reset();
|
||||||
JsonSockEvent *json = sockEmit.beginEmit("ethernet");
|
JsonSockEvent *json = sockEmit.beginEmit("ethernet");
|
||||||
json->beginObject();
|
json->beginObject();
|
||||||
json->addElem("connected", this->connected());
|
json->addElem("connected", this->connected());
|
||||||
|
|
@ -292,7 +298,7 @@ void ESPNetwork::setConnected(conn_types_t connType) {
|
||||||
json->addElem("fullduplex", ETH.fullDuplex());
|
json->addElem("fullduplex", ETH.fullDuplex());
|
||||||
json->endObject();
|
json->endObject();
|
||||||
sockEmit.endEmit();
|
sockEmit.endEmit();
|
||||||
esp_task_wdt_reset();
|
safe_wdt_reset();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
@ -326,7 +332,7 @@ void ESPNetwork::setConnected(conn_types_t connType) {
|
||||||
SSDP.setManufacturerURL(0, "https://github.com/rstrouse");
|
SSDP.setManufacturerURL(0, "https://github.com/rstrouse");
|
||||||
SSDP.setURL(0, "/");
|
SSDP.setURL(0, "/");
|
||||||
SSDP.setActive(0, true);
|
SSDP.setActive(0, true);
|
||||||
esp_task_wdt_reset();
|
safe_wdt_reset();
|
||||||
if(MDNS.begin(settings.hostname)) {
|
if(MDNS.begin(settings.hostname)) {
|
||||||
ESP_LOGI(TAG, "MDNS Responder Started: serverId=%s", settings.serverId);
|
ESP_LOGI(TAG, "MDNS Responder Started: serverId=%s", settings.serverId);
|
||||||
MDNS.addService("http", "tcp", 80);
|
MDNS.addService("http", "tcp", 80);
|
||||||
|
|
@ -339,11 +345,11 @@ void ESPNetwork::setConnected(conn_types_t connType) {
|
||||||
MDNS.addServiceTxt("espsomfy_rts", "tcp", "version", String(settings.fwVersion.name));
|
MDNS.addServiceTxt("espsomfy_rts", "tcp", "version", String(settings.fwVersion.name));
|
||||||
}
|
}
|
||||||
if(settings.ssdpBroadcast) {
|
if(settings.ssdpBroadcast) {
|
||||||
esp_task_wdt_reset();
|
safe_wdt_reset();
|
||||||
SSDP.begin();
|
SSDP.begin();
|
||||||
}
|
}
|
||||||
else if(SSDP.isStarted) SSDP.end();
|
else if(SSDP.isStarted) SSDP.end();
|
||||||
esp_task_wdt_reset();
|
safe_wdt_reset();
|
||||||
this->emitSockets();
|
this->emitSockets();
|
||||||
settings.printAvailHeap();
|
settings.printAvailHeap();
|
||||||
this->needsBroadcast = true;
|
this->needsBroadcast = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue