diff --git a/BleKeyboard.cpp b/BleKeyboard.cpp index a4d2e88..0d043f4 100644 --- a/BleKeyboard.cpp +++ b/BleKeyboard.cpp @@ -1,3 +1,5 @@ +#include "BleKeyboard.h" + #if defined(USE_NIMBLE) #include #include @@ -14,7 +16,6 @@ #include #include "sdkconfig.h" -#include "BleKeyboard.h" #if defined(CONFIG_ARDUHAL_ESP_LOG) #include "esp32-hal-log.h" diff --git a/BleKeyboard.h b/BleKeyboard.h index 42de529..0736a02 100644 --- a/BleKeyboard.h +++ b/BleKeyboard.h @@ -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" diff --git a/README.md b/README.md index 6c40f2f..35cd80f 100644 --- a/README.md +++ b/README.md @@ -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 -``` +### 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