Must include sdkconfig.h before testing defines

This commit is contained in:
me-no-dev 2017-09-21 19:33:45 +08:00
parent c66a020e80
commit 1407654c52
3 changed files with 6 additions and 1 deletions

View File

@ -16,11 +16,12 @@
// Useful if you want to advertise some sort of message // 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 // Button is attached between GPIO 0 and GND, and the device name changes each time the button is pressed
#include "SimpleBLE.h"
#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED) #if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)
#error Bluetooth is not enabled! Please run `make menuconfig` to and enable it #error Bluetooth is not enabled! Please run `make menuconfig` to and enable it
#endif #endif
#include "SimpleBLE.h"
SimpleBLE ble; SimpleBLE ble;
void onButton(){ void onButton(){

View File

@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED) #if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED)
#include "SimpleBLE.h" #include "SimpleBLE.h"

View File

@ -15,6 +15,8 @@
#ifndef _SIMPLE_BLE_H_ #ifndef _SIMPLE_BLE_H_
#define _SIMPLE_BLE_H_ #define _SIMPLE_BLE_H_
#include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED) #if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED)
#include <cstdint> #include <cstdint>