show in info and use for mqtt: heap_caps_get_free_size, #1622

This commit is contained in:
MichaelDvP
2024-02-26 14:57:59 +01:00
parent e50d4fafb5
commit 3a23dae178
2 changed files with 3 additions and 1 deletions

View File

@@ -607,7 +607,8 @@ bool Mqtt::queue_message(const uint8_t operation, const std::string & topic, con
}
// check free mem
#ifndef EMSESP_STANDALONE
if (ESP.getFreeHeap() < 60 * 1024 || ESP.getMaxAllocHeap() < 40 * 1024) {
// if (ESP.getFreeHeap() < 60 * 1024 || ESP.getMaxAllocHeap() < 40 * 1024) {
if (heap_caps_get_free_size(MALLOC_CAP_8BIT) < 60 * 1024) { // checks free Heap+PSRAM
if (operation == Operation::PUBLISH) {
mqtt_message_id_++;
mqtt_publish_fails_++;