From 8ac5d7cc4b380105615ab4f02484c135c8a8b468 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Tue, 13 Sep 2016 08:31:50 +0200 Subject: o Adding new working(!) examples, blinky and ble_app_hrs. --- examples/peripheral/blinky/CMakeLists.txt | 51 +++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 examples/peripheral/blinky/CMakeLists.txt (limited to 'examples/peripheral/blinky') diff --git a/examples/peripheral/blinky/CMakeLists.txt b/examples/peripheral/blinky/CMakeLists.txt new file mode 100644 index 0000000..fc51f55 --- /dev/null +++ b/examples/peripheral/blinky/CMakeLists.txt @@ -0,0 +1,51 @@ +set(T blinky) +set(D ${MCU_NRF5X_SDK_PATH}/examples/peripheral/${T}) + +if (NOT EXISTS ${D}) + message("${T}: Not available in this SDK version: ${D}") + return() +endif () + +if (MCU_CHIP MATCHES "nrf51.*") + set(SDK_CONFIG ${D}/pca10028/s130/config/sdk_config.h) + set(D_BOARD BOARD_PCA10028) +elseif (MCU_CHIP MATCHES "nrf52.*") + set(SDK_CONFIG ${D}/pca10040/blank/config/sdk_config.h) + set(D_BOARD BOARD_PCA10040) +endif () + +message("${T}: Configured for chip ${MCU_CHIP}, using sdk config=${SDK_CONFIG}, board define: ${D_BOARD}") + +if (MCU_NRF5X_SDK_VERSION VERSION_GREATER 7) + list(APPEND EXTRA_SOURCE_DIRS + ${MCU_NRF5X_SDK_PATH}/components/drivers_nrf/delay + ) +endif () + +mcu_include_directories_from_sources( + SOURCES_VAR SOURCES + HEADERS_VAR HEADERS + INCLUDES_VAR INCLUDES + SOURCE_DIR + ${MCU_NRF5X_SDK_PATH}/components/drivers_nrf/hal + ${MCU_NRF5X_SDK_PATH}/components/libraries/button + ${MCU_NRF5X_SDK_PATH}/components/libraries/log + ${MCU_NRF5X_SDK_PATH}/components/libraries/util + ${EXTRA_SOURCE_DIRS} + EXCLUDE + "app_error_weak_cmock" +) + +add_executable(${T} + ${D}/main.c ${SDK_CONFIG} + ${SOURCES} ${HEADERS}) + +target_include_directories(${T} PUBLIC + ${INCLUDES} + ${MCU_NRF5X_SDK_PATH}/examples/bsp + ) +target_compile_definitions(${T} PUBLIC ${D_BOARD}) +target_compile_definitions(${T} PUBLIC BLE_STACK_SUPPORT_REQD) +target_compile_definitions(${T} PUBLIC NRF_SD_BLE_API_VERSION=3) +mcu_add_executable(TARGET ${T} + SDK_CONFIG ${SDK_CONFIG}) -- cgit v1.2.3