summaryrefslogtreecommitdiff
path: root/src/tasks/tasks.cpp
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2023-07-25 17:42:36 +1000
committerjacqueline <me@jacqueline.id.au>2023-07-25 17:43:12 +1000
commit80d7df910987db5201402fe987124f29f09344f3 (patch)
tree7e8c1e04ab40026087343efee95a771c7839b32f /src/tasks/tasks.cpp
parent7b72e5479ee6d11f76c49f7463ba0e7f4e5165c5 (diff)
downloadtangara-fw-80d7df910987db5201402fe987124f29f09344f3.tar.gz
fuck off
Diffstat (limited to 'src/tasks/tasks.cpp')
-rw-r--r--src/tasks/tasks.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/tasks/tasks.cpp b/src/tasks/tasks.cpp
index 7365813e..abce0bde 100644
--- a/src/tasks/tasks.cpp
+++ b/src/tasks/tasks.cpp
@@ -26,6 +26,10 @@ auto Name<Type::kUiFlush>() -> std::string {
return "DISPLAY";
}
template <>
+auto Name<Type::kFileStreamer>() -> std::string {
+ return "FSTREAMER";
+}
+template <>
auto Name<Type::kAudio>() -> std::string {
return "AUDIO";
}
@@ -65,6 +69,14 @@ auto AllocateStack<Type::kUiFlush>() -> cpp::span<StackType_t> {
return {static_cast<StackType_t*>(heap_caps_malloc(size, MALLOC_CAP_DEFAULT)),
size};
}
+
+template <>
+auto AllocateStack<Type::kFileStreamer>() -> cpp::span<StackType_t> {
+ std::size_t size = 4 * 1024;
+ return {static_cast<StackType_t*>(heap_caps_malloc(size, MALLOC_CAP_SPIRAM)),
+ size};
+}
+
// Leveldb is designed for non-embedded use cases, where stack space isn't so
// much of a concern. It therefore uses an eye-wateringly large amount of stack.
template <>
@@ -110,6 +122,11 @@ template <>
auto Priority<Type::kUiFlush>() -> UBaseType_t {
return 9;
}
+
+template <>
+auto Priority<Type::kFileStreamer>() -> UBaseType_t {
+ return 10;
+}
// Database interactions are all inherently async already, due to their
// potential for disk access. The user likely won't notice or care about a
// couple of ms extra delay due to scheduling, so give this task the lowest