Fixed USE_NIMBLE

This commit is contained in:
sivar2311
2022-02-06 22:25:31 +01:00
parent 183afacf04
commit c96bc0e8f2
3 changed files with 10 additions and 8 deletions

View File

@@ -1,3 +1,5 @@
#include "BleKeyboard.h"
#if defined(USE_NIMBLE)
#include <NimBLEDevice.h>
#include <NimBLEServer.h>
@@ -14,7 +16,6 @@
#include <driver/adc.h>
#include "sdkconfig.h"
#include "BleKeyboard.h"
#if defined(CONFIG_ARDUHAL_ESP_LOG)
#include "esp32-hal-log.h"

View File

@@ -1,3 +1,6 @@
// uncomment the following line to use NimBLE library
//#define USE_NIMBLE
#ifndef ESP32_BLE_KEYBOARD_H
#define ESP32_BLE_KEYBOARD_H
#include "sdkconfig.h"

View File

@@ -137,15 +137,13 @@ Flash: [==== ] 44.2% (used 579158 bytes from 1310720 bytes)
| `ESP.getFreeHeap()` | 143.572 | 260.764 | **+ 117.192** |
| `ESP.getSketchSize()` | 994.224 | 579.264 | **- 414.960** |
### How to activate NimBLE mode?
## How to activate NimBLE mode?
ArduinoIDE: Before including the library, insert the line `#define USE_NIMBLE`
```C++
#define USE_NIMBLE
#include <BleKeyboard.h>
```
### ArduinoIDE:
Edit BleKeyboard.h and remove and uncomment the first line `#define USE_NIMBLE`
PlatformIO: Change your `platformio.ini` to the following settings
### PlatformIO:
Change your `platformio.ini` to the following settings
```ini
lib_deps =
NimBLE-Arduino