Skip to content

Commit

Permalink
0.8.58
Browse files Browse the repository at this point in the history
* merge PR: Add Watchdog for ESP32 #1367
  • Loading branch information
lumapu committed Jan 17, 2024
1 parent 119cd8c commit 780d690
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 31 deletions.
1 change: 1 addition & 0 deletions src/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* fix view of grid profile #1365
* fix webUI translation #1346
* fix protection mask #1352
* merge PR: Add Watchdog for ESP32 #1367

## 0.8.57 - 2024-01-15
* merge PR: fix immediate clearing of display after sunset #1364
Expand Down
42 changes: 12 additions & 30 deletions src/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

#define WDT_TIMEOUT_SECONDS 8 // Watchdog Timeout 8s

#if !defined(ESP32)
void esp_task_wdt_reset() {}
#endif


//-----------------------------------------------------------------------------
app::app() : ah::Scheduler {} {}
Expand Down Expand Up @@ -38,9 +42,7 @@ void app::setup() {
else
DBGPRINTLN(F("false"));

#if defined(ESP32)
esp_task_wdt_reset();
#endif
esp_task_wdt_reset();

if(mConfig->nrf.enabled) {
mNrfRadio.setup(&mConfig->serial.debug, &mConfig->serial.privacyLog, &mConfig->serial.printWholeTrace, mConfig->nrf.pinIrq, mConfig->nrf.pinCe, mConfig->nrf.pinCs, mConfig->nrf.pinSclk, mConfig->nrf.pinMosi, mConfig->nrf.pinMiso);
Expand All @@ -62,9 +64,7 @@ void app::setup() {
#endif
#endif /* defined(ETHERNET) */

#if defined(ESP32)
esp_task_wdt_reset();
#endif
esp_task_wdt_reset();

mCommunication.setup(&mTimestamp, &mConfig->serial.debug, &mConfig->serial.privacyLog, &mConfig->serial.printWholeTrace, &mConfig->inst.gapMs);
mCommunication.addPayloadListener(std::bind(&app::payloadEventListener, this, std::placeholders::_1, std::placeholders::_2));
Expand All @@ -81,9 +81,7 @@ void app::setup() {
DPRINTLN(DBG_WARN, F("WARNING! your NRF24 module can't be reached, check the wiring"));
}

#if defined(ESP32)
esp_task_wdt_reset();
#endif
esp_task_wdt_reset();

// when WiFi is in client mode, then enable mqtt broker
#if !defined(AP_ONLY)
Expand All @@ -98,19 +96,13 @@ void app::setup() {
#endif
setupLed();

#if defined(ESP32)
esp_task_wdt_reset();
#endif
esp_task_wdt_reset();

mWeb.setup(this, &mSys, mConfig);
mWeb.setProtection(strlen(mConfig->sys.adminPwd) != 0);

mApi.setup(this, &mSys, mWeb.getWebSrvPtr(), mConfig);

#if defined(ESP32)
esp_task_wdt_reset();
#endif

#ifdef ENABLE_SYSLOG
mDbgSyslog.setup(mConfig); // be sure to init after mWeb.setup (webSerial uses also debug callback)
#endif
Expand All @@ -124,20 +116,14 @@ void app::setup() {
#endif
#endif

#if defined(ESP32)
esp_task_wdt_reset();
#endif
esp_task_wdt_reset();

#if defined(ENABLE_HISTORY)
mHistory.setup(this, &mSys, mConfig, &mTimestamp);
#endif /*ENABLE_HISTORY*/

mPubSerial.setup(mConfig, &mSys, &mTimestamp);

#if defined(ESP32)
esp_task_wdt_reset();
#endif

#if !defined(ETHERNET)
//mImprov.setup(this, mConfig->sys.deviceName, mVersion);
#endif
Expand All @@ -149,14 +135,14 @@ void app::setup() {
});
#endif /*ENABLE_SIMULATOR*/


esp_task_wdt_reset();
regularTickers();
}

//-----------------------------------------------------------------------------
void app::loop(void) {
#if defined(ESP32)
esp_task_wdt_reset();
#endif
esp_task_wdt_reset();

if(mConfig->nrf.enabled)
mNrfRadio.loop();
Expand All @@ -165,10 +151,6 @@ void app::loop(void) {
mCmtRadio.loop();
#endif

#if defined(ESP32)
esp_task_wdt_reset();
#endif

ah::Scheduler::loop();
mCommunication.loop();

Expand Down
2 changes: 1 addition & 1 deletion src/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//-------------------------------------
#define VERSION_MAJOR 0
#define VERSION_MINOR 8
#define VERSION_PATCH 57
#define VERSION_PATCH 58

//-------------------------------------
typedef struct {
Expand Down

0 comments on commit 780d690

Please sign in to comment.