From 5579a3993a40911bddcb4e38d3aa4ce40c4cbc5e Mon Sep 17 00:00:00 2001 From: Eduard Iten Date: Wed, 9 Jul 2025 08:34:18 +0200 Subject: [PATCH] Add Zephyr hello world project and update .gitignore --- .gitignore | 58 ++++++++++++++++++++++++++++---------------------- CMakeLists.txt | 6 ++++++ prj.conf | 1 + src/main.c | 10 +++++++++ 4 files changed, 50 insertions(+), 25 deletions(-) create mode 100644 CMakeLists.txt create mode 100644 prj.conf create mode 100644 src/main.c diff --git a/.gitignore b/.gitignore index 8f3be2e..454a207 100644 --- a/.gitignore +++ b/.gitignore @@ -1,28 +1,36 @@ -# ---> Zephir -# Cache files, generates by Zephir -.temp/ -.libs/ +# Generic Zephyr build output +build/ -# Object files, generates by linker -*.lo -*.la -*.o -*.loT +# West generated files +.west/ -# Files generated by configure and Zephir, -# not required for extension compilation. -ext/build/ -ext/modules/ -ext/Makefile* -ext/config* -ext/acinclude.m4 -ext/aclocal.m4 -ext/autom4te* -ext/install-sh -ext/ltmain.sh -ext/missing -ext/mkinstalldirs -ext/run-tests.php -ext/.deps -ext/libtool +# CMake generated files +CMakeCache.txt +CMakeFiles/ +Makefile +cmake_install.cmake +# Editor and OS generated files +*~ +*.swp +*.swo +*.bak +*.orig +.DS_Store +.vscode/ +.idea/ + +# Doxygen output +html/ +latex/ + +# Python virtual environment +virtualenv/ +.venv/ + +# Miscellaneous +*.log +*.bin +*.hex +*.elf +*.map \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..594777d --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.20.0) + +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(hello_world) + +target_sources(app PRIVATE src/main.c) diff --git a/prj.conf b/prj.conf new file mode 100644 index 0000000..1e935e9 --- /dev/null +++ b/prj.conf @@ -0,0 +1 @@ +CONFIG_LOG=y diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..c386989 --- /dev/null +++ b/src/main.c @@ -0,0 +1,10 @@ +#include +#include + +LOG_MODULE_REGISTER(hello_world, LOG_LEVEL_INF); + +int main(void) +{ + LOG_INF("Hello World from Zephyr!"); + return 0; +}