Skip to content

Commit 46fafa2

Browse files
committed
fix BT mem release logic
1 parent a35bf59 commit 46fafa2

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

Diff for: cores/esp32/esp32-hal-misc.c

+9-13
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@
2727
#include "esp_private/startup_internal.h"
2828
#if defined(CONFIG_BT_ENABLED) && SOC_BT_SUPPORTED
2929
#include "esp_bt.h"
30+
#if CONFIG_IDF_TARGET_ESP32
31+
bool btInUse() {
32+
return true;
33+
}
34+
#else
35+
bool btInUse() {
36+
return false;
37+
}
38+
#endif
3039
#endif //CONFIG_BT_ENABLED
3140
#include <sys/time.h>
3241
#include "soc/rtc.h"
@@ -243,19 +252,6 @@ bool verifyRollbackLater() {
243252
}
244253
#endif
245254

246-
#ifdef CONFIG_BT_ENABLED
247-
#if CONFIG_IDF_TARGET_ESP32
248-
//overwritten in esp32-hal-bt.c
249-
bool btInUse() __attribute__((weak));
250-
bool btInUse() {
251-
return false;
252-
}
253-
#else
254-
//from esp32-hal-bt.c
255-
extern bool btInUse();
256-
#endif
257-
#endif
258-
259255
#if CONFIG_SPIRAM_SUPPORT || CONFIG_SPIRAM
260256
ESP_SYSTEM_INIT_FN(init_psram_new, CORE, BIT(0), 99) {
261257
psramInit();

0 commit comments

Comments
 (0)