From 6e13e2ac6ed10bdd275b47853fb6d1b4b63b4549 Mon Sep 17 00:00:00 2001 From: Be Date: Mon, 14 Apr 2025 02:29:19 -0500 Subject: move some task stacks to external RAM To free up some internal RAM space --- src/tasks/tasks.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/tasks') diff --git a/src/tasks/tasks.cpp b/src/tasks/tasks.cpp index f0b567f2..c85b492b 100644 --- a/src/tasks/tasks.cpp +++ b/src/tasks/tasks.cpp @@ -40,8 +40,8 @@ auto AllocateStack() -> std::span; template <> auto AllocateStack() -> std::span { constexpr std::size_t size = 20 * 1024; - static StackType_t sStack[size]; - return {sStack, size}; + return {static_cast(heap_caps_malloc(size, MALLOC_CAP_SPIRAM)), + size}; } // LVGL requires only a relatively small stack. Lua's stack is allocated // separately. @@ -55,8 +55,8 @@ template <> // PCM conversion and resampling uses a very small amount of stack. auto AllocateStack() -> std::span { constexpr std::size_t size = 4 * 1024; - static StackType_t sStack[size]; - return {sStack, size}; + return {static_cast(heap_caps_malloc(size, MALLOC_CAP_SPIRAM)), + size}; } // Background workers receive huge stacks in PSRAM. This is mostly to faciliate // use of LevelDB from any bg worker; Leveldb is designed for non-embedded use -- cgit v1.2.3