]> granicus.if.org Git - esp-idf/commitdiff
components: esp32/lwip
authorliuzhifu <liuzhifu@espressif.com>
Thu, 1 Sep 2016 06:09:21 +0000 (14:09 +0800)
committerWu Jian Gang <wujiangang@espressif.com>
Wed, 14 Sep 2016 04:00:46 +0000 (12:00 +0800)
Add esp_task.h for placing all task priority/stack size macro definition

components/esp32/event.c
components/esp32/wifi.c
components/lwip/include/lwip/port/lwipopts.h

index 366d0371f298bd5de136deb4a986ad180ab635bf..213d7f3613094e5189618b189677d8ada69db190 100644 (file)
@@ -19,6 +19,7 @@
 #include "esp_err.h"
 #include "esp_wifi.h"
 #include "esp_event.h"
+#include "esp_task.h"
 
 #include "freertos/FreeRTOS.h"
 #include "freertos/task.h"
@@ -359,7 +360,7 @@ esp_err_t esp_event_init(system_event_cb_t cb, void *ctx)
 
     g_event_handler = xQueueCreate(CONFIG_WIFI_ENENT_QUEUE_SIZE, sizeof(system_event_t));
 
-    xTaskCreatePinnedToCore(esp_system_event_task, "eventTask", CONFIG_WIFI_EVENT_TASK_STACK_SIZE, NULL, configMAX_PRIORITIES-4, NULL, 0);
+    xTaskCreatePinnedToCore(esp_system_event_task, "eventTask", ESP_TASKD_EVENT_STACK, NULL, ESP_TASKD_EVENT_PRIO, NULL, 0);
     return ESP_OK;
 }
 
index a9d8981012223b07ff2a1e1a45ad091b8515f23b..fd44d30d000d48d69a76493136da13635688e6a4 100644 (file)
@@ -19,6 +19,7 @@
 #include "esp_err.h"
 #include "esp_wifi.h"
 #include "esp_event.h"
+#include "esp_task.h"
 
 #include "freertos/FreeRTOS.h"
 #include "freertos/task.h"
@@ -107,7 +108,7 @@ esp_err_t esp_wifi_startup(wifi_startup_cb_t cb, void *ctx)
     startup_cb = cb;
     startup_ctx = ctx;
 
-    xTaskCreatePinnedToCore(esp_wifi_task, "wifiTask", 4096, NULL, configMAX_PRIORITIES-7, NULL, 0);
+    xTaskCreatePinnedToCore(esp_wifi_task, "wifiTask", ESP_TASK_WIFI_STARTUP_STACK, NULL, ESP_TASK_WIFI_STARTUP_PRIO, NULL, 0);
 
     return ESP_OK;
 }
index 9fe047faba1cc5944f287bbb0105a650ec07c5f6..2dbb1b2f380d8b6a1583793f2bc871991ff4dcdf 100755 (executable)
@@ -33,6 +33,7 @@
 #define __LWIPOPTS_H__
 
 #include <stdlib.h>
+#include "esp_task.h"
 
 /* Enable all Espressif-only options */
 #define LWIP_ESP8266
@@ -323,14 +324,14 @@ extern unsigned char misc_prof_get_tcp_snd_buf(void);
  * The stack size value itself is platform-dependent, but is passed to
  * sys_thread_new() when the thread is created.
  */
-#define TCPIP_THREAD_STACKSIZE          2048                   //not ok:384
+#define TCPIP_THREAD_STACKSIZE          ESP_TASKD_LWIP_STACK
 
 /**
  * TCPIP_THREAD_PRIO: The priority assigned to the main tcpip thread.
  * The priority value itself is platform-dependent, but is passed to
  * sys_thread_new() when the thread is created.
  */
-#define TCPIP_THREAD_PRIO               (configMAX_PRIORITIES-7)
+#define TCPIP_THREAD_PRIO               ESP_TASKD_LWIP_PRIO
 
 /**
  * TCPIP_MBOX_SIZE: The mailbox size for the tcpip thread messages