2016-12-13 14:27:26 -05:00
|
|
|
|
2017-03-04 11:52:20 -05:00
|
|
|
SOFTDEV_HEX_NAME ?=
|
2017-04-21 12:55:59 -04:00
|
|
|
SOFTDEV_HEX_PATH ?=
|
2016-12-13 14:27:26 -05:00
|
|
|
|
2017-03-04 11:52:20 -05:00
|
|
|
ifeq ($(SD), s110)
|
2017-04-24 15:46:28 -04:00
|
|
|
INC += -Ibluetooth/$(SD)_$(MCU_VARIANT)_$(SOFTDEV_VERSION)/$(SD)_$(MCU_VARIANT)_$(SOFTDEV_VERSION)_API/include
|
2017-03-04 11:52:20 -05:00
|
|
|
CFLAGS += -DBLUETOOTH_SD_DEBUG=1
|
|
|
|
CFLAGS += -DBLUETOOTH_SD=110
|
2017-04-21 12:55:59 -04:00
|
|
|
SOFTDEV_HEX_NAME = $(SD)_$(MCU_VARIANT)_$(SOFTDEV_VERSION)_softdevice.hex
|
2017-04-24 15:46:28 -04:00
|
|
|
SOFTDEV_HEX_PATH = bluetooth/$(SD)_$(MCU_VARIANT)_$(SOFTDEV_VERSION)
|
2017-04-21 12:55:59 -04:00
|
|
|
|
2016-12-13 14:27:26 -05:00
|
|
|
else ifeq ($(SD), s120)
|
2017-03-04 11:52:20 -05:00
|
|
|
$(error No BLE wrapper available yet)
|
2016-12-13 14:27:26 -05:00
|
|
|
else ifeq ($(SD), s130)
|
2017-03-04 11:52:20 -05:00
|
|
|
$(error No BLE wrapper available yet)
|
2016-12-13 14:27:26 -05:00
|
|
|
else ifeq ($(SD), s132)
|
2017-04-24 15:46:28 -04:00
|
|
|
INC += -Ibluetooth/$(SD)_$(MCU_VARIANT)_$(SOFTDEV_VERSION)/$(SD)_$(MCU_VARIANT)_$(SOFTDEV_VERSION)_API/include
|
|
|
|
INC += -Ibluetooth/$(SD)_$(MCU_VARIANT)_$(SOFTDEV_VERSION)/$(SD)_$(MCU_VARIANT)_$(SOFTDEV_VERSION)_API/include/$(MCU_VARIANT)
|
2017-03-04 11:52:20 -05:00
|
|
|
CFLAGS += -DBLUETOOTH_SD_DEBUG=1
|
|
|
|
CFLAGS += -DBLUETOOTH_SD=132
|
2017-04-21 12:55:59 -04:00
|
|
|
SOFTDEV_HEX_NAME = $(SD)_$(MCU_VARIANT)_$(SOFTDEV_VERSION)_softdevice.hex
|
2017-04-24 15:46:28 -04:00
|
|
|
SOFTDEV_HEX_PATH = bluetooth/$(SD)_$(MCU_VARIANT)_$(SOFTDEV_VERSION)
|
2016-12-13 14:27:26 -05:00
|
|
|
else
|
2017-03-04 11:52:20 -05:00
|
|
|
$(error Incorrect softdevice set flag)
|
2016-12-13 14:27:26 -05:00
|
|
|
endif
|
|
|
|
|
2017-04-21 12:55:59 -04:00
|
|
|
define STACK_MISSING_ERROR
|
|
|
|
|
|
|
|
|
|
|
|
###### ERROR: Bluetooth LE Stack not found ############
|
|
|
|
# #
|
|
|
|
# The build target requires a Bluetooth LE stack. #
|
|
|
|
# $(SD)_$(MCU_VARIANT)_$(SOFTDEV_VERSION) Bluetooth LE stack not found. #
|
|
|
|
# #
|
|
|
|
# Please run the download script: #
|
|
|
|
# #
|
|
|
|
# bluetooth/download_ble_stack.sh #
|
|
|
|
# #
|
|
|
|
#######################################################
|
|
|
|
|
|
|
|
endef
|
|
|
|
|
|
|
|
|
|
|
|
SOFTDEV_HEX = $(SOFTDEV_HEX_PATH)/$(SOFTDEV_HEX_NAME)
|
|
|
|
|
|
|
|
ifeq ($(shell test ! -e $(SOFTDEV_HEX) && echo -n no),no)
|
|
|
|
$(error $(STACK_MISSING_ERROR))
|
|
|
|
endif
|
2016-12-13 14:27:26 -05:00
|
|
|
|
2017-03-04 11:58:31 -05:00
|
|
|
INC += -I./bluetooth
|
2016-12-13 14:27:26 -05:00
|
|
|
|
|
|
|
SRC_C += \
|
2017-03-04 11:58:31 -05:00
|
|
|
bluetooth/modble.c \
|
|
|
|
bluetooth/ble_drv.c \
|
|
|
|
bluetooth/ble_uart.c
|