diff options
| author | cooljqln <cooljqln@noreply.codeberg.org> | 2025-04-19 03:46:38 +0000 |
|---|---|---|
| committer | cooljqln <cooljqln@noreply.codeberg.org> | 2025-04-19 03:46:38 +0000 |
| commit | 79c9f0b6ccfec97f23563010f134d842c4240582 (patch) | |
| tree | 93b4bd208cb5a8e754022dc2299d8be336ca090d /src/tasks/tasks.cpp | |
| parent | 6dd277216d07ffdc3784aae17b07fdc7f6f36cc0 (diff) | |
| parent | 544f5db6e0abab76fa03f6f35613b752dd6f4100 (diff) | |
| download | tangara-fw-79c9f0b6ccfec97f23563010f134d842c4240582.tar.gz | |
Merge pull request 'move some allocations from internal RAM to external RAM' (#330) from Be.ing/tangara-fw:internal_ram into main
Reviewed-on: https://codeberg.org/cool-tech-zone/tangara-fw/pulls/330
Diffstat (limited to 'src/tasks/tasks.cpp')
| -rw-r--r-- | src/tasks/tasks.cpp | 8 |
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 |
