Skip to content

Commit fb82a69

Browse files
committed
chore: add support for customize app_conf_default.h
Signed-off-by: Frederic Pillon <[email protected]>
1 parent a3c689a commit fb82a69

File tree

1 file changed

+42
-16
lines changed

1 file changed

+42
-16
lines changed

src/utility/STM32Cube_FW/app_conf_default.h

+42-16
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@
4141
/**
4242
* Define Tx Power
4343
*/
44-
#define CFG_TX_POWER (0x18) /* -0.15dBm */
44+
#ifndef CFG_TX_POWER
45+
#define CFG_TX_POWER (0x18) /* -0.15dBm */
46+
#endif
4547

4648
/******************************************************************************
4749
* BLE Stack
@@ -50,13 +52,17 @@
5052
* Maximum number of simultaneous connections that the device will support.
5153
* Valid values are from 1 to 8
5254
*/
53-
#define CFG_BLE_NUM_LINK 8
55+
#ifndef CFG_BLE_NUM_LINK
56+
#define CFG_BLE_NUM_LINK 8
57+
#endif
5458

5559
/**
5660
* Maximum number of Services that can be stored in the GATT database.
5761
* Note that the GAP and GATT services are automatically added so this parameter should be 2 plus the number of user services
5862
*/
59-
#define CFG_BLE_NUM_GATT_SERVICES 8
63+
#ifndef CFG_BLE_NUM_GATT_SERVICES
64+
#define CFG_BLE_NUM_GATT_SERVICES 8
65+
#endif
6066

6167
/**
6268
* Maximum number of Attributes
@@ -65,13 +71,17 @@
6571
* Note that certain characteristics and relative descriptors are added automatically during device initialization
6672
* so this parameters should be 9 plus the number of user Attributes
6773
*/
68-
#define CFG_BLE_NUM_GATT_ATTRIBUTES 68
74+
#ifndef CFG_BLE_NUM_GATT_ATTRIBUTES
75+
#define CFG_BLE_NUM_GATT_ATTRIBUTES 68
76+
#endif
6977

7078
/**
7179
* Maximum supported ATT_MTU size
7280
* This parameter is ignored by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY flag set
7381
*/
74-
#define CFG_BLE_MAX_ATT_MTU (156)
82+
#ifndef CFG_BLE_MAX_ATT_MTU
83+
#define CFG_BLE_MAX_ATT_MTU (156)
84+
#endif
7585

7686
/**
7787
* Size of the storage area for Attribute values
@@ -84,14 +94,18 @@
8494
* The total amount of memory needed is the sum of the above quantities for each attribute.
8595
* This parameter is ignored by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY flag set
8696
*/
87-
#define CFG_BLE_ATT_VALUE_ARRAY_SIZE (1344)
97+
#ifndef CFG_BLE_ATT_VALUE_ARRAY_SIZE
98+
#define CFG_BLE_ATT_VALUE_ARRAY_SIZE (1344)
99+
#endif
88100

89101
/**
90102
* Prepare Write List size in terms of number of packet
91103
* This parameter is ignored by the CPU2 when CFG_BLE_OPTIONS has SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY flag set
92104
*/
93105
// #define CFG_BLE_PREPARE_WRITE_LIST_SIZE BLE_PREP_WRITE_X_ATT(CFG_BLE_MAX_ATT_MTU)
94-
#define CFG_BLE_PREPARE_WRITE_LIST_SIZE (0x3A)
106+
#ifndef CFG_BLE_PREPARE_WRITE_LIST_SIZE
107+
#define CFG_BLE_PREPARE_WRITE_LIST_SIZE (0x3A)
108+
#endif
95109

96110
/**
97111
* Number of allocated memory blocks
@@ -103,12 +117,16 @@
103117
/**
104118
* Enable or disable the Extended Packet length feature. Valid values are 0 or 1.
105119
*/
106-
#define CFG_BLE_DATA_LENGTH_EXTENSION 1
120+
#ifndef CFG_BLE_DATA_LENGTH_EXTENSION
121+
#define CFG_BLE_DATA_LENGTH_EXTENSION 1
122+
#endif
107123

108124
/**
109125
* Sleep clock accuracy in Slave mode (ppm value)
110126
*/
111-
#define CFG_BLE_SLAVE_SCA 500
127+
#ifndef CFG_BLE_SLAVE_SCA
128+
#define CFG_BLE_SLAVE_SCA 500
129+
#endif
112130

113131
/**
114132
* Sleep clock accuracy in Master mode
@@ -121,7 +139,9 @@
121139
* 6 : 21 ppm to 30 ppm
122140
* 7 : 0 ppm to 20 ppm
123141
*/
124-
#define CFG_BLE_MASTER_SCA 0
142+
#ifndef CFG_BLE_MASTER_SCA
143+
#define CFG_BLE_MASTER_SCA 0
144+
#endif
125145

126146
/**
127147
* LsSource
@@ -130,21 +150,27 @@
130150
* - bit 1: 1: STM32WB5M Module device 0: Other devices as STM32WBxx SOC, STM32WB1M module
131151
* - bit 2: 1: HSE/1024 Clock config 0: LSE Clock config
132152
*/
133-
#if defined(STM32WB5Mxx)
134-
#define CFG_BLE_LS_SOURCE (SHCI_C2_BLE_INIT_CFG_BLE_LS_NOCALIB | SHCI_C2_BLE_INIT_CFG_BLE_LS_MOD5MM_DEV | SHCI_C2_BLE_INIT_CFG_BLE_LS_CLK_LSE)
135-
#else
136-
#define CFG_BLE_LS_SOURCE (SHCI_C2_BLE_INIT_CFG_BLE_LS_NOCALIB | SHCI_C2_BLE_INIT_CFG_BLE_LS_OTHER_DEV | SHCI_C2_BLE_INIT_CFG_BLE_LS_CLK_LSE)
153+
#ifndef CFG_BLE_LS_SOURCE
154+
#if defined(STM32WB5Mxx)
155+
#define CFG_BLE_LS_SOURCE (SHCI_C2_BLE_INIT_CFG_BLE_LS_NOCALIB | SHCI_C2_BLE_INIT_CFG_BLE_LS_MOD5MM_DEV | SHCI_C2_BLE_INIT_CFG_BLE_LS_CLK_LSE)
156+
#else
157+
#define CFG_BLE_LS_SOURCE (SHCI_C2_BLE_INIT_CFG_BLE_LS_NOCALIB | SHCI_C2_BLE_INIT_CFG_BLE_LS_OTHER_DEV | SHCI_C2_BLE_INIT_CFG_BLE_LS_CLK_LSE)
158+
#endif
137159
#endif
138160

139161
/**
140162
* Start up time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us)
141163
*/
142-
#define CFG_BLE_HSE_STARTUP_TIME 0x148
164+
#ifndef CFG_BLE_HSE_STARTUP_TIME
165+
#define CFG_BLE_HSE_STARTUP_TIME 0x148
166+
#endif
143167

144168
/**
145169
* Maximum duration of the connection event when the device is in Slave mode in units of 625/256 us (~2.44 us)
146170
*/
147-
#define CFG_BLE_MAX_CONN_EVENT_LENGTH (0xFFFFFFFF)
171+
#ifndef CFG_BLE_MAX_CONN_EVENT_LENGTH
172+
#define CFG_BLE_MAX_CONN_EVENT_LENGTH (0xFFFFFFFF)
173+
#endif
148174

149175
/**
150176
* Viterbi Mode

0 commit comments

Comments
 (0)