diff --git a/src/Power.cpp b/src/Power.cpp index 0d95a6ec4..5b379f3c6 100644 --- a/src/Power.cpp +++ b/src/Power.cpp @@ -182,6 +182,9 @@ Power::Power() : OSThread("Power") { statusHandler = {}; low_voltage_counter = 0; +#ifdef DEBUG_HEAP + lastheap = ESP.getFreeHeap(); +#endif } bool Power::analogInit() diff --git a/src/mqtt/MQTT.cpp b/src/mqtt/MQTT.cpp index 428f8ed86..03549f911 100644 --- a/src/mqtt/MQTT.cpp +++ b/src/mqtt/MQTT.cpp @@ -182,7 +182,7 @@ void MQTT::reconnect() sendSubscriptions(); } else { DEBUG_MSG("Failed to contact MQTT server (%d/10)...\n",reconnectCount); -#if HAS_WIFI +#if HAS_WIFI && !defined(ARCH_PORTDUINO) if (reconnectCount > 9) { needReconnect = true; wifiReconnect->setIntervalFromNow(1000); diff --git a/src/power.h b/src/power.h index b7f90ed6d..b370e0248 100644 --- a/src/power.h +++ b/src/power.h @@ -40,7 +40,9 @@ class Power : private concurrency::OSThread private: uint8_t low_voltage_counter; +#ifdef DEBUG_HEAP uint32_t lastheap; +#endif }; extern Power *power;