display优先级调为最低,避免滚动字幕消耗过多CPU

This commit is contained in:
Terrence
2025-03-04 07:33:49 +08:00
parent 5997ff2ac4
commit 1a808962e2
5 changed files with 8 additions and 6 deletions

View File

@@ -353,7 +353,7 @@ void Application::Start() {
Application* app = (Application*)arg; Application* app = (Application*)arg;
app->MainLoop(); app->MainLoop();
vTaskDelete(NULL); vTaskDelete(NULL);
}, "main_loop", 4096 * 2, this, 2, nullptr); }, "main_loop", 4096 * 2, this, 3, nullptr);
/* Wait for the network to be ready */ /* Wait for the network to be ready */
board.StartNetwork(); board.StartNetwork();
@@ -468,7 +468,7 @@ void Application::Start() {
Application* app = (Application*)arg; Application* app = (Application*)arg;
app->CheckNewVersion(); app->CheckNewVersion();
vTaskDelete(NULL); vTaskDelete(NULL);
}, "check_new_version", 4096 * 2, this, 1, nullptr); }, "check_new_version", 4096 * 2, this, 2, nullptr);
#if CONFIG_USE_AUDIO_PROCESSOR #if CONFIG_USE_AUDIO_PROCESSOR
audio_processor_.Initialize(codec->input_channels(), codec->input_reference()); audio_processor_.Initialize(codec->input_channels(), codec->input_reference());

View File

@@ -53,7 +53,7 @@ void AudioProcessor::Initialize(int channels, bool reference) {
auto this_ = (AudioProcessor*)arg; auto this_ = (AudioProcessor*)arg;
this_->AudioProcessorTask(); this_->AudioProcessorTask();
vTaskDelete(NULL); vTaskDelete(NULL);
}, "audio_communication", 4096 * 2, this, 1, NULL); }, "audio_communication", 4096 * 2, this, 2, NULL);
} }
AudioProcessor::~AudioProcessor() { AudioProcessor::~AudioProcessor() {

View File

@@ -88,7 +88,7 @@ void WakeWordDetect::Initialize(int channels, bool reference) {
auto this_ = (WakeWordDetect*)arg; auto this_ = (WakeWordDetect*)arg;
this_->AudioDetectionTask(); this_->AudioDetectionTask();
vTaskDelete(NULL); vTaskDelete(NULL);
}, "audio_detection", 4096 * 2, this, 1, nullptr); }, "audio_detection", 4096 * 2, this, 2, nullptr);
} }
void WakeWordDetect::OnWakeWordDetected(std::function<void(const std::string& wake_word)> callback) { void WakeWordDetect::OnWakeWordDetected(std::function<void(const std::string& wake_word)> callback) {
@@ -202,7 +202,7 @@ void WakeWordDetect::EncodeWakeWordData() {
this_->wake_word_cv_.notify_all(); this_->wake_word_cv_.notify_all();
} }
vTaskDelete(NULL); vTaskDelete(NULL);
}, "encode_detect_packets", 4096 * 8, this, 1, wake_word_encode_task_stack_, &wake_word_encode_task_buffer_); }, "encode_detect_packets", 4096 * 8, this, 2, wake_word_encode_task_stack_, &wake_word_encode_task_buffer_);
} }
bool WakeWordDetect::GetWakeWordOpus(std::vector<uint8_t>& opus) { bool WakeWordDetect::GetWakeWordOpus(std::vector<uint8_t>& opus) {

View File

@@ -1,6 +1,7 @@
#include "background_task.h" #include "background_task.h"
#include <esp_log.h> #include <esp_log.h>
#include <esp_task_wdt.h>
#define TAG "BackgroundTask" #define TAG "BackgroundTask"
@@ -8,7 +9,7 @@ BackgroundTask::BackgroundTask(uint32_t stack_size) {
xTaskCreate([](void* arg) { xTaskCreate([](void* arg) {
BackgroundTask* task = (BackgroundTask*)arg; BackgroundTask* task = (BackgroundTask*)arg;
task->BackgroundTaskLoop(); task->BackgroundTaskLoop();
}, "background_task", stack_size, this, 1, &background_task_handle_); }, "background_task", stack_size, this, 2, &background_task_handle_);
} }
BackgroundTask::~BackgroundTask() { BackgroundTask::~BackgroundTask() {

View File

@@ -20,6 +20,7 @@ Ssd1306Display::Ssd1306Display(void* i2c_master_handle, int width, int height, b
ESP_LOGI(TAG, "Initialize LVGL"); ESP_LOGI(TAG, "Initialize LVGL");
lvgl_port_cfg_t port_cfg = ESP_LVGL_PORT_INIT_CONFIG(); lvgl_port_cfg_t port_cfg = ESP_LVGL_PORT_INIT_CONFIG();
port_cfg.task_priority = 1;
lvgl_port_init(&port_cfg); lvgl_port_init(&port_cfg);
// SSD1306 config // SSD1306 config