From b879f800176d9de247babd55b47e594742c42a27 Mon Sep 17 00:00:00 2001 From: me-no-dev Date: Sat, 6 May 2017 18:27:03 +0300 Subject: [PATCH] Allow Arduino to be run without BT support in IDF Fixes: https://github.com/espressif/arduino-esp32/issues/343 --- Kconfig | 1 - cores/esp32/esp32-hal-bt.c | 3 ++- cores/esp32/esp32-hal-bt.h | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Kconfig b/Kconfig index 9419e6fa..f0077d40 100644 --- a/Kconfig +++ b/Kconfig @@ -3,7 +3,6 @@ menu "Arduino Configuration" config ENABLE_ARDUINO_DEPENDS bool select LWIP_SO_RCVBUF - select BT_ENABLED select ETHERNET select WIFI_ENABLED select ESP32_PHY_CALIBRATION_AND_DATA_STORAGE diff --git a/cores/esp32/esp32-hal-bt.c b/cores/esp32/esp32-hal-bt.c index 35899c31..badb510f 100644 --- a/cores/esp32/esp32-hal-bt.c +++ b/cores/esp32/esp32-hal-bt.c @@ -11,6 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +#if CONFIG_BT_ENABLED #include "esp32-hal-bt.h" @@ -62,5 +63,5 @@ bool btStop(){ return false; } - +#endif diff --git a/cores/esp32/esp32-hal-bt.h b/cores/esp32/esp32-hal-bt.h index 56222da3..23bd9728 100644 --- a/cores/esp32/esp32-hal-bt.h +++ b/cores/esp32/esp32-hal-bt.h @@ -17,6 +17,8 @@ #include "esp32-hal.h" +#if CONFIG_BT_ENABLED + #ifdef __cplusplus extern "C" { #endif @@ -29,4 +31,6 @@ bool btStop(); } #endif +#endif + #endif /* _ESP32_ESP32_HAL_BT_H_ */