Skip to content

Commit d46d0d9

Browse files
committed
Reinstate CONFIG_BT_NIMBLE_EXT_ADV as an option to fix redefinition.
Platformio adds the build flags to the command line and in the latest arduino core, nimble is enabled so using MYNEWT_VAL_BLE_EXT_ADV will cause a redefinition warning.
1 parent 66fbe50 commit d46d0d9

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

docs/Command_line_config.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,9 @@ If defined, advertisement types will be printed as text while scanning in debug
114114
## Extended advertising settings (ESP32C3, ESP32S3, ESP32H2 ONLY)
115115

116116
`MYNEWT_VAL_BLE_EXT_ADV`
117-
Set to 1 to enable extended advertising features
117+
Set to 1 to enable extended advertising features.
118+
For Platformio this may cause a redefinition warning with the latest arduino cores,
119+
to avoid this `CONFIG_BT_NIMBLE_EXT_ADV` can be used instead.
118120

119121
`MYNEWT_VAL_BLE_MULTI_ADV_INSTANCES`
120122
Sets the max number of extended advertising instances

src/nimconfig.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,11 @@
182182

183183
#define MYNEWT_VAL_BLE_USE_ESP_TIMER (CONFIG_BT_NIMBLE_USE_ESP_TIMER)
184184

185+
#ifdef CONFIG_BT_NIMBLE_EXT_ADV // Workaround for PlatformIO build flags causing redefinition warnings
186+
# undef MYNEWT_VAL_BLE_EXT_ADV
187+
# define MYNEWT_VAL_BLE_EXT_ADV (CONFIG_BT_NIMBLE_EXT_ADV)
188+
#endif
189+
185190
#else // !ESP_PLATFORM
186191
# if defined(NRF51)
187192
# include "syscfg/devcfg/nrf51cfg.h"

0 commit comments

Comments
 (0)