Merge branch 'bugfix/freertos_smp_main_task_affinity' into 'master'

freertos: Fix main task affinity in SMP FreeRTOS

See merge request espressif/esp-idf!17787
This commit is contained in:
Darian 2022-04-18 19:14:55 +08:00
commit 2fda413674

View File

@ -228,16 +228,9 @@ void esp_startup_start_app_common(void)
esp_gdbstub_init(); esp_gdbstub_init();
#endif // CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME #endif // CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME
TaskHandle_t main_task_hdl;
portDISABLE_INTERRUPTS();
portBASE_TYPE res = xTaskCreatePinnedToCore(main_task, "main", portBASE_TYPE res = xTaskCreatePinnedToCore(main_task, "main",
ESP_TASK_MAIN_STACK, NULL, ESP_TASK_MAIN_STACK, NULL,
ESP_TASK_MAIN_PRIO, &main_task_hdl, ESP_TASK_MAIN_CORE); ESP_TASK_MAIN_PRIO, NULL, ESP_TASK_MAIN_CORE);
#if ( configUSE_CORE_AFFINITY == 1 && configNUM_CORES > 1 )
//We only need to set affinity when using dual core with affinities supported
vTaskCoreAffinitySet(main_task_hdl, 1 << 1);
#endif
portENABLE_INTERRUPTS();
assert(res == pdTRUE); assert(res == pdTRUE);
(void)res; (void)res;
} }