summaryrefslogtreecommitdiff
path: root/examples/peripheral
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2016-09-13 08:31:50 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2016-09-13 08:31:50 +0200
commit8ac5d7cc4b380105615ab4f02484c135c8a8b468 (patch)
treee9b2c5cc4af0d6577dc8c5fe94e298cc892d6cab /examples/peripheral
parentbdc858984befd42851015ccead7095c9e8de3a75 (diff)
downloadnrf-playground-8ac5d7cc4b380105615ab4f02484c135c8a8b468.tar.gz
nrf-playground-8ac5d7cc4b380105615ab4f02484c135c8a8b468.tar.bz2
nrf-playground-8ac5d7cc4b380105615ab4f02484c135c8a8b468.tar.xz
nrf-playground-8ac5d7cc4b380105615ab4f02484c135c8a8b468.zip
o Adding new working(!) examples, blinky and ble_app_hrs.HEADmaster
Diffstat (limited to 'examples/peripheral')
-rw-r--r--examples/peripheral/blinky/CMakeLists.txt51
1 files changed, 51 insertions, 0 deletions
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})