fix standalone build

This commit is contained in:
Proddy
2023-09-02 11:12:52 +02:00
parent 81842e544b
commit fb44e020fc

View File

@@ -592,7 +592,8 @@ bool Mqtt::queue_message(const uint8_t operation, const std::string & topic, con
if (!mqtt_enabled_ || topic.empty()) { if (!mqtt_enabled_ || topic.empty()) {
return false; // quit, not using MQTT return false; // quit, not using MQTT
} }
// check free mem // check free mem
#ifndef EMSESP_STANDALONE
if (ESP.getFreeHeap() < 60 * 1204) { if (ESP.getFreeHeap() < 60 * 1204) {
if (operation == Operation::PUBLISH) { if (operation == Operation::PUBLISH) {
mqtt_message_id_++; mqtt_message_id_++;
@@ -601,6 +602,7 @@ bool Mqtt::queue_message(const uint8_t operation, const std::string & topic, con
LOG_DEBUG("%s failed: low memory", operation == Operation::PUBLISH ? "Publish" : operation == Operation::SUBSCRIBE ? "Subscribe" : "Unsubscribe"); LOG_DEBUG("%s failed: low memory", operation == Operation::PUBLISH ? "Publish" : operation == Operation::SUBSCRIBE ? "Subscribe" : "Unsubscribe");
return false; // quit return false; // quit
} }
#endif
uint16_t packet_id = 0; uint16_t packet_id = 0;
char fulltopic[MQTT_TOPIC_MAX_SIZE]; char fulltopic[MQTT_TOPIC_MAX_SIZE];