diff --git a/ports/unix/Makefile b/ports/unix/Makefile index 3687755bfd..c4e5750eef 100644 --- a/ports/unix/Makefile +++ b/ports/unix/Makefile @@ -52,6 +52,12 @@ endif endif endif +# Set the file that will be included by "extmod/btstack/btstack_config.h" +# +# The original file "extmod/btstack/btstack_config_common.h" +# will be included by it. +MICROPY_BLUETOOTH_BTSTACK_CONFIG_FILE ?= '"ports/unix/btstack_config.h"' + # include py core make definitions include $(TOP)/py/py.mk include $(TOP)/extmod/extmod.mk diff --git a/ports/unix/btstack_config.h b/ports/unix/btstack_config.h new file mode 100644 index 0000000000..374acc02e9 --- /dev/null +++ b/ports/unix/btstack_config.h @@ -0,0 +1,23 @@ +#ifndef MICROPY_INCLUDED_PORTS_UNIX_BTSTACK_CONFIG_H +#define MICROPY_INCLUDED_PORTS_UNIX_BTSTACK_CONFIG_H + + +#include "extmod/btstack/btstack_config_common.h" + +#ifdef MICROPY_BLUETOOTH_BTSTACK_USB +#if MICROPY_BLUETOOTH_BTSTACK_USB + +// Workaround: +// +// If ENABLE_SCO_OVER_HCI is not defined there is a compiler error: +// +// ../../lib/btstack/platform/libusb/hci_transport_h2_libusb.c:1354:13: +// error: ‘signal_sco_can_send_now’ defined but not used +// +// Because the problem is in an external code this workaround is done. +#define ENABLE_SCO_OVER_HCI + +#endif +#endif + +#endif // MICROPY_INCLUDED_PORTS_UNIX_BTSTACK_CONFIG_H