From f1811b353b0200071da32ba02a8cf24ce261941c Mon Sep 17 00:00:00 2001 From: Supreet Deshpande Date: Wed, 24 Oct 2018 15:03:15 +0530 Subject: [PATCH] feature/config_event_loop_stack_size: Add config option for event loop stack Adding configuration option for the event loop stack in ESP8266. --- components/esp8266/Kconfig | 6 ++++++ components/esp8266/include/esp_event_loop.h | 2 ++ components/esp8266/source/event_loop.c | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/components/esp8266/Kconfig b/components/esp8266/Kconfig index 12cb2b61..286205c5 100644 --- a/components/esp8266/Kconfig +++ b/components/esp8266/Kconfig @@ -143,6 +143,12 @@ config WIFI_PPT_TASKSTACK_SIZE which calls promiscuous callback function. So if user's function is 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 bool "Link libcore.a internal global data to IRAM" default y diff --git a/components/esp8266/include/esp_event_loop.h b/components/esp8266/include/esp_event_loop.h index 7f6ed61a..0e582b90 100644 --- a/components/esp8266/include/esp_event_loop.h +++ b/components/esp8266/include/esp_event_loop.h @@ -23,6 +23,8 @@ #include "freertos/FreeRTOS.h" #include "freertos/queue.h" +#define EVENT_LOOP_STACKSIZE CONFIG_EVENT_LOOP_STACK_SIZE + #ifdef __cplusplus extern "C" { #endif diff --git a/components/esp8266/source/event_loop.c b/components/esp8266/source/event_loop.c index 5534fcaf..de5d3daf 100644 --- a/components/esp8266/source/event_loop.c +++ b/components/esp8266/source/event_loop.c @@ -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)); if(s_event_queue == NULL) 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; } s_event_handler_cb = cb;