summaryrefslogtreecommitdiff
path: root/examples/device/cdc_msc
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2025-01-26 00:24:25 +0700
committerGitHub <[email protected]>2025-01-26 00:24:25 +0700
commit0d4f945bdce5bbe47feab51b2a77a26f30aac0bd (patch)
treeae8b33a10bf1a13b70de459796da9f78494e6b19 /examples/device/cdc_msc
parent37e6f496197e0bc35ca0f71cfef80c19be273ca3 (diff)
parent882cb1406d19a3a16d530ec8bd5d8fb7571a4eef (diff)
Merge pull request #2962 from hathach/zephyr-support
Initial Zephyr support
Diffstat (limited to 'examples/device/cdc_msc')
-rw-r--r--examples/device/cdc_msc/CMakeLists.txt19
-rw-r--r--examples/device/cdc_msc/prj.conf6
2 files changed, 18 insertions, 7 deletions
diff --git a/examples/device/cdc_msc/CMakeLists.txt b/examples/device/cdc_msc/CMakeLists.txt
index c2f9cb095..b07f92342 100644
--- a/examples/device/cdc_msc/CMakeLists.txt
+++ b/examples/device/cdc_msc/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.17)
+cmake_minimum_required(VERSION 3.20)
#set_property(GLOBAL PROPERTY USE_FOLDERS ON)
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
@@ -16,20 +16,25 @@ if(FAMILY STREQUAL "espressif")
return()
endif()
-add_executable(${PROJECT})
+if (RTOS STREQUAL zephyr)
+ set(EXE_NAME app)
+else()
+ set(EXE_NAME ${PROJECT})
+ add_executable(${EXE_NAME})
+endif()
# Example source
-target_sources(${PROJECT} PUBLIC
+target_sources(${EXE_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
${CMAKE_CURRENT_SOURCE_DIR}/src/msc_disk.c
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
)
# Example include
-target_include_directories(${PROJECT} PUBLIC
+target_include_directories(${EXE_NAME} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
)
-# Configure compilation flags and libraries for the example... see the corresponding function
-# in hw/bsp/FAMILY/family.cmake for details.
-family_configure_device_example(${PROJECT} noos)
+# Configure compilation flags and libraries for the example without RTOS.
+# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
+family_configure_device_example(${EXE_NAME} ${RTOS})
diff --git a/examples/device/cdc_msc/prj.conf b/examples/device/cdc_msc/prj.conf
new file mode 100644
index 000000000..2f5139d9d
--- /dev/null
+++ b/examples/device/cdc_msc/prj.conf
@@ -0,0 +1,6 @@
+CONFIG_GPIO=y
+CONFIG_FPU=y
+CONFIG_NO_OPTIMIZATIONS=y
+CONFIG_UART_INTERRUPT_DRIVEN=y
+CONFIG_NRFX_POWER=y
+CONFIG_NRFX_UARTE0=y