Skip to content

Commit 35182a8

Browse files
peterharperukdpgeorge
authored andcommitted
extmod/btstack: Add cmake support for BTstack.
Signed-off-by: Damien George <damien@micropython.org>
1 parent 1de335f commit 35182a8

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

extmod/btstack/btstack.cmake

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
set(BTSTACK_LIB_DIR "${MICROPY_DIR}/lib/btstack")
2+
set(BTSTACK_EXTMOD_DIR "${MICROPY_DIR}/extmod/btstack")
3+
4+
add_library(micropy_extmod_btstack INTERFACE)
5+
6+
target_include_directories(micropy_extmod_btstack INTERFACE
7+
${MICROPY_DIR}/
8+
${MICROPY_PORT_DIR}/
9+
${BTSTACK_EXTMOD_DIR}/
10+
${BTSTACK_LIB_DIR}/src
11+
${BTSTACK_LIB_DIR}/3rd-party/bluedroid/decoder/include
12+
${BTSTACK_LIB_DIR}/3rd-party/bluedroid/encoder/include
13+
${BTSTACK_LIB_DIR}/3rd-party/md5
14+
${BTSTACK_LIB_DIR}/3rd-party/yxml
15+
)
16+
17+
target_sources(micropy_extmod_btstack INTERFACE
18+
${BTSTACK_LIB_DIR}/platform/embedded/hci_dump_embedded_stdout.c
19+
${BTSTACK_LIB_DIR}/src/ad_parser.c
20+
${BTSTACK_LIB_DIR}/src/ble/gatt-service/ancs_client.c
21+
${BTSTACK_LIB_DIR}/src/ble/att_db.c
22+
${BTSTACK_LIB_DIR}/src/ble/att_db_util.c
23+
${BTSTACK_LIB_DIR}/src/ble/att_dispatch.c
24+
${BTSTACK_LIB_DIR}/src/ble/att_server.c
25+
${BTSTACK_LIB_DIR}/src/ble/gatt-service/battery_service_server.c
26+
${BTSTACK_LIB_DIR}/src/ble/gatt-service/cycling_power_service_server.c
27+
${BTSTACK_LIB_DIR}/src/ble/gatt-service/cycling_speed_and_cadence_service_server.c
28+
${BTSTACK_LIB_DIR}/src/ble/gatt-service/device_information_service_server.c
29+
${BTSTACK_LIB_DIR}/src/ble/gatt-service/heart_rate_service_server.c
30+
${BTSTACK_LIB_DIR}/src/ble/gatt-service/hids_device.c
31+
${BTSTACK_LIB_DIR}/src/mesh/gatt-service/mesh_provisioning_service_server.c
32+
${BTSTACK_LIB_DIR}/src/mesh/gatt-service/mesh_proxy_service_server.c
33+
${BTSTACK_LIB_DIR}/src/ble/gatt-service/nordic_spp_service_server.c
34+
${BTSTACK_LIB_DIR}/src/ble/gatt-service/ublox_spp_service_server.c
35+
${BTSTACK_LIB_DIR}/src/ble/gatt_client.c
36+
${BTSTACK_LIB_DIR}/src/ble/le_device_db_memory.c
37+
${BTSTACK_LIB_DIR}/src/ble/sm.c
38+
${BTSTACK_LIB_DIR}/src/btstack_audio.c
39+
${BTSTACK_LIB_DIR}/src/btstack_base64_decoder.c
40+
${BTSTACK_LIB_DIR}/src/btstack_crypto.c
41+
${BTSTACK_LIB_DIR}/src/btstack_hid_parser.c
42+
${BTSTACK_LIB_DIR}/src/btstack_linked_list.c
43+
${BTSTACK_LIB_DIR}/src/btstack_memory.c
44+
${BTSTACK_LIB_DIR}/src/btstack_memory_pool.c
45+
${BTSTACK_LIB_DIR}/src/btstack_resample.c
46+
${BTSTACK_LIB_DIR}/src/btstack_ring_buffer.c
47+
${BTSTACK_LIB_DIR}/src/btstack_run_loop.c
48+
${BTSTACK_LIB_DIR}/src/btstack_run_loop_base.c
49+
${BTSTACK_LIB_DIR}/src/btstack_slip.c
50+
${BTSTACK_LIB_DIR}/src/btstack_tlv.c
51+
${BTSTACK_LIB_DIR}/src/btstack_tlv_none.c
52+
${BTSTACK_LIB_DIR}/src/btstack_util.c
53+
${BTSTACK_LIB_DIR}/src/hci.c
54+
${BTSTACK_LIB_DIR}/src/hci_cmd.c
55+
${BTSTACK_LIB_DIR}/src/hci_dump.c
56+
${BTSTACK_LIB_DIR}/src/hci_transport_em9304_spi.c
57+
${BTSTACK_LIB_DIR}/src/hci_transport_h4.c
58+
${BTSTACK_LIB_DIR}/src/l2cap.c
59+
${BTSTACK_LIB_DIR}/src/l2cap_signaling.c
60+
)

extmod/extmod.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ set(MICROPY_OOFATFS_DIR "${MICROPY_DIR}/lib/oofatfs")
66
set(MICROPY_SOURCE_EXTMOD
77
${MICROPY_DIR}/shared/libc/abort_.c
88
${MICROPY_DIR}/shared/libc/printf.c
9+
${MICROPY_EXTMOD_DIR}/btstack/modbluetooth_btstack.c
910
${MICROPY_EXTMOD_DIR}/machine_bitstream.c
1011
${MICROPY_EXTMOD_DIR}/machine_i2c.c
1112
${MICROPY_EXTMOD_DIR}/machine_mem.c

0 commit comments

Comments
 (0)