|
|
@ -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 {} {} |
|
|
@ -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); |
|
|
@ -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)); |
|
|
@ -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) |
|
|
@ -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 |
|
|
@ -124,9 +116,7 @@ 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); |
|
|
@ -134,10 +124,6 @@ void app::setup() { |
|
|
|
|
|
|
|
mPubSerial.setup(mConfig, &mSys, &mTimestamp); |
|
|
|
|
|
|
|
#if defined(ESP32) |
|
|
|
esp_task_wdt_reset(); |
|
|
|
#endif |
|
|
|
|
|
|
|
#if !defined(ETHERNET) |
|
|
|
//mImprov.setup(this, mConfig->sys.deviceName, mVersion);
|
|
|
|
#endif |
|
|
@ -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(); |
|
|
@ -165,10 +151,6 @@ void app::loop(void) { |
|
|
|
mCmtRadio.loop(); |
|
|
|
#endif |
|
|
|
|
|
|
|
#if defined(ESP32) |
|
|
|
esp_task_wdt_reset(); |
|
|
|
#endif |
|
|
|
|
|
|
|
ah::Scheduler::loop(); |
|
|
|
mCommunication.loop(); |
|
|
|
|
|
|
|