From 5910cc2e269cac13275d198434d34be210eb3d9d Mon Sep 17 00:00:00 2001 From: Alex Samorukov Date: Wed, 10 Dec 2025 13:23:23 +0100 Subject: [PATCH 1/2] Use PSRAM to reduce heap usage percentage on ESP32 with PSRAM (#8891) * Use PSRAM for malloc > 256bytes to get more heap memory * Use dynamic allocator on boards with PSRAM to free more heap * Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Move heap_caps_malloc_extmem_enable() to the top of the init * Update src/main.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Ben Meadors Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/main.cpp | 5 +++++ src/mesh/Router.cpp | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index f8d89e1ba..eb6dea327 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -439,6 +439,11 @@ void setup() LOG_INFO("\n\n//\\ E S H T /\\ S T / C\n"); +#if defined(ARCH_ESP32) && defined(BOARD_HAS_PSRAM) + // use PSRAM for malloc calls > 256 bytes + heap_caps_malloc_extmem_enable(256); +#endif + #if defined(DEBUG_MUTE) && defined(DEBUG_PORT) DEBUG_PORT.printf("\r\n\r\n//\\ E S H T /\\ S T / C\r\n"); DEBUG_PORT.printf("Version %s for %s from %s\r\n", optstr(APP_VERSION), optstr(APP_ENV), optstr(APP_REPO)); diff --git a/src/mesh/Router.cpp b/src/mesh/Router.cpp index 05f47d7f4..54a34fd35 100644 --- a/src/mesh/Router.cpp +++ b/src/mesh/Router.cpp @@ -37,8 +37,8 @@ static MemoryDynamic dynamicPool; Allocator &packetPool = dynamicPool; -#elif defined(ARCH_STM32WL) -// On STM32 there isn't enough heap left over for the rest of the firmware if we allocate this statically. +#elif defined(ARCH_STM32WL) || defined(BOARD_HAS_PSRAM) +// On STM32 and boards with PSRAM, there isn't enough heap left over for the rest of the firmware if we allocate this statically. // For now, make it dynamic again. #define MAX_PACKETS \ (MAX_RX_TOPHONE + MAX_RX_FROMRADIO + 2 * MAX_TX_QUEUE + \ From 2032ff1c32cf222c3d2a41d9b041f13c7fe71c6d Mon Sep 17 00:00:00 2001 From: Jason P Date: Wed, 10 Dec 2025 11:09:37 -0600 Subject: [PATCH 2/2] Create new screen colors for BaseUI (#8921) * Create new colors for BaseUI * Update Ice color --- src/graphics/draw/MenuHandler.cpp | 37 ++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/src/graphics/draw/MenuHandler.cpp b/src/graphics/draw/MenuHandler.cpp index f782dabb6..2a7f479b4 100644 --- a/src/graphics/draw/MenuHandler.cpp +++ b/src/graphics/draw/MenuHandler.cpp @@ -1041,12 +1041,13 @@ void menuHandler::switchToMUIMenu() void menuHandler::TFTColorPickerMenu(OLEDDisplay *display) { - static const char *optionsArray[] = {"Back", "Default", "Meshtastic Green", "Yellow", "Red", "Orange", "Purple", "Teal", - "Pink", "White"}; + static const char *optionsArray[] = { + "Back", "Default", "Meshtastic Green", "Yellow", "Red", "Orange", "Purple", "Blue", "Teal", "Cyan", "Ice", "Pink", + "White", "Gray"}; BannerOverlayOptions bannerOptions; bannerOptions.message = "Select Screen Color"; bannerOptions.optionsArrayPtr = optionsArray; - bannerOptions.optionsCount = 10; + bannerOptions.optionsCount = 14; bannerOptions.bannerCallback = [display](int selected) -> void { #if defined(HELTEC_MESH_NODE_T114) || defined(HELTEC_VISION_MASTER_T190) || defined(T_DECK) || defined(T_LORA_PAGER) || \ HAS_TFT || defined(HACKADAY_COMMUNICATOR) @@ -1082,20 +1083,40 @@ void menuHandler::TFTColorPickerMenu(OLEDDisplay *display) TFT_MESH_g = 153; TFT_MESH_b = 255; } else if (selected == 7) { - LOG_INFO("Setting color to Teal"); - TFT_MESH_r = 64; - TFT_MESH_g = 224; - TFT_MESH_b = 208; + LOG_INFO("Setting color to Blue"); + TFT_MESH_r = 0; + TFT_MESH_g = 0; + TFT_MESH_b = 255; } else if (selected == 8) { + LOG_INFO("Setting color to Teal"); + TFT_MESH_r = 16; + TFT_MESH_g = 102; + TFT_MESH_b = 102; + } else if (selected == 9) { + LOG_INFO("Setting color to Cyan"); + TFT_MESH_r = 0; + TFT_MESH_g = 255; + TFT_MESH_b = 255; + } else if (selected == 10) { + LOG_INFO("Setting color to Ice"); + TFT_MESH_r = 173; + TFT_MESH_g = 216; + TFT_MESH_b = 230; + } else if (selected == 11) { LOG_INFO("Setting color to Pink"); TFT_MESH_r = 255; TFT_MESH_g = 105; TFT_MESH_b = 180; - } else if (selected == 9) { + } else if (selected == 12) { LOG_INFO("Setting color to White"); TFT_MESH_r = 255; TFT_MESH_g = 255; TFT_MESH_b = 255; + } else if (selected == 13) { + LOG_INFO("Setting color to Gray"); + TFT_MESH_r = 128; + TFT_MESH_g = 128; + TFT_MESH_b = 128; } else { menuQueue = system_base_menu; screen->runNow();