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-05-11 12:53:53 -04:00
|
|
|
INC += -Idrivers/bluetooth/$(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-05-11 12:53:53 -04:00
|
|
|
SOFTDEV_HEX_PATH = drivers/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-05-11 12:53:53 -04:00
|
|
|
INC += -Idrivers/bluetooth/$(SD)_$(MCU_VARIANT)_$(SOFTDEV_VERSION)/$(SD)_$(MCU_VARIANT)_$(SOFTDEV_VERSION)_API/include
|
|
|
|
INC += -Idrivers/bluetooth/$(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-24 17:03:54 -04:00
|
|
|
|
|
|
|
ifeq ($(SOFTDEV_VERSION), 2.0.1)
|
|
|
|
CFLAGS += -DBLE_API_VERSION=2
|
2017-04-24 17:14:04 -04:00
|
|
|
else ifeq ($(SOFTDEV_VERSION), 3.0.0)
|
2017-04-24 17:03:54 -04:00
|
|
|
CFLAGS += -DBLE_API_VERSION=3
|
|
|
|
endif
|
|
|
|
|
2017-04-21 12:55:59 -04:00
|
|
|
SOFTDEV_HEX_NAME = $(SD)_$(MCU_VARIANT)_$(SOFTDEV_VERSION)_softdevice.hex
|
2017-05-11 12:53:53 -04:00
|
|
|
SOFTDEV_HEX_PATH = drivers/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: #
|
|
|
|
# #
|
2017-05-11 12:53:53 -04:00
|
|
|
# drivers/bluetooth/download_ble_stack.sh #
|
2017-04-21 12:55:59 -04:00
|
|
|
# #
|
|
|
|
#######################################################
|
|
|
|
|
|
|
|
endef
|
|
|
|
|
|
|
|
|
|
|
|
SOFTDEV_HEX = $(SOFTDEV_HEX_PATH)/$(SOFTDEV_HEX_NAME)
|
|
|
|
|
|
|
|
ifeq ($(shell test ! -e $(SOFTDEV_HEX) && echo -n no),no)
|
|
|
|
$(error $(STACK_MISSING_ERROR))
|
|
|
|
endif
|