2018-02-07 15:45:46 -05:00
|
|
|
ifeq ($(SD), s132)
|
2017-03-04 11:52:20 -05:00
|
|
|
CFLAGS += -DBLUETOOTH_SD=132
|
2017-04-24 17:03:54 -04:00
|
|
|
|
|
|
|
ifeq ($(SOFTDEV_VERSION), 2.0.1)
|
|
|
|
CFLAGS += -DBLE_API_VERSION=2
|
2018-02-07 15:45:46 -05:00
|
|
|
else ifeq ($(SOFTDEV_VERSION), 5.0.0)
|
|
|
|
CFLAGS += -DBLE_API_VERSION=4
|
2017-04-24 17:03:54 -04:00
|
|
|
endif
|
2018-02-02 15:01:01 -05:00
|
|
|
else ifeq ($(SD), s140)
|
2018-02-07 15:45:46 -05:00
|
|
|
CFLAGS += -DBLUETOOTH_SD=140
|
|
|
|
CFLAGS += -DBLE_API_VERSION=4
|
2016-12-13 14:27:26 -05:00
|
|
|
else
|
2018-01-31 01:29:31 -05:00
|
|
|
$(error Incorrect softdevice set flag)
|
2016-12-13 14:27:26 -05:00
|
|
|
endif
|
|
|
|
|
2018-02-07 15:45:46 -05:00
|
|
|
CFLAGS += -DBLUETOOTH_SD_DEBUG=1
|
|
|
|
|
2018-06-18 17:11:30 -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)
|
2018-02-07 15:45:46 -05:00
|
|
|
|
2018-06-18 17:11:30 -04:00
|
|
|
SOFTDEV_HEX_NAME = $(SD)_$(MCU_VARIANT)_$(SOFTDEV_VERSION)_softdevice.hex
|
2018-02-07 15:45:46 -05:00
|
|
|
SOFTDEV_HEX_PATH = drivers/bluetooth/$(SD)_$(MCU_VARIANT)_$(SOFTDEV_VERSION)
|
|
|
|
SOFTDEV_HEX = $(SOFTDEV_HEX_PATH)/$(SOFTDEV_HEX_NAME)
|
|
|
|
|
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. #
|
2018-02-07 15:45:46 -05:00
|
|
|
# $(SOFTDEV_VERSION_LONG) Bluetooth LE stack not found. #
|
2017-04-21 12:55:59 -04:00
|
|
|
# #
|
|
|
|
# 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
|
|
|
|
|
|
|
|
ifeq ($(shell test ! -e $(SOFTDEV_HEX) && echo -n no),no)
|
|
|
|
$(error $(STACK_MISSING_ERROR))
|
|
|
|
endif
|