Skip to content

Commit

Permalink
zephyr: Add initial ubluetooth module integration.
Browse files Browse the repository at this point in the history
Currently only advertising and scanning are supported, using the ring
buffer for events (ie not synchronous events at this stage).

The ble_gap_advertise.py multi-test passes (tested on a nucleo_wb55rg
board).

Signed-off-by: Damien George <damien@micropython.org>
  • Loading branch information
dpgeorge committed Jun 6, 2021
1 parent 5cb2ade commit 80e79a7
Show file tree
Hide file tree
Showing 5 changed files with 429 additions and 1 deletion.
1 change: 1 addition & 0 deletions ports/zephyr/CMakeLists.txt
Expand Up @@ -40,6 +40,7 @@ set(MICROPY_SOURCE_PORT
machine_i2c.c
machine_pin.c
machine_uart.c
modbluetooth_zephyr.c
modmachine.c
moduos.c
modusocket.c
Expand Down
4 changes: 4 additions & 0 deletions ports/zephyr/main.c
Expand Up @@ -49,6 +49,7 @@
#include "py/stackctrl.h"
#include "lib/utils/pyexec.h"
#include "lib/mp-readline/readline.h"
#include "extmod/modbluetooth.h"

#if MICROPY_VFS
#include "extmod/vfs.h"
Expand Down Expand Up @@ -168,6 +169,9 @@ int real_main(void) {

printf("soft reboot\n");

#if MICROPY_PY_BLUETOOTH
mp_bluetooth_deinit();
#endif
#if MICROPY_PY_MACHINE
machine_pin_deinit();
#endif
Expand Down

0 comments on commit 80e79a7

Please sign in to comment.