Add guards to not compile BT code if not enabled
This commit is contained in:
parent
4092fc409e
commit
c66a020e80
@ -14,7 +14,8 @@
|
||||
|
||||
#include "esp32-hal-bt.h"
|
||||
|
||||
#if CONFIG_BT_ENABLED
|
||||
#if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED)
|
||||
|
||||
|
||||
#include "bt.h"
|
||||
#include "esp_bt_defs.h"
|
||||
|
@ -16,6 +16,10 @@
|
||||
// Useful if you want to advertise some sort of message
|
||||
// Button is attached between GPIO 0 and GND, and the device name changes each time the button is pressed
|
||||
|
||||
#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)
|
||||
#error Bluetooth is not enabled! Please run `make menuconfig` to and enable it
|
||||
#endif
|
||||
|
||||
#include "SimpleBLE.h"
|
||||
SimpleBLE ble;
|
||||
|
||||
|
@ -12,6 +12,8 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED)
|
||||
|
||||
#include "SimpleBLE.h"
|
||||
#include "esp32-hal-log.h"
|
||||
|
||||
@ -125,3 +127,5 @@ void SimpleBLE::end()
|
||||
{
|
||||
_stop_gap();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -15,6 +15,7 @@
|
||||
#ifndef _SIMPLE_BLE_H_
|
||||
#define _SIMPLE_BLE_H_
|
||||
|
||||
#if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED)
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
@ -58,3 +59,5 @@ class SimpleBLE {
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user