Increase MAX_NUM_NODES on high-flash ESP32_S3 (#6311)

This commit is contained in:
Austin
2025-03-18 21:19:51 -04:00
committed by GitHub
parent 8efc9702d3
commit 6673cb9292
34 changed files with 155 additions and 79 deletions

View File

@@ -18,10 +18,30 @@
#define MAX_RX_TOPHONE 32
#endif
/// max number of nodes allowed in the mesh
/// max number of nodes allowed in the nodeDB
#ifndef MAX_NUM_NODES
#if defined(ARCH_STM32WL)
#define MAX_NUM_NODES 10
#elif defined(ARCH_NRF52)
#define MAX_NUM_NODES 80
#elif defined(CONFIG_IDF_TARGET_ESP32S3)
#include "Esp.h"
static inline int get_max_num_nodes()
{
uint32_t flash_size = ESP.getFlashChipSize() / (1024 * 1024); // Convert Bytes to MB
if (flash_size >= 15) {
return 250;
} else if (flash_size >= 7) {
return 200;
} else {
return 100;
}
}
#define MAX_NUM_NODES get_max_num_nodes()
#else
#define MAX_NUM_NODES 100
#endif
#endif
/// Max number of channels allowed
#define MAX_NUM_CHANNELS (member_size(meshtastic_ChannelFile, channels) / member_size(meshtastic_ChannelFile, channels[0]))