2020-02-19 22:40:55 -05:00
|
|
|
# Makefile directives for BlueKitchen BTstack
|
|
|
|
|
|
|
|
ifeq ($(MICROPY_BLUETOOTH_BTSTACK),1)
|
|
|
|
|
2022-10-08 08:47:57 -04:00
|
|
|
GIT_SUBMODULES += lib/btstack
|
extmod: Make extmod.mk self-contained.
This makes it so that all a port needs to do is set the relevant variables
and "include extmod.mk" and doesn't need to worry about adding anything to
OBJ, CFLAGS, SRC_QSTR, etc.
Make all extmod variables (src, flags, etc) private to extmod.mk.
Also move common/shared, extmod-related fragments (e.g. wiznet, cyw43,
bluetooth) into extmod.mk.
Now that SRC_MOD, CFLAGS_MOD, CXXFLAGS_MOD are unused by both extmod.mk
(and user-C-modules in a previous commit), remove all uses of them from
port makefiles.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-10-08 08:59:08 -04:00
|
|
|
|
2020-04-07 01:02:52 -04:00
|
|
|
MICROPY_BLUETOOTH_BTSTACK_USB ?= 0
|
extmod: Make extmod.mk self-contained.
This makes it so that all a port needs to do is set the relevant variables
and "include extmod.mk" and doesn't need to worry about adding anything to
OBJ, CFLAGS, SRC_QSTR, etc.
Make all extmod variables (src, flags, etc) private to extmod.mk.
Also move common/shared, extmod-related fragments (e.g. wiznet, cyw43,
bluetooth) into extmod.mk.
Now that SRC_MOD, CFLAGS_MOD, CXXFLAGS_MOD are unused by both extmod.mk
(and user-C-modules in a previous commit), remove all uses of them from
port makefiles.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-10-08 08:59:08 -04:00
|
|
|
MICROPY_BLUETOOTH_BTSTACK_H4 ?= 1
|
2020-04-07 01:02:52 -04:00
|
|
|
|
2020-02-19 22:40:55 -05:00
|
|
|
BTSTACK_EXTMOD_DIR = extmod/btstack
|
|
|
|
|
extmod: Make extmod.mk self-contained.
This makes it so that all a port needs to do is set the relevant variables
and "include extmod.mk" and doesn't need to worry about adding anything to
OBJ, CFLAGS, SRC_QSTR, etc.
Make all extmod variables (src, flags, etc) private to extmod.mk.
Also move common/shared, extmod-related fragments (e.g. wiznet, cyw43,
bluetooth) into extmod.mk.
Now that SRC_MOD, CFLAGS_MOD, CXXFLAGS_MOD are unused by both extmod.mk
(and user-C-modules in a previous commit), remove all uses of them from
port makefiles.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-10-08 08:59:08 -04:00
|
|
|
SRC_EXTMOD_C += $(BTSTACK_EXTMOD_DIR)/modbluetooth_btstack.c
|
2020-02-19 22:40:55 -05:00
|
|
|
|
|
|
|
INC += -I$(TOP)/$(BTSTACK_EXTMOD_DIR)
|
|
|
|
|
extmod: Make extmod.mk self-contained.
This makes it so that all a port needs to do is set the relevant variables
and "include extmod.mk" and doesn't need to worry about adding anything to
OBJ, CFLAGS, SRC_QSTR, etc.
Make all extmod variables (src, flags, etc) private to extmod.mk.
Also move common/shared, extmod-related fragments (e.g. wiznet, cyw43,
bluetooth) into extmod.mk.
Now that SRC_MOD, CFLAGS_MOD, CXXFLAGS_MOD are unused by both extmod.mk
(and user-C-modules in a previous commit), remove all uses of them from
port makefiles.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-10-08 08:59:08 -04:00
|
|
|
CFLAGS_EXTMOD += -DMICROPY_BLUETOOTH_BTSTACK=1
|
|
|
|
CFLAGS_EXTMOD += -DMICROPY_PY_BLUETOOTH_USE_SYNC_EVENTS=1
|
|
|
|
CFLAGS_EXTMOD += -DMICROPY_PY_BLUETOOTH_ENABLE_PAIRING_BONDING=1
|
2020-02-19 22:40:55 -05:00
|
|
|
|
|
|
|
BTSTACK_DIR = $(TOP)/lib/btstack
|
|
|
|
|
2020-04-19 21:50:02 -04:00
|
|
|
ifneq ($(wildcard $(BTSTACK_DIR)/src),)
|
|
|
|
|
2020-02-19 22:40:55 -05:00
|
|
|
include $(BTSTACK_DIR)/src/Makefile.inc
|
|
|
|
include $(BTSTACK_DIR)/src/ble/Makefile.inc
|
|
|
|
|
|
|
|
INC += -I$(BTSTACK_DIR)/src
|
|
|
|
INC += -I$(BTSTACK_DIR)/3rd-party/bluedroid/decoder/include
|
|
|
|
INC += -I$(BTSTACK_DIR)/3rd-party/bluedroid/encoder/include
|
|
|
|
INC += -I$(BTSTACK_DIR)/3rd-party/md5
|
|
|
|
INC += -I$(BTSTACK_DIR)/3rd-party/yxml
|
|
|
|
|
extmod: Make extmod.mk self-contained.
This makes it so that all a port needs to do is set the relevant variables
and "include extmod.mk" and doesn't need to worry about adding anything to
OBJ, CFLAGS, SRC_QSTR, etc.
Make all extmod variables (src, flags, etc) private to extmod.mk.
Also move common/shared, extmod-related fragments (e.g. wiznet, cyw43,
bluetooth) into extmod.mk.
Now that SRC_MOD, CFLAGS_MOD, CXXFLAGS_MOD are unused by both extmod.mk
(and user-C-modules in a previous commit), remove all uses of them from
port makefiles.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-10-08 08:59:08 -04:00
|
|
|
SRC_BTSTACK_C = \
|
2020-02-19 22:40:55 -05:00
|
|
|
$(addprefix lib/btstack/src/, $(SRC_FILES)) \
|
|
|
|
$(addprefix lib/btstack/src/ble/, $(filter-out %_tlv.c, $(SRC_BLE_FILES))) \
|
2020-04-07 01:02:52 -04:00
|
|
|
|
2020-08-14 01:46:53 -04:00
|
|
|
ifeq ($(MICROPY_BLUETOOTH_BTSTACK_USB),1)
|
|
|
|
ifeq ($(MICROPY_BLUETOOTH_BTSTACK_H4),1)
|
extmod: Make extmod.mk self-contained.
This makes it so that all a port needs to do is set the relevant variables
and "include extmod.mk" and doesn't need to worry about adding anything to
OBJ, CFLAGS, SRC_QSTR, etc.
Make all extmod variables (src, flags, etc) private to extmod.mk.
Also move common/shared, extmod-related fragments (e.g. wiznet, cyw43,
bluetooth) into extmod.mk.
Now that SRC_MOD, CFLAGS_MOD, CXXFLAGS_MOD are unused by both extmod.mk
(and user-C-modules in a previous commit), remove all uses of them from
port makefiles.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-10-08 08:59:08 -04:00
|
|
|
$(error Cannot enable both MICROPY_BLUETOOTH_BTSTACK_USB and MICROPY_BLUETOOTH_BTSTACK_H4)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(MICROPY_BLUETOOTH_BTSTACK_USB),1)
|
|
|
|
ifneq ($(MICROPY_BLUETOOTH_BTSTACK_H4),1)
|
|
|
|
$(error Must enable one of MICROPY_BLUETOOTH_BTSTACK_USB or MICROPY_BLUETOOTH_BTSTACK_H4)
|
2020-08-14 01:46:53 -04:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2020-04-07 01:02:52 -04:00
|
|
|
ifeq ($(MICROPY_BLUETOOTH_BTSTACK_USB),1)
|
extmod: Make extmod.mk self-contained.
This makes it so that all a port needs to do is set the relevant variables
and "include extmod.mk" and doesn't need to worry about adding anything to
OBJ, CFLAGS, SRC_QSTR, etc.
Make all extmod variables (src, flags, etc) private to extmod.mk.
Also move common/shared, extmod-related fragments (e.g. wiznet, cyw43,
bluetooth) into extmod.mk.
Now that SRC_MOD, CFLAGS_MOD, CXXFLAGS_MOD are unused by both extmod.mk
(and user-C-modules in a previous commit), remove all uses of them from
port makefiles.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-10-08 08:59:08 -04:00
|
|
|
SRC_BTSTACK_C += \
|
2020-04-07 01:02:52 -04:00
|
|
|
lib/btstack/platform/libusb/hci_transport_h2_libusb.c
|
|
|
|
|
extmod: Make extmod.mk self-contained.
This makes it so that all a port needs to do is set the relevant variables
and "include extmod.mk" and doesn't need to worry about adding anything to
OBJ, CFLAGS, SRC_QSTR, etc.
Make all extmod variables (src, flags, etc) private to extmod.mk.
Also move common/shared, extmod-related fragments (e.g. wiznet, cyw43,
bluetooth) into extmod.mk.
Now that SRC_MOD, CFLAGS_MOD, CXXFLAGS_MOD are unused by both extmod.mk
(and user-C-modules in a previous commit), remove all uses of them from
port makefiles.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-10-08 08:59:08 -04:00
|
|
|
CFLAGS_EXTMOD += -DMICROPY_BLUETOOTH_BTSTACK_USB=1
|
2020-08-14 01:46:53 -04:00
|
|
|
|
extmod: Make extmod.mk self-contained.
This makes it so that all a port needs to do is set the relevant variables
and "include extmod.mk" and doesn't need to worry about adding anything to
OBJ, CFLAGS, SRC_QSTR, etc.
Make all extmod variables (src, flags, etc) private to extmod.mk.
Also move common/shared, extmod-related fragments (e.g. wiznet, cyw43,
bluetooth) into extmod.mk.
Now that SRC_MOD, CFLAGS_MOD, CXXFLAGS_MOD are unused by both extmod.mk
(and user-C-modules in a previous commit), remove all uses of them from
port makefiles.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-10-08 08:59:08 -04:00
|
|
|
CFLAGS_THIRDPARTY += $(shell pkg-config libusb-1.0 --cflags)
|
|
|
|
LDFLAGS_THIRDPARTY += $(shell pkg-config libusb-1.0 --libs)
|
2020-04-07 01:02:52 -04:00
|
|
|
endif
|
2020-02-19 22:40:55 -05:00
|
|
|
|
2020-08-14 01:43:09 -04:00
|
|
|
ifeq ($(MICROPY_BLUETOOTH_BTSTACK_H4),1)
|
extmod: Make extmod.mk self-contained.
This makes it so that all a port needs to do is set the relevant variables
and "include extmod.mk" and doesn't need to worry about adding anything to
OBJ, CFLAGS, SRC_QSTR, etc.
Make all extmod variables (src, flags, etc) private to extmod.mk.
Also move common/shared, extmod-related fragments (e.g. wiznet, cyw43,
bluetooth) into extmod.mk.
Now that SRC_MOD, CFLAGS_MOD, CXXFLAGS_MOD are unused by both extmod.mk
(and user-C-modules in a previous commit), remove all uses of them from
port makefiles.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-10-08 08:59:08 -04:00
|
|
|
SRC_BTSTACK_C += \
|
2020-08-14 01:43:09 -04:00
|
|
|
lib/btstack/src/hci_transport_h4.c \
|
|
|
|
lib/btstack/chipset/zephyr/btstack_chipset_zephyr.c
|
|
|
|
|
extmod: Make extmod.mk self-contained.
This makes it so that all a port needs to do is set the relevant variables
and "include extmod.mk" and doesn't need to worry about adding anything to
OBJ, CFLAGS, SRC_QSTR, etc.
Make all extmod variables (src, flags, etc) private to extmod.mk.
Also move common/shared, extmod-related fragments (e.g. wiznet, cyw43,
bluetooth) into extmod.mk.
Now that SRC_MOD, CFLAGS_MOD, CXXFLAGS_MOD are unused by both extmod.mk
(and user-C-modules in a previous commit), remove all uses of them from
port makefiles.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-10-08 08:59:08 -04:00
|
|
|
SRC_BTSTACK_C += \
|
2020-08-14 01:43:09 -04:00
|
|
|
extmod/btstack/btstack_hci_uart.c \
|
|
|
|
|
extmod: Make extmod.mk self-contained.
This makes it so that all a port needs to do is set the relevant variables
and "include extmod.mk" and doesn't need to worry about adding anything to
OBJ, CFLAGS, SRC_QSTR, etc.
Make all extmod variables (src, flags, etc) private to extmod.mk.
Also move common/shared, extmod-related fragments (e.g. wiznet, cyw43,
bluetooth) into extmod.mk.
Now that SRC_MOD, CFLAGS_MOD, CXXFLAGS_MOD are unused by both extmod.mk
(and user-C-modules in a previous commit), remove all uses of them from
port makefiles.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-10-08 08:59:08 -04:00
|
|
|
CFLAGS_EXTMOD += -DMICROPY_BLUETOOTH_BTSTACK_H4=1
|
2020-08-14 01:43:09 -04:00
|
|
|
endif
|
|
|
|
|
2020-04-07 01:02:52 -04:00
|
|
|
ifeq ($(MICROPY_BLUETOOTH_BTSTACK_ENABLE_CLASSIC),1)
|
2020-02-19 22:40:55 -05:00
|
|
|
include $(BTSTACK_DIR)/src/classic/Makefile.inc
|
extmod: Make extmod.mk self-contained.
This makes it so that all a port needs to do is set the relevant variables
and "include extmod.mk" and doesn't need to worry about adding anything to
OBJ, CFLAGS, SRC_QSTR, etc.
Make all extmod variables (src, flags, etc) private to extmod.mk.
Also move common/shared, extmod-related fragments (e.g. wiznet, cyw43,
bluetooth) into extmod.mk.
Now that SRC_MOD, CFLAGS_MOD, CXXFLAGS_MOD are unused by both extmod.mk
(and user-C-modules in a previous commit), remove all uses of them from
port makefiles.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-10-08 08:59:08 -04:00
|
|
|
SRC_BTSTACK_C += \
|
2020-02-19 22:40:55 -05:00
|
|
|
$(addprefix lib/btstack/src/classic/, $(SRC_CLASSIC_FILES))
|
|
|
|
endif
|
|
|
|
|
extmod: Make extmod.mk self-contained.
This makes it so that all a port needs to do is set the relevant variables
and "include extmod.mk" and doesn't need to worry about adding anything to
OBJ, CFLAGS, SRC_QSTR, etc.
Make all extmod variables (src, flags, etc) private to extmod.mk.
Also move common/shared, extmod-related fragments (e.g. wiznet, cyw43,
bluetooth) into extmod.mk.
Now that SRC_MOD, CFLAGS_MOD, CXXFLAGS_MOD are unused by both extmod.mk
(and user-C-modules in a previous commit), remove all uses of them from
port makefiles.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-10-08 08:59:08 -04:00
|
|
|
SRC_THIRDPARTY_C += $(SRC_BTSTACK_C)
|
2020-02-19 22:40:55 -05:00
|
|
|
|
2020-04-16 20:00:36 -04:00
|
|
|
# Suppress some warnings.
|
2021-07-17 09:25:07 -04:00
|
|
|
BTSTACK_WARNING_CFLAGS = -Wno-old-style-definition -Wno-unused-variable -Wno-unused-parameter -Wno-implicit-fallthrough
|
2020-04-16 20:00:36 -04:00
|
|
|
ifneq ($(CC),clang)
|
|
|
|
BTSTACK_WARNING_CFLAGS += -Wno-format
|
|
|
|
endif
|
|
|
|
$(BUILD)/lib/btstack/src/%.o: CFLAGS += $(BTSTACK_WARNING_CFLAGS)
|
2020-10-29 00:47:20 -04:00
|
|
|
$(BUILD)/lib/btstack/platform/%.o: CFLAGS += $(BTSTACK_WARNING_CFLAGS)
|
2020-02-19 22:40:55 -05:00
|
|
|
|
|
|
|
endif
|
2020-04-19 21:50:02 -04:00
|
|
|
endif
|