From 7acadbd5fc08c5af9dc8f2dc695ea4077c04e94a Mon Sep 17 00:00:00 2001 From: Yasmin Bosch Date: Sun, 17 Mar 2024 16:24:59 +0100 Subject: [PATCH] =?UTF-8?q?ports/unix:=20Fix=20"=E2=80=98signal=5Fsco=5Fca?= =?UTF-8?q?n=5Fsend=5Fnow=E2=80=99=20defined=20but=20not=20used".?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added a "ports/unix/btstack_config.h" for a workaround: If "MICROPY_BLUETOOTH_BTSTACK_USB" is set and "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 a workaround is done by defining MICROPY_BLUETOOTH_BTSTACK_USB in the added "btstack_config.h". The "ports/unix/Makefile" has been changed so that the "btstack_config.h" will be included. Signed-off-by: Yasmin Bosch --- ports/unix/Makefile | 6 ++++++ ports/unix/btstack_config.h | 23 +++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 ports/unix/btstack_config.h 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