diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-08-07 14:26:04 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-08-07 15:20:12 +1000 |
| commit | a66c3428063017f2233b6b15d5ce6c920d5c9095 (patch) | |
| tree | 98ce11a6ac2fce108a1592b47e0d3690acc0f1a3 /src/tasks | |
| parent | 4118d880c3f20dbd9304a3f50d6d111f194592c8 (diff) | |
| download | tangara-fw-a66c3428063017f2233b6b15d5ce6c920d5c9095.tar.gz | |
Resampling *basically* working? Just cleanup and buffering issues
Diffstat (limited to 'src/tasks')
| -rw-r--r-- | src/tasks/tasks.hpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/tasks/tasks.hpp b/src/tasks/tasks.hpp index 1321aab8..fe65ffcc 100644 --- a/src/tasks/tasks.hpp +++ b/src/tasks/tasks.hpp @@ -59,9 +59,18 @@ template <Type t> auto StartPersistent(const std::function<void(void)>& fn) -> void { StaticTask_t* task_buffer = new StaticTask_t; cpp::span<StackType_t> stack = AllocateStack<t>(); + xTaskCreateStatic(&PersistentMain, Name<t>().c_str(), + stack.size(), new std::function<void(void)>(fn), + Priority<t>(), stack.data(), task_buffer); +} + +template <Type t> +auto StartPersistent(BaseType_t core, const std::function<void(void)>& fn) -> void { + StaticTask_t* task_buffer = new StaticTask_t; + cpp::span<StackType_t> stack = AllocateStack<t>(); xTaskCreateStaticPinnedToCore(&PersistentMain, Name<t>().c_str(), stack.size(), new std::function<void(void)>(fn), - Priority<t>(), stack.data(), task_buffer, 0); + Priority<t>(), stack.data(), task_buffer, core); } class Worker { |
