]> granicus.if.org Git - esp-idf/commitdiff
esp32: support to create wifi task on any core
authorLiu Zhi Fu <liuzhifu@espressif.com>
Thu, 3 May 2018 09:02:44 +0000 (17:02 +0800)
committerLiu Zhi Fu <liuzhifu@espressif.com>
Thu, 17 May 2018 14:04:08 +0000 (22:04 +0800)
Support to create WiFi task on any core.
Closes https://github.com/espressif/esp-idf/issues/968

components/esp32/Kconfig
components/esp32/include/esp_wifi.h
components/esp32/lib

index b12c4ae5c48b1341480ffc522280230d5d9fbe76..7ef096a2cde2f7d186413fcd4a5d8c780791060e 100644 (file)
@@ -997,6 +997,19 @@ config ESP32_WIFI_NVS_ENABLED
     help
         Select this option to enable WiFi NVS flash
 
+choice ESP32_WIFI_TASK_CORE_ID
+    depends on !FREERTOS_UNICORE
+    prompt "WiFi Task Core ID"
+    default ESP32_WIFI_TASK_PINNED_TO_CORE_0
+    help
+        Pinned WiFi task to core 0 or core 1.
+
+config ESP32_WIFI_TASK_PINNED_TO_CORE_0
+    bool "Core 0"
+config ESP32_WIFI_TASK_PINNED_TO_CORE_1
+    bool "Core 1"
+endchoice
+
 endmenu  # Wi-Fi
 
 menu PHY
index 77ee218279294f6d194c212560340e61a2916726..f3333eebd901e7c8cab274e3376829787d7cd8ab 100755 (executable)
@@ -105,6 +105,7 @@ typedef struct {
     int                    nano_enable;            /**< Nano option for printf/scan family enable flag */
     int                    tx_ba_win;              /**< WiFi Block Ack TX window size */
     int                    rx_ba_win;              /**< WiFi Block Ack RX window size */
+    int                    wifi_task_core_id;      /**< WiFi Task Core ID */
     int                    magic;                  /**< WiFi init magic number, it should be the last field */
 } wifi_init_config_t;
 
@@ -160,6 +161,12 @@ extern const wpa_crypto_funcs_t g_wifi_default_wpa_crypto_funcs;
 #define WIFI_DEFAULT_RX_BA_WIN 0 /* unused if ampdu_rx_enable == false */
 #endif
 
+#if CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1
+#define WIFI_TASK_CORE_ID 1
+#else
+#define WIFI_TASK_CORE_ID 0
+#endif
+
 #define WIFI_INIT_CONFIG_DEFAULT() { \
     .event_handler = &esp_event_send, \
     .wpa_crypto_funcs = g_wifi_default_wpa_crypto_funcs, \
@@ -174,6 +181,7 @@ extern const wpa_crypto_funcs_t g_wifi_default_wpa_crypto_funcs;
     .nano_enable = WIFI_NANO_FORMAT_ENABLED,\
     .tx_ba_win = WIFI_DEFAULT_TX_BA_WIN,\
     .rx_ba_win = WIFI_DEFAULT_RX_BA_WIN,\
+    .wifi_task_core_id = WIFI_TASK_CORE_ID,\
     .magic = WIFI_INIT_CONFIG_MAGIC\
 };
 
index 3b4ce03f4634ed8837868bb45094d0ec3ee1deb5..ba4c4ce08e64ec848360afe25796fbdf45e24c9a 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 3b4ce03f4634ed8837868bb45094d0ec3ee1deb5
+Subproject commit ba4c4ce08e64ec848360afe25796fbdf45e24c9a