From 143298417f448ee5cb3d394d69def22267f15c11 Mon Sep 17 00:00:00 2001 From: Shubham Patil Date: Sun, 25 Jun 2023 03:06:56 +0530 Subject: [PATCH] [ESP32] options to configure bg task priority, size, event queue size (#27448) I missed adding them in #27348 --- config/esp32/components/chip/Kconfig | 25 +++++++++++++++++++ src/platform/ESP32/CHIPDevicePlatformConfig.h | 5 ++++ 2 files changed, 30 insertions(+) diff --git a/config/esp32/components/chip/Kconfig b/config/esp32/components/chip/Kconfig index 6aa0092a9bdec7..7bd4b0bf924de5 100644 --- a/config/esp32/components/chip/Kconfig +++ b/config/esp32/components/chip/Kconfig @@ -288,6 +288,31 @@ menu "CHIP Device Layer" When this option is enabled, the main matter task can delegate some time consuming operations to a background task so that the main matter task is not blocked and can process other work. + + config BG_CHIP_TASK_STACK_SIZE + depends on ENABLE_BG_EVENT_PROCESSING + int "Background CHIP Task Stack Size" + range 0 8192 + default 6144 + help + The size (in bytes) of the background CHIP task stack. + + config BG_CHIP_TASK_PRIORITY + depends on ENABLE_BG_EVENT_PROCESSING + int "Background CHIP Task Priority" + range 0 256 + default 1 + help + The priority of the background CHIP task. + + config BG_MAX_EVENT_QUEUE_SIZE + depends on ENABLE_BG_EVENT_PROCESSING + int "Max Event Queue Size" + range 1 8 + default 1 + help + The maximum number of events that can be held in the background CHIP Platform event queue. + endmenu menu "Device Identification Options" diff --git a/src/platform/ESP32/CHIPDevicePlatformConfig.h b/src/platform/ESP32/CHIPDevicePlatformConfig.h index f98fa12272e1fc..dd1dc977aace16 100644 --- a/src/platform/ESP32/CHIPDevicePlatformConfig.h +++ b/src/platform/ESP32/CHIPDevicePlatformConfig.h @@ -100,4 +100,9 @@ #define CHIP_DEVICE_CONFIG_ENABLE_DEVICE_INSTANCE_INFO_PROVIDER CONFIG_ENABLE_ESP32_DEVICE_INSTANCE_INFO_PROVIDER #define CHIP_DEVICE_CONFIG_DISCOVERY_TIMEOUT_SECS CONFIG_CHIP_DISCOVERY_TIMEOUT_SECS #define CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE CONFIG_ENABLE_ESP32_BLE_CONTROLLER + +// Options for background chip task #define CHIP_DEVICE_CONFIG_ENABLE_BG_EVENT_PROCESSING CONFIG_ENABLE_BG_EVENT_PROCESSING +#define CHIP_DEVICE_CONFIG_BG_TASK_PRIORITY CONFIG_BG_CHIP_TASK_PRIORITY +#define CHIP_DEVICE_CONFIG_BG_MAX_EVENT_QUEUE_SIZE CONFIG_BG_MAX_EVENT_QUEUE_SIZE +#define CHIP_DEVICE_CONFIG_BG_TASK_STACK_SIZE CONFIG_BG_CHIP_TASK_STACK_SIZE