Skip to content

Commit

Permalink
Merge branch 'optimize/bt_make_alarm_num_configurable' into 'master'
Browse files Browse the repository at this point in the history
optimize(ble_mesh): Make alarm number configurable

Closes BLERP-577

See merge request espressif/esp-idf!28965
  • Loading branch information
jack0c committed Apr 2, 2024
2 parents 1bcd5bc + 6df1997 commit 8ae1d99
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
6 changes: 6 additions & 0 deletions components/bt/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ menu "Bluetooth"
We cannot split the memory into 3 different regions (IRAM, BLE-IRAM, DRAM).
So this option will disable the PMP (ESP_SYSTEM_PMP_IDRAM_SPLIT)

menu "Common Options"
visible if (BT_BLUEDROID_ENABLED || BT_NIMBLE_ENABLED)

source "$IDF_PATH/components/bt/common/Kconfig.in"
endmenu

endmenu

menuconfig BLE_MESH
Expand Down
6 changes: 6 additions & 0 deletions components/bt/common/Kconfig.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
config BT_ALARM_MAX_NUM
int "Maximum number of Bluetooth alarms"
default 50
help
This option decides the maximum number of alarms which
could be used by Bluetooth host.
11 changes: 10 additions & 1 deletion components/bt/common/include/bt_user_config.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -50,6 +50,15 @@
#define UC_BTC_TASK_STACK_SIZE 4096
#endif

/**********************************************************
* Alarm reference
**********************************************************/
#ifdef CONFIG_BT_ALARM_MAX_NUM
#define UC_ALARM_MAX_NUM CONFIG_BT_ALARM_MAX_NUM
#else
#define UC_ALARM_MAX_NUM 50
#endif

/**********************************************************
* Trace reference
**********************************************************/
Expand Down
3 changes: 2 additions & 1 deletion components/bt/common/osi/include/osi/alarm.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#include <stdint.h>
#include "esp_timer.h"
#include "bt_user_config.h"

typedef struct alarm_t osi_alarm_t;
typedef uint64_t period_ms_t;
Expand All @@ -33,7 +34,7 @@ typedef enum {
OSI_ALARM_ERR_INVALID_STATE = -3,
} osi_alarm_err_t;

#define ALARM_CBS_NUM 50
#define ALARM_CBS_NUM UC_ALARM_MAX_NUM
#define ALARM_ID_BASE 1000

int osi_alarm_create_mux(void);
Expand Down

0 comments on commit 8ae1d99

Please sign in to comment.