整理任务使用的cpu

新增配置:

  CONFIG_TQ_NETWORK_TASK_CORE=0
  CONFIG_TQ_LOCAL_TASK_CORE=1

  网络类任务默认固定到 Core 0:

  cp_ws_wait
  cp_wifi_state
  cp_fortune
  mm_autostart
  mm_watchdog
  mm_ws_ordered
  mm_ws_stop
  lan_http

  本地类任务默认固定到 Core 1:

  cp_model_cmd
  cp_direction
  cp_lcd_render
  cp_task_monitor
  cp_system_event
  cp_key_input
  factory_cli
  mm_local_evt

  已有音频任务保持现有配置:

  CONFIG_MULTIMODAL_AUDIO_TASK_CORE=1
This commit is contained in:
CSBOOK\44744
2026-06-25 13:54:54 +08:00
parent ec2ad4dfc9
commit 56ac1cd5d6
12 changed files with 185 additions and 60 deletions
@@ -30,6 +30,16 @@
#define CONFIG_TQ_SYSTEM_EVENT_TASK_STACK 4096
#endif
#ifndef CONFIG_TQ_LOCAL_TASK_CORE
#define CONFIG_TQ_LOCAL_TASK_CORE 1
#endif
#if CONFIG_TQ_LOCAL_TASK_CORE < 0
#define CONTROL_PLANE_SYSTEM_EVENT_TASK_CORE tskNO_AFFINITY
#else
#define CONTROL_PLANE_SYSTEM_EVENT_TASK_CORE ((BaseType_t)CONFIG_TQ_LOCAL_TASK_CORE)
#endif
static const char *TAG = "cp_system_event";
static QueueHandle_t s_system_event_queue;
@@ -192,12 +202,13 @@ esp_err_t control_plane_start_system_event_task(void)
}
s_stop_requested = false;
BaseType_t created = xTaskCreate(control_plane_system_event_task,
"cp_system_event",
CONFIG_TQ_SYSTEM_EVENT_TASK_STACK,
NULL,
4,
&s_system_event_task);
BaseType_t created = xTaskCreatePinnedToCore(control_plane_system_event_task,
"cp_system_event",
CONFIG_TQ_SYSTEM_EVENT_TASK_STACK,
NULL,
4,
&s_system_event_task,
CONTROL_PLANE_SYSTEM_EVENT_TASK_CORE);
if (created != pdPASS) {
s_system_event_task = NULL;
return ESP_ERR_NO_MEM;