diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-09-26 21:07:44 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-09-26 21:07:44 +1000 |
| commit | 252f685ef1502016ed00be4eeaa4a217386fbce0 (patch) | |
| tree | 9b797795913c61c6b6c9f77e79e4a62419883f7b /src/tasks | |
| parent | 96252973d9b142632b7c54f825ce1de2127754bd (diff) | |
| download | tangara-fw-252f685ef1502016ed00be4eeaa4a217386fbce0.tar.gz | |
Make NVS access synchronous again
Everything relevant is back in internal ram, and likely to stay there.
Diffstat (limited to 'src/tasks')
| -rw-r--r-- | src/tasks/tasks.cpp | 22 | ||||
| -rw-r--r-- | src/tasks/tasks.hpp | 3 |
2 files changed, 0 insertions, 25 deletions
diff --git a/src/tasks/tasks.cpp b/src/tasks/tasks.cpp index 689011ea..7bab93f9 100644 --- a/src/tasks/tasks.cpp +++ b/src/tasks/tasks.cpp @@ -39,10 +39,6 @@ template <> auto Name<Type::kDatabaseBackground>() -> std::pmr::string { return "db_bg"; } -template <> -auto Name<Type::kNvsWriter>() -> std::pmr::string { - return "nvs"; -} template <Type t> auto AllocateStack() -> cpp::span<StackType_t>; @@ -86,12 +82,6 @@ auto AllocateStack<Type::kDatabaseBackground>() -> cpp::span<StackType_t> { return {static_cast<StackType_t*>(heap_caps_malloc(size, MALLOC_CAP_SPIRAM)), size}; } -template <> -auto AllocateStack<Type::kNvsWriter>() -> cpp::span<StackType_t> { - constexpr std::size_t size = 4 * 1024; - static StackType_t sStack[size]; - return {sStack, size}; -} // 2 KiB in internal ram // 612 KiB in external ram. @@ -132,13 +122,6 @@ template <> auto Priority<Type::kDatabaseBackground>() -> UBaseType_t { return 1; } -// NVS writing requires suspending one of our cores, and disabling tasks with -// their stacks in PSRAM. Only do it when there's not more important work -// pending. -template <> -auto Priority<Type::kNvsWriter>() -> UBaseType_t { - return 2; -} template <Type t> auto WorkerQueueSize() -> std::size_t; @@ -152,11 +135,6 @@ auto WorkerQueueSize<Type::kDatabaseBackground>() -> std::size_t { return 8; } -template <> -auto WorkerQueueSize<Type::kNvsWriter>() -> std::size_t { - return 2; -} - auto PersistentMain(void* fn) -> void { auto* function = reinterpret_cast<std::function<void(void)>*>(fn); std::invoke(*function); diff --git a/src/tasks/tasks.hpp b/src/tasks/tasks.hpp index b87c7fa2..1b6a108f 100644 --- a/src/tasks/tasks.hpp +++ b/src/tasks/tasks.hpp @@ -39,9 +39,6 @@ enum class Type { kDatabase, // Task for internal database operations kDatabaseBackground, - // Task for interacting with NVS -- this needs to be done with an internal - // stack. - kNvsWriter, }; template <Type t> |
