From f8212988c4c9c52849c96dd60e80f4376cfaafc0 Mon Sep 17 00:00:00 2001 From: Zac Bond Date: Wed, 28 Aug 2019 17:30:07 -0400 Subject: [PATCH 1/2] Use CONFIG value instead of hard-coded value. Add intermediate defines. Use CONFIG_BTU_TASK_STACK_SIZE instead of hard-coded value in Bluedroid component --- .../common/include/common/bluedroid_user_config.h | 10 ++++++++++ .../host/bluedroid/common/include/common/bt_target.h | 4 ++++ components/bt/host/bluedroid/stack/btu/btu_init.c | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/components/bt/host/bluedroid/common/include/common/bluedroid_user_config.h b/components/bt/host/bluedroid/common/include/common/bluedroid_user_config.h index e14773310a..82082e1ea1 100644 --- a/components/bt/host/bluedroid/common/include/common/bluedroid_user_config.h +++ b/components/bt/host/bluedroid/common/include/common/bluedroid_user_config.h @@ -19,6 +19,16 @@ #include "bt_common.h" #include "bt_user_config.h" +/********************************************************** + * Thread/Task reference + **********************************************************/ +#ifdef CONFIG_BT_BTU_TASK_STACK_SIZE +#define UC_BT_BTU_TASK_STACK_SIZE CONFIG_BT_BTU_TASK_STACK_SIZE +#else +#define UC_BT_BTU_TASK_STACK_SIZE 4096 +#endif + + /********************************************************** * Profile reference **********************************************************/ diff --git a/components/bt/host/bluedroid/common/include/common/bt_target.h b/components/bt/host/bluedroid/common/include/common/bt_target.h index a59d3793e0..bf5600580a 100644 --- a/components/bt/host/bluedroid/common/include/common/bt_target.h +++ b/components/bt/host/bluedroid/common/include/common/bt_target.h @@ -41,6 +41,10 @@ #include "stack/dyn_mem.h" /* defines static and/or dynamic memory for components */ + +/* OS Configuration from User config (eg: sdkconfig) */ +#define BT_BTU_TASK_STACK_SIZE UC_BT_BTU_TASK_STACK_SIZE + /****************************************************************************** ** ** Classic BT features diff --git a/components/bt/host/bluedroid/stack/btu/btu_init.c b/components/bt/host/bluedroid/stack/btu/btu_init.c index 80678bef82..430cd65af6 100644 --- a/components/bt/host/bluedroid/stack/btu/btu_init.c +++ b/components/bt/host/bluedroid/stack/btu/btu_init.c @@ -45,7 +45,7 @@ #endif #define BTU_TASK_PINNED_TO_CORE (TASK_PINNED_TO_CORE) -#define BTU_TASK_STACK_SIZE (4096 + BT_TASK_EXTRA_STACK_SIZE) +#define BTU_TASK_STACK_SIZE (BT_BTU_TASK_STACK_SIZE + BT_TASK_EXTRA_STACK_SIZE) #define BTU_TASK_PRIO (BT_TASK_MAX_PRIORITIES - 5) #define BTU_TASK_NAME "btuT" From 019067b6ac3dddb60458154b4743e177652ae93d Mon Sep 17 00:00:00 2001 From: baohongde Date: Fri, 30 Aug 2019 10:58:28 +0800 Subject: [PATCH 2/2] components/bt: Rename some macros --- .../bluedroid/common/include/common/bluedroid_user_config.h | 6 +++--- .../bt/host/bluedroid/common/include/common/bt_target.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/bt/host/bluedroid/common/include/common/bluedroid_user_config.h b/components/bt/host/bluedroid/common/include/common/bluedroid_user_config.h index 82082e1ea1..a71cf85c07 100644 --- a/components/bt/host/bluedroid/common/include/common/bluedroid_user_config.h +++ b/components/bt/host/bluedroid/common/include/common/bluedroid_user_config.h @@ -22,10 +22,10 @@ /********************************************************** * Thread/Task reference **********************************************************/ -#ifdef CONFIG_BT_BTU_TASK_STACK_SIZE -#define UC_BT_BTU_TASK_STACK_SIZE CONFIG_BT_BTU_TASK_STACK_SIZE +#ifdef CONFIG_BTU_TASK_STACK_SIZE +#define UC_BTU_TASK_STACK_SIZE CONFIG_BTU_TASK_STACK_SIZE #else -#define UC_BT_BTU_TASK_STACK_SIZE 4096 +#define UC_BTU_TASK_STACK_SIZE 4096 #endif diff --git a/components/bt/host/bluedroid/common/include/common/bt_target.h b/components/bt/host/bluedroid/common/include/common/bt_target.h index bf5600580a..c958204836 100644 --- a/components/bt/host/bluedroid/common/include/common/bt_target.h +++ b/components/bt/host/bluedroid/common/include/common/bt_target.h @@ -43,7 +43,7 @@ /* OS Configuration from User config (eg: sdkconfig) */ -#define BT_BTU_TASK_STACK_SIZE UC_BT_BTU_TASK_STACK_SIZE +#define BT_BTU_TASK_STACK_SIZE UC_BTU_TASK_STACK_SIZE /****************************************************************************** **