Skip to content

Commit

Permalink
Fixed task cores and prios
Browse files Browse the repository at this point in the history
  • Loading branch information
ctag-fh-kiel committed Dec 26, 2024
1 parent de5285e commit 93b5ce4
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
7 changes: 4 additions & 3 deletions apps/esp32/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
2 changes: 1 addition & 1 deletion tbd/tbd_presets/src/ui_task.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,6 @@ uint32_t UIWorker::do_work() {
return 0;
}

system::TaskModule<UIWorker, system::CpuCore::system> ui_worker("ui_worker");
system::TaskModule<UIWorker, system::CpuCore::system, 4095, 3> ui_worker("ui_worker");

}
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ struct PullAudioFeeder {
*
*/
template<AudioConsumerType AudioConsumerT, system::CpuCore cpu_core>
using PullAudioWorker = system::TaskModule<PullAudioFeeder<AudioConsumerT>, cpu_core>;
using PullAudioWorker = system::TaskModule<PullAudioFeeder<AudioConsumerT>, cpu_core, 4095, 23>;

}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tbd/tbd_sound_manager/library/src/sound_level_worker.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ struct SoundLevel {
bool _warning_set;
};

system::TaskModule<SoundLevelWorker, system::CpuCore::audio>
system::TaskModule<SoundLevelWorker, system::CpuCore::system, 4096, 2>
sound_level_worker("sound_level_worker");

}
4 changes: 2 additions & 2 deletions tbd/tbd_system/library/include/tbd/system/task_module.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ enum class TaskState : uint8_t {
};


template<TaskModuleImplType ModuleT, CpuCore core_id, uint32_t stack_size = 4096>
template<TaskModuleImplType ModuleT, CpuCore core_id, uint32_t stack_size = 4096, uint8_t priority = 0>
struct TaskModule : ModuleT {
TaskModule& operator=(const TaskModule&) = delete;

Expand All @@ -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;
Expand Down

0 comments on commit 93b5ce4

Please sign in to comment.