mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-09 20:41:14 +00:00
feat(freertos): Introduced new Kconfig option CONFIG_FREERTOS_NUMBER_OF_CORES
This commit replaces the use of portNUM_PROCESSORS and configNUM_CORES macros in all of ESP-IDF. These macros are needed to realize an SMP scenario by fetching the number of active cores FreeRTOS is running on. Instead, a new Kconfig option, CONFIG_FREERTOS_NUMBER_OF_CORES, has been added as a proxy for the FreeRTOS config option, configNUMBER_OF_CORES. This new commit is now used to realize an SMP scenario in various places in ESP-IDF. [Sudeep Mohanty: Added new Kconfig option CONFIG_FREERTOS_NUMBER_OF_CORES] Signed-off-by: Sudeep Mohanty <sudeep.mohanty@espressif.com>
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <vector>
|
||||
#include <numeric>
|
||||
#include "sdkconfig.h"
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
#include "freertos/semphr.h"
|
||||
@@ -105,7 +106,7 @@ TEST_CASE("static initialization guards work as expected", "[misc]")
|
||||
int task_count = 0;
|
||||
// four tasks competing for static initialization of one object
|
||||
task_count += start_slow_init_task<1>(0, PRO_CPU_NUM);
|
||||
#if portNUM_PROCESSORS == 2
|
||||
#if CONFIG_FREERTOS_NUMBER_OF_CORES == 2
|
||||
task_count += start_slow_init_task<1>(1, APP_CPU_NUM);
|
||||
#endif
|
||||
task_count += start_slow_init_task<1>(2, PRO_CPU_NUM);
|
||||
@@ -113,7 +114,7 @@ TEST_CASE("static initialization guards work as expected", "[misc]")
|
||||
|
||||
// four tasks competing for static initialization of another object
|
||||
task_count += start_slow_init_task<2>(0, PRO_CPU_NUM);
|
||||
#if portNUM_PROCESSORS == 2
|
||||
#if CONFIG_FREERTOS_NUMBER_OF_CORES == 2
|
||||
task_count += start_slow_init_task<2>(1, APP_CPU_NUM);
|
||||
#endif
|
||||
task_count += start_slow_init_task<2>(2, PRO_CPU_NUM);
|
||||
|
Reference in New Issue
Block a user