Skip to content

Commit

Permalink
make stack size and priority configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
256dpi committed May 21, 2017
1 parent d80fe30 commit 0899dec
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
11 changes: 11 additions & 0 deletions Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
menu "esp-mqtt"

config ESP_MQTT_TASK_STACK_SIZE
int "MQTT background process task stack size"
default 4096

config ESP_MQTT_TASK_STACK_PRIORITY
int "MQTT background process task priority"
default 5

endmenu
3 changes: 2 additions & 1 deletion esp_mqtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,8 @@ void esp_mqtt_start(const char *host, unsigned int port, const char *client_id,

// create mqtt thread
ESP_LOGI(ESP_MQTT_LOG_TAG, "esp_mqtt_start: create task");
xTaskCreatePinnedToCore(esp_mqtt_process, "esp_mqtt", 4096, NULL, 5, &esp_mqtt_task, 1);
xTaskCreatePinnedToCore(esp_mqtt_process, "esp_mqtt", CONFIG_ESP_MQTT_TASK_STACK_SIZE, NULL,
CONFIG_ESP_MQTT_TASK_STACK_PRIORITY, &esp_mqtt_task, 1);

// set local flag
esp_mqtt_running = true;
Expand Down
6 changes: 6 additions & 0 deletions test/sdkconfig
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ CONFIG_OPTIMIZATION_LEVEL_DEBUG=y
# CONFIG_BT_ENABLED is not set
CONFIG_BT_RESERVE_DRAM=0

#
# esp-mqtt
#
CONFIG_ESP_MQTT_TASK_STACK_SIZE=4096
CONFIG_ESP_MQTT_TASK_STACK_PRIORITY=5

#
# ESP32-specific
#
Expand Down

0 comments on commit 0899dec

Please sign in to comment.