From 93b5ce45b861806bee0f80c41f5350d4e7162fd6 Mon Sep 17 00:00:00 2001 From: Robert Manzke Date: Thu, 26 Dec 2024 19:17:35 +0100 Subject: [PATCH] Fixed task cores and prios --- apps/esp32/main.cpp | 7 ++++--- tbd/tbd_presets/src/ui_task.hpp | 2 +- .../include/tbd/sound_manager/common/pull_audio_worker.hpp | 2 +- .../library/src/plugin_audio_consumer.hpp | 2 +- tbd/tbd_sound_manager/library/src/sound_level_worker.hpp | 2 +- tbd/tbd_system/library/include/tbd/system/task_module.hpp | 4 ++-- 6 files changed, 10 insertions(+), 9 deletions(-) diff --git a/apps/esp32/main.cpp b/apps/esp32/main.cpp index 3b52a198..a0723b1c 100644 --- a/apps/esp32/main.cpp +++ b/apps/esp32/main.cpp @@ -115,11 +115,12 @@ void app_main() { TBD_LOGI("main", "serial api begin"); tbd::api::SerialApi::begin(); #endif - // start the audio processing - TBD_LOGI("main", "SoundProcessorManager::begin"); - tbd::audio::SoundProcessorManager::begin(); TBD_LOGI("main", "favorites init"); tbd::Favorites::init(); + + // start the audio processing + TBD_LOGI("main", "SoundProcessorManager::begin"); + tbd::audio::SoundProcessorManager::begin(); } } \ No newline at end of file diff --git a/tbd/tbd_presets/src/ui_task.hpp b/tbd/tbd_presets/src/ui_task.hpp index 1648ec01..ff9b2dc1 100644 --- a/tbd/tbd_presets/src/ui_task.hpp +++ b/tbd/tbd_presets/src/ui_task.hpp @@ -189,6 +189,6 @@ uint32_t UIWorker::do_work() { return 0; } -system::TaskModule ui_worker("ui_worker"); +system::TaskModule ui_worker("ui_worker"); } \ No newline at end of file diff --git a/tbd/tbd_sound_manager/common/include/tbd/sound_manager/common/pull_audio_worker.hpp b/tbd/tbd_sound_manager/common/include/tbd/sound_manager/common/pull_audio_worker.hpp index 5a529d36..e46d576a 100644 --- a/tbd/tbd_sound_manager/common/include/tbd/sound_manager/common/pull_audio_worker.hpp +++ b/tbd/tbd_sound_manager/common/include/tbd/sound_manager/common/pull_audio_worker.hpp @@ -64,6 +64,6 @@ struct PullAudioFeeder { * */ template -using PullAudioWorker = system::TaskModule, cpu_core>; +using PullAudioWorker = system::TaskModule, cpu_core, 4095, 23>; } diff --git a/tbd/tbd_sound_manager/library/src/plugin_audio_consumer.hpp b/tbd/tbd_sound_manager/library/src/plugin_audio_consumer.hpp index 46acf049..afa77875 100644 --- a/tbd/tbd_sound_manager/library/src/plugin_audio_consumer.hpp +++ b/tbd/tbd_sound_manager/library/src/plugin_audio_consumer.hpp @@ -85,7 +85,7 @@ uint32_t AudioConsumer::consume(float* audio_slice) { InputManager::update(&pd.trig, &pd.cv); TBD_TIMEOUT_ENSURE_OPS_PER_SECOND(timeout, TBD_SAMPLE_RATE / TBD_SAMPLES_PER_CHUNK); - SoundLevel sound_level(sound_level_worker); + SoundLevel sound_level(sound_level_worker); // In peak detection // dc cut input diff --git a/tbd/tbd_sound_manager/library/src/sound_level_worker.hpp b/tbd/tbd_sound_manager/library/src/sound_level_worker.hpp index 782a8314..d0a7ad28 100644 --- a/tbd/tbd_sound_manager/library/src/sound_level_worker.hpp +++ b/tbd/tbd_sound_manager/library/src/sound_level_worker.hpp @@ -87,7 +87,7 @@ struct SoundLevel { bool _warning_set; }; -system::TaskModule +system::TaskModule sound_level_worker("sound_level_worker"); } diff --git a/tbd/tbd_system/library/include/tbd/system/task_module.hpp b/tbd/tbd_system/library/include/tbd/system/task_module.hpp index ab690898..174deb35 100644 --- a/tbd/tbd_system/library/include/tbd/system/task_module.hpp +++ b/tbd/tbd_system/library/include/tbd/system/task_module.hpp @@ -38,7 +38,7 @@ enum class TaskState : uint8_t { }; -template +template struct TaskModule : ModuleT { TaskModule& operator=(const TaskModule&) = delete; @@ -58,7 +58,7 @@ struct TaskModule : ModuleT { return 1; } _desired_state.store(TaskState::running); - _task.begin(&task_main_wrapper, this, core_id, stack_size); + _task.begin(&task_main_wrapper, this, core_id, stack_size, priority); if (!wait) { return 0;