kopia lustrzana https://github.com/micropython/micropython
samd/BLE: Change main.c, pendsv.h, mpconfigxxx.h and makefiles for BLE.
Signed-off-by: robert-hh <robert@hammelrath.com>
rodzic
57c2a18bf8
commit
4b2751412b
|
@ -37,6 +37,7 @@ FROZEN_MANIFEST ?= boards/manifest.py
|
||||||
# Include py core make definitions
|
# Include py core make definitions
|
||||||
include $(TOP)/py/py.mk
|
include $(TOP)/py/py.mk
|
||||||
include $(TOP)/extmod/extmod.mk
|
include $(TOP)/extmod/extmod.mk
|
||||||
|
include ${TOP}/extmod/nimble/nimble.mk
|
||||||
|
|
||||||
GIT_SUBMODULES += lib/asf4 lib/tinyusb
|
GIT_SUBMODULES += lib/asf4 lib/tinyusb
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,8 @@
|
||||||
#include "shared/runtime/softtimer.h"
|
#include "shared/runtime/softtimer.h"
|
||||||
#include "shared/tinyusb/mp_usbd.h"
|
#include "shared/tinyusb/mp_usbd.h"
|
||||||
#include "clock_config.h"
|
#include "clock_config.h"
|
||||||
|
#include "extmod/modbluetooth.h"
|
||||||
|
#include "mpbthciport.h"
|
||||||
|
|
||||||
extern uint8_t _sstack, _estack, _sheap, _eheap;
|
extern uint8_t _sstack, _estack, _sheap, _eheap;
|
||||||
extern void adc_deinit_all(void);
|
extern void adc_deinit_all(void);
|
||||||
|
@ -52,11 +54,12 @@ void samd_main(void) {
|
||||||
gc_init(&_sheap, &_eheap);
|
gc_init(&_sheap, &_eheap);
|
||||||
mp_init();
|
mp_init();
|
||||||
|
|
||||||
|
#if MICROPY_PY_BLUETOOTH
|
||||||
|
mp_bluetooth_hci_init();
|
||||||
|
#endif
|
||||||
|
|
||||||
// Initialise sub-systems.
|
// Initialise sub-systems.
|
||||||
readline_init0();
|
readline_init0();
|
||||||
#if MICROPY_PY_BLUETOOTH
|
|
||||||
// mp_bluetooth_hci_init();
|
|
||||||
#endif
|
|
||||||
#if MICROPY_PY_NETWORK
|
#if MICROPY_PY_NETWORK
|
||||||
mod_network_init();
|
mod_network_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -3,3 +3,11 @@ include("$(MPY_DIR)/extmod/asyncio")
|
||||||
require("onewire")
|
require("onewire")
|
||||||
require("ds18x20")
|
require("ds18x20")
|
||||||
require("dht")
|
require("dht")
|
||||||
|
|
||||||
|
include(
|
||||||
|
"$(MPY_LIB_DIR)/micropython/bluetooth/aioble/manifest.py",
|
||||||
|
client=True,
|
||||||
|
central=True,
|
||||||
|
l2cap=True,
|
||||||
|
security=True,
|
||||||
|
)
|
||||||
|
|
|
@ -10,16 +10,22 @@ MICROPY_VFS_LFS2 ?= 1
|
||||||
MICROPY_VFS_FAT ?= 1
|
MICROPY_VFS_FAT ?= 1
|
||||||
|
|
||||||
ifeq ($(BOARD_VARIANT),WLAN)
|
ifeq ($(BOARD_VARIANT),WLAN)
|
||||||
|
|
||||||
MICROPY_PY_NETWORK ?= 1
|
MICROPY_PY_NETWORK ?= 1
|
||||||
MICROPY_PY_NETWORK_NINAW10 ?= 1
|
MICROPY_PY_NETWORK_NINAW10 ?= 1
|
||||||
ifeq ($(MICROPY_HW_CODESIZE),496K)
|
ifeq ($(MICROPY_HW_CODESIZE),496K)
|
||||||
MICROPY_PY_SSL ?= 1
|
MICROPY_PY_SSL ?= 1
|
||||||
MICROPY_SSL_MBEDTLS ?= 1
|
MICROPY_SSL_MBEDTLS ?= 1
|
||||||
|
MICROPY_PY_BLUETOOTH ?= 1
|
||||||
|
MICROPY_BLUETOOTH_NIMBLE ?= 1
|
||||||
endif
|
endif
|
||||||
ifeq ($(MICROPY_HW_CODESIZE),1008K)
|
ifeq ($(MICROPY_HW_CODESIZE),1008K)
|
||||||
MICROPY_PY_SSL ?= 1
|
MICROPY_PY_SSL ?= 1
|
||||||
MICROPY_SSL_MBEDTLS ?= 1
|
MICROPY_SSL_MBEDTLS ?= 1
|
||||||
|
MICROPY_PY_BLUETOOTH ?= 1
|
||||||
|
MICROPY_BLUETOOTH_NIMBLE ?= 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(MICROPY_PY_NETWORK),1)
|
ifeq ($(MICROPY_PY_NETWORK),1)
|
||||||
|
@ -58,3 +64,15 @@ SRC_C += \
|
||||||
nina_wifi_bsp.c
|
nina_wifi_bsp.c
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(MICROPY_BLUETOOTH_NIMBLE), 1)
|
||||||
|
SRC_C += \
|
||||||
|
mpbthciport.c \
|
||||||
|
mpnimbleport.c
|
||||||
|
|
||||||
|
INC += \
|
||||||
|
-I$(TOP)/extmod/nimble \
|
||||||
|
-I$(TOP)/lib/mynewt-nimble/nimble/host/include \
|
||||||
|
-I$(TOP)/lib/mynewt-nimble/nimble/include \
|
||||||
|
-I$(TOP)/lib/mynewt-nimble/porting/nimble/include
|
||||||
|
endif
|
||||||
|
|
|
@ -28,6 +28,9 @@
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
PENDSV_DISPATCH_SOFT_TIMER, // For later & for having at least one entry
|
PENDSV_DISPATCH_SOFT_TIMER, // For later & for having at least one entry
|
||||||
|
#if MICROPY_PY_BLUETOOTH && !MICROPY_PY_BLUETOOTH_USE_SYNC_EVENTS
|
||||||
|
PENDSV_DISPATCH_BLUETOOTH_HCI,
|
||||||
|
#endif
|
||||||
MICROPY_BOARD_PENDSV_ENTRIES
|
MICROPY_BOARD_PENDSV_ENTRIES
|
||||||
PENDSV_DISPATCH_MAX
|
PENDSV_DISPATCH_MAX
|
||||||
};
|
};
|
||||||
|
|
Ładowanie…
Reference in New Issue