summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2021-03-17 12:35:59 +1100
committerDamien George <damien@micropython.org>2022-07-22 17:41:21 +1000
commit5dbb822ca4a809ac5cb4513afb0411b4eb8dc3cf (patch)
treec969809dbd42e9ca90903f8470e4171d213ee413
parente05d0a6335be6a45f29f5d987091b858ad378cfa (diff)
esp32/mpconfigport: Enable BLE synchronous events and pairing/bonding.
Signed-off-by: Damien George <damien@micropython.org>
-rw-r--r--ports/esp32/main/CMakeLists.txt6
-rw-r--r--ports/esp32/mpconfigport.h4
2 files changed, 9 insertions, 1 deletions
diff --git a/ports/esp32/main/CMakeLists.txt b/ports/esp32/main/CMakeLists.txt
index 9ac6537f8..fccfd6b7c 100644
--- a/ports/esp32/main/CMakeLists.txt
+++ b/ports/esp32/main/CMakeLists.txt
@@ -198,11 +198,15 @@ target_compile_options(${MICROPY_TARGET} PUBLIC
-Wno-missing-field-initializers
)
+# Additional include directories needed for private NimBLE headers.
+target_include_directories(${MICROPY_TARGET} PUBLIC
+ ${IDF_PATH}/components/bt/host/nimble/nimble
+)
+
# Add additional extmod and usermod components.
target_link_libraries(${MICROPY_TARGET} micropy_extmod_btree)
target_link_libraries(${MICROPY_TARGET} usermod)
-
# Collect all of the include directories and compile definitions for the IDF components.
foreach(comp ${IDF_COMPONENTS})
micropy_gather_target_properties(__idf_${comp})
diff --git a/ports/esp32/mpconfigport.h b/ports/esp32/mpconfigport.h
index 8dc3537e5..dfa577d2b 100644
--- a/ports/esp32/mpconfigport.h
+++ b/ports/esp32/mpconfigport.h
@@ -70,7 +70,11 @@
// extended modules
#ifndef MICROPY_PY_BLUETOOTH
#define MICROPY_PY_BLUETOOTH (1)
+#define MICROPY_PY_BLUETOOTH_USE_SYNC_EVENTS (1)
+#define MICROPY_PY_BLUETOOTH_USE_SYNC_EVENTS_WITH_INTERLOCK (1)
+#define MICROPY_PY_BLUETOOTH_SYNC_EVENT_STACK_SIZE (CONFIG_BT_NIMBLE_TASK_STACK_SIZE)
#define MICROPY_PY_BLUETOOTH_ENABLE_CENTRAL_MODE (1)
+#define MICROPY_PY_BLUETOOTH_ENABLE_PAIRING_BONDING (1)
#define MICROPY_BLUETOOTH_NIMBLE (1)
#define MICROPY_BLUETOOTH_NIMBLE_BINDINGS_ONLY (1)
#endif