diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 01ecff8..f639f6c 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -9,7 +9,7 @@ find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) project(app LANGUAGES C) -target_sources(app PRIVATE src/main.c) +target_sources(app PRIVATE src/main.cpp) # The code below locates the git index file for this repository and adds it as a dependency for # the application VERSION file so that if the repo has a new commit added, even if no files in diff --git a/app/prj.conf b/app/prj.conf index ac51ec3..3357cc9 100644 --- a/app/prj.conf +++ b/app/prj.conf @@ -3,5 +3,9 @@ # # This file contains selected Kconfig options for the application. +# C++ +CONFIG_CPP=y +CONFIG_STD_CPP23=y + CONFIG_SENSOR=y CONFIG_BLINK=y diff --git a/app/src/main.c b/app/src/main.cpp similarity index 80% rename from app/src/main.c rename to app/src/main.cpp index c43bc3c..888e381 100644 --- a/app/src/main.c +++ b/app/src/main.cpp @@ -10,10 +10,11 @@ LOG_MODULE_REGISTER(main, CONFIG_APP_LOG_LEVEL); -int main(void) { +int main() { printk("Zephyr Example Application %s\n", APP_VERSION_STRING); + printk("Build with C++ standard: %ldL\n", __cplusplus); - while (1) { + while (true) { printk("Running...\n"); k_sleep(K_SECONDS(5)); }