summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBe <be.0@gmx.com>2025-04-14 02:29:19 -0500
committerBe <be.0@gmx.com>2025-04-14 02:29:19 -0500
commit6e13e2ac6ed10bdd275b47853fb6d1b4b63b4549 (patch)
treecdd78ae55ab4324949d079dcf77fca4244bcd77b
parentff811ba810eadbed447acdbf6d5291164d75cd9d (diff)
downloadtangara-fw-6e13e2ac6ed10bdd275b47853fb6d1b4b63b4549.tar.gz
move some task stacks to external RAM
To free up some internal RAM space
-rw-r--r--src/tasks/tasks.cpp8
1 files changed, 4 insertions, 4 deletions
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<StackType_t>;
template <>
auto AllocateStack<Type::kAudioDecoder>() -> std::span<StackType_t> {
constexpr std::size_t size = 20 * 1024;
- static StackType_t sStack[size];
- return {sStack, size};
+ return {static_cast<StackType_t*>(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<Type::kAudioConverter>() -> std::span<StackType_t> {
constexpr std::size_t size = 4 * 1024;
- static StackType_t sStack[size];
- return {sStack, size};
+ return {static_cast<StackType_t*>(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