From b24bd50f1107879df83d772517a81ae0a9340463 Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Thu, 29 Feb 2024 18:20:15 +0100 Subject: [PATCH] raise task priority and make it configurable --- src/SnapConfig.h | 4 ++++ src/api/SnapProcessorRTOS.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/SnapConfig.h b/src/SnapConfig.h index 0147708..bf6d67e 100644 --- a/src/SnapConfig.h +++ b/src/SnapConfig.h @@ -63,3 +63,7 @@ #ifndef RTOS_STACK_SIZE # define RTOS_STACK_SIZE 10 * 1024 #endif + +#ifndef RTOS_TASK_PRIORITY +# define RTOS_TASK_PRIORITY 2 +#endif \ No newline at end of file diff --git a/src/api/SnapProcessorRTOS.h b/src/api/SnapProcessorRTOS.h index bc268f0..6169709 100644 --- a/src/api/SnapProcessorRTOS.h +++ b/src/api/SnapProcessorRTOS.h @@ -41,7 +41,7 @@ class SnapProcessorRTOS : public SnapProcessor { protected: const char *TAG = "SnapProcessorRTOS"; - cpp_freertos::Task task{"output", RTOS_STACK_SIZE, 1, task_copy}; + cpp_freertos::Task task{"output", RTOS_STACK_SIZE, RTOS_TASK_PRIORITY, task_copy}; cpp_freertos::Queue size_queue{RTOS_MAX_QUEUE_ENTRY_COUNT, sizeof(size_t)}; audio_tools::SynchronizedBufferRTOS buffer{0}; // size defined in constructor bool task_started = false;