Skip to content

Commit 403974d

Browse files
committed
more safe guards
1 parent 7fa49f7 commit 403974d

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

cores/esp32/esp32-hal-bt.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
// limitations under the License.
1414

1515
#include "sdkconfig.h"
16-
#if defined(CONFIG_BLUEDROID_ENABLED) && SOC_BT_SUPPORTED
16+
#include "soc/soc_caps.h"
17+
#if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED) && SOC_BT_SUPPORTED
1718

1819
#include "esp_bt.h"
1920
#include "esp_bt_main.h"

cores/esp32/esp32-hal-misc.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
// limitations under the License.
1414

1515
#include "sdkconfig.h"
16+
#include "soc/soc_caps.h"
1617
#include "freertos/FreeRTOS.h"
1718
#include "freertos/task.h"
1819
#include "esp_attr.h"
@@ -25,7 +26,7 @@
2526
#include "esp_ota_ops.h"
2627
#endif //CONFIG_APP_ROLLBACK_ENABLE
2728
#include "esp_private/startup_internal.h"
28-
#if defined(CONFIG_BT_ENABLED) && SOC_BT_SUPPORTED
29+
#if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED) && SOC_BT_SUPPORTED
2930
#include "esp_bt.h"
3031
#if CONFIG_IDF_TARGET_ESP32
3132
bool btInUse() __attribute__((weak));
@@ -38,7 +39,7 @@ bool btInUse() {
3839
return false;
3940
}
4041
#endif
41-
#endif //CONFIG_BT_ENABLED
42+
#endif //CONFIG_BLUEDROID_ENABLED
4243
#include <sys/time.h>
4344
#include "soc/rtc.h"
4445
#if !defined(CONFIG_IDF_TARGET_ESP32C2) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32H2) && !defined(CONFIG_IDF_TARGET_ESP32P4)
@@ -303,7 +304,7 @@ void initArduino() {
303304
if (err) {
304305
log_e("Failed to initialize NVS! Error: %u", err);
305306
}
306-
#if defined(CONFIG_BT_ENABLED) && SOC_BT_SUPPORTED
307+
#if defined(CONFIG_BLUEDROID_ENABLED) && SOC_BT_SUPPORTED
307308
if (!btInUse()) {
308309
esp_bt_controller_mem_release(ESP_BT_MODE_BTDM);
309310
}

libraries/BLE/src/BLEDevice.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#if SOC_BT_SUPPORTED
99

1010
#include "sdkconfig.h"
11-
#if defined(CONFIG_BLUEDROID_ENABLED)
11+
#if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED)
1212
#include <freertos/FreeRTOS.h>
1313
#include <freertos/event_groups.h>
1414
#include <freertos/task.h>

0 commit comments

Comments
 (0)