Merge branch 'feature/config_event_loop_stack_size' into 'master'

feature/config_event_loop_stack_size: Add config option for event loop stack

See merge request sdk/ESP8266_RTOS_SDK!580
This commit is contained in:
Wu Jian Gang
2018-11-01 09:47:00 +08:00
3 changed files with 9 additions and 1 deletions

View File

@@ -143,6 +143,12 @@ config WIFI_PPT_TASKSTACK_SIZE
which calls promiscuous callback function. So if user's function is which calls promiscuous callback function. So if user's function is
complex, the stack must be set larger. complex, the stack must be set larger.
config EVENT_LOOP_STACK_SIZE
int "Event loop stack size"
default 2048
help
Configure the Event loop task stack size per application.
config ESP8266_CORE_GLOBAL_DATA_LINK_IRAM config ESP8266_CORE_GLOBAL_DATA_LINK_IRAM
bool "Link libcore.a internal global data to IRAM" bool "Link libcore.a internal global data to IRAM"
default y default y

View File

@@ -23,6 +23,8 @@
#include "freertos/FreeRTOS.h" #include "freertos/FreeRTOS.h"
#include "freertos/queue.h" #include "freertos/queue.h"
#define EVENT_LOOP_STACKSIZE CONFIG_EVENT_LOOP_STACK_SIZE
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif

View File

@@ -98,7 +98,7 @@ esp_err_t esp_event_loop_init(system_event_cb_t cb, void *ctx)
s_event_queue = wifi_queue_create(32, sizeof(system_event_t)); s_event_queue = wifi_queue_create(32, sizeof(system_event_t));
if(s_event_queue == NULL) if(s_event_queue == NULL)
return ESP_ERR_NO_MEM; return ESP_ERR_NO_MEM;
if(wifi_task_create(esp_event_loop_task, "esp_event_loop_task", 2048, NULL, wifi_task_get_max_priority() - 5) == NULL) { if(wifi_task_create(esp_event_loop_task, "esp_event_loop_task", EVENT_LOOP_STACKSIZE, NULL, wifi_task_get_max_priority() - 5) == NULL) {
return ESP_ERR_NO_MEM; return ESP_ERR_NO_MEM;
} }
s_event_handler_cb = cb; s_event_handler_cb = cb;