diff --git a/wireless/bluetooth/nimble/Kconfig b/wireless/bluetooth/nimble/Kconfig index 5d1ef3b50..d8f45006c 100644 --- a/wireless/bluetooth/nimble/Kconfig +++ b/wireless/bluetooth/nimble/Kconfig @@ -7,13 +7,23 @@ config NIMBLE host-layer stack. if NIMBLE -config NIMBLE_STACKSIZE - int "nimble stack size" - default DEFAULT_TASK_STACKSIZE config NIMBLE_REF string "Version" default "bc7828341226d860429c63994065f8f1b8b8d7b0" ---help--- Git ref name to use when downloading from nimBLE repo -endif + +config NIMBLE_PORTING_EXAMPLE + bool "Apache nimBLE NuttX porting example" + default y + +if NIMBLE_PORTING_EXAMPLE + +config NIMBLE_PORTING_EXAMPLE_STACKSIZE + int "Apache NimBLE NuttX porting example stack size" + default DEFAULT_TASK_STACKSIZE + +endif # NIMBLE_PORTING_EXAMPLE + +endif # NIMBLE diff --git a/wireless/bluetooth/nimble/Makefile b/wireless/bluetooth/nimble/Makefile index fcd2bb746..db768db9f 100644 --- a/wireless/bluetooth/nimble/Makefile +++ b/wireless/bluetooth/nimble/Makefile @@ -20,18 +20,24 @@ include $(APPDIR)/Make.defs -PRIORITY = 255 -STACKSIZE = $(CONFIG_NIMBLE_STACKSIZE) - NIMBLE_UNPACKDIR = mynewt-nimble NIMBLE_ROOT = $(APPDIR)/wireless/bluetooth/nimble/$(NIMBLE_UNPACKDIR) - --include $(NIMBLE_ROOT)/porting/examples/nuttx/Make.defs - CONFIG_NIMBLE_REF := $(patsubst "%",%,$(strip $(CONFIG_NIMBLE_REF))) NIMBLE_TAR := $(CONFIG_NIMBLE_REF).tar.gz NIMBLE_URL := https://github.com/apache/mynewt-nimble/archive/$(NIMBLE_TAR) +ifneq ($(CONFIG_NIMBLE_PORTING_EXAMPLE),) +# Nimble porting example built-in application + +-include $(NIMBLE_ROOT)/porting/examples/nuttx/Make.defs +PRIORITY = 255 +STACKSIZE = $(CONFIG_NIMBLE_PORTING_EXAMPLE_STACKSIZE) + +# nimBLE assumes this flag since it expects undefined macros to be zero value + +CFLAGS += -Wno-pointer-to-int-cast -Wno-undef +endif + $(NIMBLE_TAR): $(Q) curl -L $(NIMBLE_URL) -o $(NIMBLE_TAR) @@ -49,8 +55,4 @@ distclean:: $(call DELDIR,$(NIMBLE_UNPACKDIR)) endif -# nimBLE assumes this flag since it expects undefined macros to be zero value - -CFLAGS += -Wno-pointer-to-int-cast -Wno-undef - include $(APPDIR)/Application.mk