Fix missing IFNDEF and IFDEF in main-esp32.cpp when EXCLUDE_WIFI is defined.

Moved IFDEF HAS_NETWORK to beginning of MQTT:runOnce (to catch when EXCLUDE_WIFI is defined)
This commit is contained in:
Talie5in
2024-06-06 22:52:11 +09:30
parent 1f9f885aca
commit a5c96a29d5
2 changed files with 128 additions and 122 deletions

View File

@@ -396,6 +396,7 @@ bool MQTT::wantsLink() const
int32_t MQTT::runOnce()
{
#ifdef HAS_NETWORKING
if (!moduleConfig.mqtt.enabled || !(moduleConfig.mqtt.map_reporting_enabled || channels.anyMqttEnabled()))
return disable();
@@ -408,7 +409,7 @@ int32_t MQTT::runOnce()
publishQueuedMessages();
return 200;
}
#ifdef HAS_NETWORKING
else if (!pubSub.loop()) {
if (!wantConnection)
return 5000; // If we don't want connection now, check again in 5 secs