Clear compile errors if BT needed but not on (#1371)

Fixes #1370

Adds a simple helper assertion to tell the user how to enable BT if it's
not enabled, instead of some odd compilation warnings about undefined
functions.
This commit was merged in pull request #1371.
This commit is contained in:
Earle F. Philhower, III
2023-04-12 08:21:24 -07:00
committed by GitHub
parent 59981aed7f
commit 3dcb4bbf8b
5 changed files with 14 additions and 1 deletions
+7
View File
@@ -0,0 +1,7 @@
// Simple helper header to ensure pico libs support ?BT
#ifndef ENABLE_CLASSIC
#define ENABLE_CLASSIC 0
#endif
static_assert(ENABLE_CLASSIC, "This library needs Bluetooth enabled. Use the 'Tools->IP/Bluetooth Stack' menu in the IDE to enable it.");
+4 -1
View File
@@ -1,6 +1,9 @@
/**
Arduino Wrapper for BTstack
*/
#include <_needsbt.h>
#ifndef __ARDUINO_BTSTACK_H
#define __ARDUINO_BTSTACK_H
@@ -198,4 +201,4 @@ extern "C" {
}
#endif
#endif // __ARDUINO_BTSTACK_H
#endif // __ARDUINO_BTSTACK_H
@@ -21,6 +21,7 @@
#pragma once
#include <_needsbt.h>
#include <Arduino.h>
#include <functional>
#include <pico/cyw43_arch.h>
@@ -21,6 +21,7 @@
#pragma once
#include <_needsbt.h>
#include <Arduino.h>
#include <functional>
#include <pico/cyw43_arch.h>
+1
View File
@@ -20,6 +20,7 @@
#pragma once
#include <_needsbt.h>
#include <Arduino.h>
#include <api/HardwareSerial.h>
#include <stdarg.h>